@angular-devkit/build-angular 18.0.0-next.2 → 18.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builders.json +1 -5
- package/package.json +21 -20
- package/src/builders/app-shell/index.js +3 -5
- package/src/builders/browser/index.d.ts +1 -1
- package/src/builders/browser/index.js +9 -13
- package/src/builders/browser-esbuild/index.d.ts +2 -2
- package/src/builders/browser-esbuild/index.js +6 -9
- package/src/builders/dev-server/builder.d.ts +2 -2
- package/src/builders/dev-server/builder.js +11 -6
- package/src/builders/dev-server/index.d.ts +1 -1
- package/src/builders/dev-server/webpack-server.d.ts +1 -1
- package/src/builders/dev-server/webpack-server.js +5 -6
- package/src/builders/extract-i18n/application-extraction.js +2 -2
- package/src/builders/extract-i18n/builder.js +3 -4
- package/src/builders/extract-i18n/options.d.ts +1 -1
- package/src/builders/extract-i18n/options.js +2 -2
- package/src/builders/jest/index.js +2 -2
- package/src/builders/karma/index.js +3 -4
- package/src/builders/ng-packagr/index.js +8 -7
- package/src/builders/ng-packagr/schema.d.ts +4 -0
- package/src/builders/ng-packagr/schema.json +4 -0
- package/src/builders/prerender/index.js +2 -2
- package/src/builders/prerender/render-worker.js +1 -1
- package/src/builders/server/index.js +3 -4
- package/src/builders/server/platform-server-exports-loader.js +2 -1
- package/src/builders/ssr-dev-server/index.js +34 -34
- package/src/builders/web-test-runner/index.js +2 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -2
- package/src/tools/babel/presets/application.js +1 -1
- package/src/tools/webpack/configs/styles.js +2 -2
- package/src/tools/webpack/plugins/any-component-style-budget-checker.d.ts +2 -2
- package/src/tools/webpack/plugins/any-component-style-budget-checker.js +14 -17
- package/src/tools/webpack/plugins/css-optimizer-plugin.js +2 -2
- package/src/tools/webpack/plugins/index-html-webpack-plugin.d.ts +1 -1
- package/src/tools/webpack/plugins/index-html-webpack-plugin.js +3 -3
- package/src/tools/webpack/plugins/javascript-optimizer-plugin.js +2 -2
- package/src/tools/webpack/plugins/service-worker-plugin.js +2 -2
- package/src/tools/webpack/utils/stats.d.ts +1 -14
- package/src/tools/webpack/utils/stats.js +3 -207
- package/src/utils/action-executor.d.ts +1 -1
- package/src/utils/i18n-inlining.d.ts +1 -1
- package/src/utils/i18n-webpack.d.ts +16 -0
- package/src/utils/i18n-webpack.js +107 -0
- package/src/utils/index.d.ts +1 -2
- package/src/utils/index.js +4 -2
- package/src/utils/normalize-builder-schema.js +2 -2
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/normalize-optimization.d.ts +1 -1
- package/src/utils/normalize-optimization.js +0 -2
- package/src/utils/output-paths.d.ts +1 -1
- package/src/utils/webpack-browser-config.d.ts +1 -1
- package/src/utils/webpack-browser-config.js +2 -2
- package/src/builders/application/build-action.d.ts +0 -33
- package/src/builders/application/build-action.js +0 -183
- package/src/builders/application/execute-build.d.ts +0 -11
- package/src/builders/application/execute-build.js +0 -127
- package/src/builders/application/execute-post-bundle.d.ts +0 -25
- package/src/builders/application/execute-post-bundle.js +0 -96
- package/src/builders/application/i18n.d.ts +0 -29
- package/src/builders/application/i18n.js +0 -128
- package/src/builders/application/index.d.ts +0 -57
- package/src/builders/application/index.js +0 -121
- package/src/builders/application/options.d.ts +0 -149
- package/src/builders/application/options.js +0 -352
- package/src/builders/application/schema.d.ts +0 -512
- package/src/builders/application/schema.js +0 -58
- package/src/builders/application/schema.json +0 -635
- package/src/builders/application/setup-bundling.d.ts +0 -19
- package/src/builders/application/setup-bundling.js +0 -71
- package/src/builders/dev-server/vite-server.d.ts +0 -30
- package/src/builders/dev-server/vite-server.js +0 -502
- package/src/tools/babel/plugins/adjust-static-class-members.d.ts +0 -27
- package/src/tools/babel/plugins/adjust-static-class-members.js +0 -351
- package/src/tools/babel/plugins/adjust-typescript-enums.d.ts +0 -23
- package/src/tools/babel/plugins/adjust-typescript-enums.js +0 -113
- package/src/tools/babel/plugins/elide-angular-metadata.d.ts +0 -23
- package/src/tools/babel/plugins/elide-angular-metadata.js +0 -110
- package/src/tools/babel/plugins/index.d.ts +0 -11
- package/src/tools/babel/plugins/index.js +0 -21
- package/src/tools/babel/plugins/pure-toplevel-functions.d.ts +0 -16
- package/src/tools/babel/plugins/pure-toplevel-functions.js +0 -90
- package/src/tools/esbuild/angular/angular-host.d.ts +0 -26
- package/src/tools/esbuild/angular/angular-host.js +0 -72
- package/src/tools/esbuild/angular/compilation/angular-compilation.d.ts +0 -42
- package/src/tools/esbuild/angular/compilation/angular-compilation.js +0 -94
- package/src/tools/esbuild/angular/compilation/aot-compilation.d.ts +0 -21
- package/src/tools/esbuild/angular/compilation/aot-compilation.js +0 -228
- package/src/tools/esbuild/angular/compilation/factory.d.ts +0 -16
- package/src/tools/esbuild/angular/compilation/factory.js +0 -56
- package/src/tools/esbuild/angular/compilation/index.d.ts +0 -10
- package/src/tools/esbuild/angular/compilation/index.js +0 -17
- package/src/tools/esbuild/angular/compilation/jit-compilation.d.ts +0 -21
- package/src/tools/esbuild/angular/compilation/jit-compilation.js +0 -106
- package/src/tools/esbuild/angular/compilation/noop-compilation.d.ts +0 -20
- package/src/tools/esbuild/angular/compilation/noop-compilation.js +0 -26
- package/src/tools/esbuild/angular/compilation/parallel-compilation.d.ts +0 -42
- package/src/tools/esbuild/angular/compilation/parallel-compilation.js +0 -123
- package/src/tools/esbuild/angular/compilation/parallel-worker.d.ts +0 -33
- package/src/tools/esbuild/angular/compilation/parallel-worker.js +0 -90
- package/src/tools/esbuild/angular/compilation-state.d.ts +0 -15
- package/src/tools/esbuild/angular/compilation-state.js +0 -44
- package/src/tools/esbuild/angular/compiler-plugin.d.ts +0 -27
- package/src/tools/esbuild/angular/compiler-plugin.js +0 -433
- package/src/tools/esbuild/angular/component-stylesheets.d.ts +0 -44
- package/src/tools/esbuild/angular/component-stylesheets.js +0 -150
- package/src/tools/esbuild/angular/diagnostics.d.ts +0 -15
- package/src/tools/esbuild/angular/diagnostics.js +0 -69
- package/src/tools/esbuild/angular/file-reference-tracker.d.ts +0 -17
- package/src/tools/esbuild/angular/file-reference-tracker.js +0 -57
- package/src/tools/esbuild/angular/jit-plugin-callbacks.d.ts +0 -23
- package/src/tools/esbuild/angular/jit-plugin-callbacks.js +0 -117
- package/src/tools/esbuild/angular/jit-resource-transformer.d.ts +0 -17
- package/src/tools/esbuild/angular/jit-resource-transformer.js +0 -186
- package/src/tools/esbuild/angular/source-file-cache.d.ts +0 -18
- package/src/tools/esbuild/angular/source-file-cache.js +0 -65
- package/src/tools/esbuild/angular/uri.d.ts +0 -54
- package/src/tools/esbuild/angular/uri.js +0 -74
- package/src/tools/esbuild/angular/web-worker-transformer.d.ts +0 -17
- package/src/tools/esbuild/angular/web-worker-transformer.js +0 -94
- package/src/tools/esbuild/application-code-bundle.d.ts +0 -20
- package/src/tools/esbuild/application-code-bundle.js +0 -368
- package/src/tools/esbuild/budget-stats.d.ts +0 -19
- package/src/tools/esbuild/budget-stats.js +0 -59
- package/src/tools/esbuild/bundler-context.d.ts +0 -75
- package/src/tools/esbuild/bundler-context.js +0 -366
- package/src/tools/esbuild/bundler-execution-result.d.ts +0 -71
- package/src/tools/esbuild/bundler-execution-result.js +0 -131
- package/src/tools/esbuild/cache.d.ts +0 -88
- package/src/tools/esbuild/cache.js +0 -92
- package/src/tools/esbuild/commonjs-checker.d.ts +0 -28
- package/src/tools/esbuild/commonjs-checker.js +0 -151
- package/src/tools/esbuild/compiler-plugin-options.d.ts +0 -16
- package/src/tools/esbuild/compiler-plugin-options.js +0 -49
- package/src/tools/esbuild/external-packages-plugin.d.ts +0 -18
- package/src/tools/esbuild/external-packages-plugin.js +0 -70
- package/src/tools/esbuild/global-scripts.d.ts +0 -16
- package/src/tools/esbuild/global-scripts.js +0 -142
- package/src/tools/esbuild/global-styles.d.ts +0 -10
- package/src/tools/esbuild/global-styles.js +0 -74
- package/src/tools/esbuild/i18n-inliner-worker.d.ts +0 -42
- package/src/tools/esbuild/i18n-inliner-worker.js +0 -136
- package/src/tools/esbuild/i18n-inliner.d.ts +0 -44
- package/src/tools/esbuild/i18n-inliner.js +0 -150
- package/src/tools/esbuild/i18n-locale-plugin.d.ts +0 -22
- package/src/tools/esbuild/i18n-locale-plugin.js +0 -120
- package/src/tools/esbuild/index-html-generator.d.ts +0 -15
- package/src/tools/esbuild/index-html-generator.js +0 -129
- package/src/tools/esbuild/javascript-transformer-worker.d.ts +0 -19
- package/src/tools/esbuild/javascript-transformer-worker.js +0 -154
- package/src/tools/esbuild/javascript-transformer.d.ts +0 -54
- package/src/tools/esbuild/javascript-transformer.js +0 -143
- package/src/tools/esbuild/license-extractor.d.ts +0 -25
- package/src/tools/esbuild/license-extractor.js +0 -158
- package/src/tools/esbuild/load-result-cache.d.ts +0 -21
- package/src/tools/esbuild/load-result-cache.js +0 -75
- package/src/tools/esbuild/profiling.d.ts +0 -11
- package/src/tools/esbuild/profiling.js +0 -78
- package/src/tools/esbuild/rxjs-esm-resolution-plugin.d.ts +0 -18
- package/src/tools/esbuild/rxjs-esm-resolution-plugin.js +0 -44
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.d.ts +0 -17
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.js +0 -73
- package/src/tools/esbuild/stylesheets/bundle-options.d.ts +0 -35
- package/src/tools/esbuild/stylesheets/bundle-options.js +0 -64
- package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.d.ts +0 -25
- package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.js +0 -57
- package/src/tools/esbuild/stylesheets/css-language.d.ts +0 -9
- package/src/tools/esbuild/stylesheets/css-language.js +0 -15
- package/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts +0 -18
- package/src/tools/esbuild/stylesheets/css-resource-plugin.js +0 -107
- package/src/tools/esbuild/stylesheets/less-language.d.ts +0 -9
- package/src/tools/esbuild/stylesheets/less-language.js +0 -155
- package/src/tools/esbuild/stylesheets/sass-language.d.ts +0 -10
- package/src/tools/esbuild/stylesheets/sass-language.js +0 -185
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts +0 -58
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js +0 -282
- package/src/tools/esbuild/utils.d.ts +0 -41
- package/src/tools/esbuild/utils.js +0 -378
- package/src/tools/esbuild/virtual-module-plugin.d.ts +0 -33
- package/src/tools/esbuild/virtual-module-plugin.js +0 -43
- package/src/tools/esbuild/watcher.d.ts +0 -25
- package/src/tools/esbuild/watcher.js +0 -118
- package/src/tools/sass/lexer.d.ts +0 -18
- package/src/tools/sass/lexer.js +0 -161
- package/src/tools/sass/rebasing-importer.d.ts +0 -101
- package/src/tools/sass/rebasing-importer.js +0 -337
- package/src/tools/sass/sass-service.d.ts +0 -49
- package/src/tools/sass/sass-service.js +0 -213
- package/src/tools/sass/worker.d.ts +0 -8
- package/src/tools/sass/worker.js +0 -164
- package/src/tools/vite/angular-memory-plugin.d.ts +0 -24
- package/src/tools/vite/angular-memory-plugin.js +0 -268
- package/src/tools/vite/i18n-locale-plugin.d.ts +0 -18
- package/src/tools/vite/i18n-locale-plugin.js +0 -55
- package/src/typings.d.ts +0 -21
- package/src/utils/bundle-calculator.d.ts +0 -44
- package/src/utils/bundle-calculator.js +0 -302
- package/src/utils/check-port.d.ts +0 -8
- package/src/utils/check-port.js +0 -58
- package/src/utils/delete-output-dir.d.ts +0 -11
- package/src/utils/delete-output-dir.js +0 -46
- package/src/utils/i18n-options.d.ts +0 -40
- package/src/utils/i18n-options.js +0 -254
- package/src/utils/index-file/augment-index-html.d.ts +0 -40
- package/src/utils/index-file/augment-index-html.js +0 -238
- package/src/utils/index-file/html-rewriting-stream.d.ts +0 -11
- package/src/utils/index-file/html-rewriting-stream.js +0 -28
- package/src/utils/index-file/index-html-generator.d.ts +0 -47
- package/src/utils/index-file/index-html-generator.js +0 -119
- package/src/utils/index-file/inline-critical-css.d.ts +0 -24
- package/src/utils/index-file/inline-critical-css.js +0 -179
- package/src/utils/index-file/inline-fonts.d.ts +0 -23
- package/src/utils/index-file/inline-fonts.js +0 -267
- package/src/utils/index-file/style-nonce.d.ts +0 -12
- package/src/utils/index-file/style-nonce.js +0 -53
- package/src/utils/load-proxy-config.d.ts +0 -8
- package/src/utils/load-proxy-config.js +0 -192
- package/src/utils/load-translations.d.ts +0 -16
- package/src/utils/load-translations.js +0 -84
- package/src/utils/postcss-configuration.d.ts +0 -17
- package/src/utils/postcss-configuration.js +0 -86
- package/src/utils/purge-cache.d.ts +0 -10
- package/src/utils/purge-cache.js +0 -40
- package/src/utils/routes-extractor/extractor.d.ts +0 -15
- package/src/utils/routes-extractor/extractor.js +0 -97
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.d.ts +0 -18
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js +0 -129
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.d.ts +0 -8
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js +0 -13
- package/src/utils/server-rendering/fetch-patch.d.ts +0 -8
- package/src/utils/server-rendering/fetch-patch.js +0 -66
- package/src/utils/server-rendering/load-esm-from-memory.d.ts +0 -10
- package/src/utils/server-rendering/load-esm-from-memory.js +0 -26
- package/src/utils/server-rendering/main-bundle-exports.d.ts +0 -27
- package/src/utils/server-rendering/main-bundle-exports.js +0 -9
- package/src/utils/server-rendering/prerender.d.ts +0 -23
- package/src/utils/server-rendering/prerender.js +0 -192
- package/src/utils/server-rendering/render-page.d.ts +0 -26
- package/src/utils/server-rendering/render-page.js +0 -110
- package/src/utils/server-rendering/render-worker.d.ts +0 -22
- package/src/utils/server-rendering/render-worker.js +0 -30
- package/src/utils/server-rendering/routes-extractor-worker.d.ts +0 -21
- package/src/utils/server-rendering/routes-extractor-worker.js +0 -53
- package/src/utils/service-worker.d.ts +0 -25
- package/src/utils/service-worker.js +0 -211
- package/src/utils/supported-browsers.d.ts +0 -10
- package/src/utils/supported-browsers.js +0 -42
- package/src/utils/version.d.ts +0 -8
- package/src/utils/version.js +0 -59
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import type { Plugin } from 'vite';
|
|
9
|
-
/**
|
|
10
|
-
* The base module location used to search for locale specific data.
|
|
11
|
-
*/
|
|
12
|
-
export declare const LOCALE_DATA_BASE_MODULE = "@angular/common/locales/global";
|
|
13
|
-
/**
|
|
14
|
-
* Creates a Vite plugin that resolves Angular locale data files from `@angular/common`.
|
|
15
|
-
*
|
|
16
|
-
* @returns A Vite plugin.
|
|
17
|
-
*/
|
|
18
|
-
export declare function createAngularLocaleDataPlugin(): Plugin;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.createAngularLocaleDataPlugin = exports.LOCALE_DATA_BASE_MODULE = void 0;
|
|
11
|
-
/**
|
|
12
|
-
* The base module location used to search for locale specific data.
|
|
13
|
-
*/
|
|
14
|
-
exports.LOCALE_DATA_BASE_MODULE = '@angular/common/locales/global';
|
|
15
|
-
/**
|
|
16
|
-
* Creates a Vite plugin that resolves Angular locale data files from `@angular/common`.
|
|
17
|
-
*
|
|
18
|
-
* @returns A Vite plugin.
|
|
19
|
-
*/
|
|
20
|
-
function createAngularLocaleDataPlugin() {
|
|
21
|
-
return {
|
|
22
|
-
name: 'angular-locale-data',
|
|
23
|
-
enforce: 'pre',
|
|
24
|
-
async resolveId(source) {
|
|
25
|
-
if (!source.startsWith('angular:locale/data:')) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
// Extract the locale from the path
|
|
29
|
-
const originalLocale = source.split(':', 3)[2];
|
|
30
|
-
// Remove any private subtags since these will never match
|
|
31
|
-
let partialLocale = originalLocale.replace(/-x(-[a-zA-Z0-9]{1,8})+$/, '');
|
|
32
|
-
let exact = true;
|
|
33
|
-
while (partialLocale) {
|
|
34
|
-
const potentialPath = `${exports.LOCALE_DATA_BASE_MODULE}/${partialLocale}`;
|
|
35
|
-
const result = await this.resolve(potentialPath);
|
|
36
|
-
if (result) {
|
|
37
|
-
if (!exact) {
|
|
38
|
-
this.warn(`Locale data for '${originalLocale}' cannot be found. Using locale data for '${partialLocale}'.`);
|
|
39
|
-
}
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
// Remove the last subtag and try again with a less specific locale
|
|
43
|
-
const parts = partialLocale.split('-');
|
|
44
|
-
partialLocale = parts.slice(0, -1).join('-');
|
|
45
|
-
exact = false;
|
|
46
|
-
// The locales "en" and "en-US" are considered exact to retain existing behavior
|
|
47
|
-
if (originalLocale === 'en-US' && partialLocale === 'en') {
|
|
48
|
-
exact = true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
exports.createAngularLocaleDataPlugin = createAngularLocaleDataPlugin;
|
package/src/typings.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
declare module '@babel/helper-annotate-as-pure' {
|
|
10
|
-
export default function annotateAsPure(
|
|
11
|
-
pathOrNode: import('@babel/types').Node | { node: import('@babel/types').Node },
|
|
12
|
-
): void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
declare module '@babel/helper-split-export-declaration' {
|
|
16
|
-
export default function splitExportDeclaration(
|
|
17
|
-
exportDeclaration: import('@babel/core').NodePath<
|
|
18
|
-
import('@babel/types').ExportDefaultDeclaration
|
|
19
|
-
>,
|
|
20
|
-
): void;
|
|
21
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Budget } from '../builders/browser/schema';
|
|
9
|
-
export interface Threshold {
|
|
10
|
-
limit: number;
|
|
11
|
-
type: ThresholdType;
|
|
12
|
-
severity: ThresholdSeverity;
|
|
13
|
-
}
|
|
14
|
-
declare enum ThresholdType {
|
|
15
|
-
Max = "maximum",
|
|
16
|
-
Min = "minimum"
|
|
17
|
-
}
|
|
18
|
-
export declare enum ThresholdSeverity {
|
|
19
|
-
Warning = "warning",
|
|
20
|
-
Error = "error"
|
|
21
|
-
}
|
|
22
|
-
export interface BudgetCalculatorResult {
|
|
23
|
-
severity: ThresholdSeverity;
|
|
24
|
-
message: string;
|
|
25
|
-
label?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface BudgetChunk {
|
|
28
|
-
files?: string[];
|
|
29
|
-
names?: string[];
|
|
30
|
-
initial?: boolean;
|
|
31
|
-
}
|
|
32
|
-
export interface BudgetAsset {
|
|
33
|
-
name: string;
|
|
34
|
-
size: number;
|
|
35
|
-
componentStyle?: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface BudgetStats {
|
|
38
|
-
chunks?: BudgetChunk[];
|
|
39
|
-
assets?: BudgetAsset[];
|
|
40
|
-
}
|
|
41
|
-
export declare function calculateThresholds(budget: Budget): IterableIterator<Threshold>;
|
|
42
|
-
export declare function checkBudgets(budgets: Budget[], stats: BudgetStats, checkComponentStyles?: boolean): IterableIterator<BudgetCalculatorResult>;
|
|
43
|
-
export declare function checkThresholds(thresholds: IterableIterator<Threshold>, size: number, label?: string): IterableIterator<BudgetCalculatorResult>;
|
|
44
|
-
export {};
|
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.checkThresholds = exports.checkBudgets = exports.calculateThresholds = exports.ThresholdSeverity = void 0;
|
|
11
|
-
const schema_1 = require("../builders/browser/schema");
|
|
12
|
-
const stats_1 = require("../tools/webpack/utils/stats");
|
|
13
|
-
var ThresholdType;
|
|
14
|
-
(function (ThresholdType) {
|
|
15
|
-
ThresholdType["Max"] = "maximum";
|
|
16
|
-
ThresholdType["Min"] = "minimum";
|
|
17
|
-
})(ThresholdType || (ThresholdType = {}));
|
|
18
|
-
var ThresholdSeverity;
|
|
19
|
-
(function (ThresholdSeverity) {
|
|
20
|
-
ThresholdSeverity["Warning"] = "warning";
|
|
21
|
-
ThresholdSeverity["Error"] = "error";
|
|
22
|
-
})(ThresholdSeverity || (exports.ThresholdSeverity = ThresholdSeverity = {}));
|
|
23
|
-
function* calculateThresholds(budget) {
|
|
24
|
-
if (budget.maximumWarning) {
|
|
25
|
-
yield {
|
|
26
|
-
limit: calculateBytes(budget.maximumWarning, budget.baseline, 1),
|
|
27
|
-
type: ThresholdType.Max,
|
|
28
|
-
severity: ThresholdSeverity.Warning,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
if (budget.maximumError) {
|
|
32
|
-
yield {
|
|
33
|
-
limit: calculateBytes(budget.maximumError, budget.baseline, 1),
|
|
34
|
-
type: ThresholdType.Max,
|
|
35
|
-
severity: ThresholdSeverity.Error,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
if (budget.minimumWarning) {
|
|
39
|
-
yield {
|
|
40
|
-
limit: calculateBytes(budget.minimumWarning, budget.baseline, -1),
|
|
41
|
-
type: ThresholdType.Min,
|
|
42
|
-
severity: ThresholdSeverity.Warning,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
if (budget.minimumError) {
|
|
46
|
-
yield {
|
|
47
|
-
limit: calculateBytes(budget.minimumError, budget.baseline, -1),
|
|
48
|
-
type: ThresholdType.Min,
|
|
49
|
-
severity: ThresholdSeverity.Error,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
if (budget.warning) {
|
|
53
|
-
yield {
|
|
54
|
-
limit: calculateBytes(budget.warning, budget.baseline, -1),
|
|
55
|
-
type: ThresholdType.Min,
|
|
56
|
-
severity: ThresholdSeverity.Warning,
|
|
57
|
-
};
|
|
58
|
-
yield {
|
|
59
|
-
limit: calculateBytes(budget.warning, budget.baseline, 1),
|
|
60
|
-
type: ThresholdType.Max,
|
|
61
|
-
severity: ThresholdSeverity.Warning,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
if (budget.error) {
|
|
65
|
-
yield {
|
|
66
|
-
limit: calculateBytes(budget.error, budget.baseline, -1),
|
|
67
|
-
type: ThresholdType.Min,
|
|
68
|
-
severity: ThresholdSeverity.Error,
|
|
69
|
-
};
|
|
70
|
-
yield {
|
|
71
|
-
limit: calculateBytes(budget.error, budget.baseline, 1),
|
|
72
|
-
type: ThresholdType.Max,
|
|
73
|
-
severity: ThresholdSeverity.Error,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.calculateThresholds = calculateThresholds;
|
|
78
|
-
/**
|
|
79
|
-
* Calculates the sizes for bundles in the budget type provided.
|
|
80
|
-
*/
|
|
81
|
-
function calculateSizes(budget, stats) {
|
|
82
|
-
const calculatorMap = {
|
|
83
|
-
all: AllCalculator,
|
|
84
|
-
allScript: AllScriptCalculator,
|
|
85
|
-
any: AnyCalculator,
|
|
86
|
-
anyScript: AnyScriptCalculator,
|
|
87
|
-
anyComponentStyle: AnyComponentStyleCalculator,
|
|
88
|
-
bundle: BundleCalculator,
|
|
89
|
-
initial: InitialCalculator,
|
|
90
|
-
};
|
|
91
|
-
const ctor = calculatorMap[budget.type];
|
|
92
|
-
const { chunks, assets } = stats;
|
|
93
|
-
if (!chunks) {
|
|
94
|
-
throw new Error('Webpack stats output did not include chunk information.');
|
|
95
|
-
}
|
|
96
|
-
if (!assets) {
|
|
97
|
-
throw new Error('Webpack stats output did not include asset information.');
|
|
98
|
-
}
|
|
99
|
-
const calculator = new ctor(budget, chunks, assets);
|
|
100
|
-
return calculator.calculate();
|
|
101
|
-
}
|
|
102
|
-
class Calculator {
|
|
103
|
-
budget;
|
|
104
|
-
chunks;
|
|
105
|
-
assets;
|
|
106
|
-
constructor(budget, chunks, assets) {
|
|
107
|
-
this.budget = budget;
|
|
108
|
-
this.chunks = chunks;
|
|
109
|
-
this.assets = assets;
|
|
110
|
-
}
|
|
111
|
-
/** Calculates the size of the given chunk for the provided build type. */
|
|
112
|
-
calculateChunkSize(chunk) {
|
|
113
|
-
// No differential builds, get the chunk size by summing its assets.
|
|
114
|
-
if (!chunk.files) {
|
|
115
|
-
return 0;
|
|
116
|
-
}
|
|
117
|
-
return chunk.files
|
|
118
|
-
.filter((file) => !file.endsWith('.map'))
|
|
119
|
-
.map((file) => {
|
|
120
|
-
const asset = this.assets.find((asset) => asset.name === file);
|
|
121
|
-
if (!asset) {
|
|
122
|
-
throw new Error(`Could not find asset for file: ${file}`);
|
|
123
|
-
}
|
|
124
|
-
return asset.size;
|
|
125
|
-
})
|
|
126
|
-
.reduce((l, r) => l + r, 0);
|
|
127
|
-
}
|
|
128
|
-
getAssetSize(asset) {
|
|
129
|
-
return asset.size;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* A named bundle.
|
|
134
|
-
*/
|
|
135
|
-
class BundleCalculator extends Calculator {
|
|
136
|
-
calculate() {
|
|
137
|
-
const budgetName = this.budget.name;
|
|
138
|
-
if (!budgetName) {
|
|
139
|
-
return [];
|
|
140
|
-
}
|
|
141
|
-
const size = this.chunks
|
|
142
|
-
.filter((chunk) => chunk?.names?.includes(budgetName))
|
|
143
|
-
.map((chunk) => this.calculateChunkSize(chunk))
|
|
144
|
-
.reduce((l, r) => l + r, 0);
|
|
145
|
-
return [{ size, label: this.budget.name }];
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* The sum of all initial chunks (marked as initial).
|
|
150
|
-
*/
|
|
151
|
-
class InitialCalculator extends Calculator {
|
|
152
|
-
calculate() {
|
|
153
|
-
return [
|
|
154
|
-
{
|
|
155
|
-
label: `bundle initial`,
|
|
156
|
-
size: this.chunks
|
|
157
|
-
.filter((chunk) => chunk.initial)
|
|
158
|
-
.map((chunk) => this.calculateChunkSize(chunk))
|
|
159
|
-
.reduce((l, r) => l + r, 0),
|
|
160
|
-
},
|
|
161
|
-
];
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* The sum of all the scripts portions.
|
|
166
|
-
*/
|
|
167
|
-
class AllScriptCalculator extends Calculator {
|
|
168
|
-
calculate() {
|
|
169
|
-
const size = this.assets
|
|
170
|
-
.filter((asset) => asset.name.endsWith('.js'))
|
|
171
|
-
.map((asset) => this.getAssetSize(asset))
|
|
172
|
-
.reduce((total, size) => total + size, 0);
|
|
173
|
-
return [{ size, label: 'total scripts' }];
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* All scripts and assets added together.
|
|
178
|
-
*/
|
|
179
|
-
class AllCalculator extends Calculator {
|
|
180
|
-
calculate() {
|
|
181
|
-
const size = this.assets
|
|
182
|
-
.filter((asset) => !asset.name.endsWith('.map'))
|
|
183
|
-
.map((asset) => this.getAssetSize(asset))
|
|
184
|
-
.reduce((total, size) => total + size, 0);
|
|
185
|
-
return [{ size, label: 'total' }];
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Any script, individually.
|
|
190
|
-
*/
|
|
191
|
-
class AnyScriptCalculator extends Calculator {
|
|
192
|
-
calculate() {
|
|
193
|
-
return this.assets
|
|
194
|
-
.filter((asset) => asset.name.endsWith('.js'))
|
|
195
|
-
.map((asset) => ({
|
|
196
|
-
size: this.getAssetSize(asset),
|
|
197
|
-
label: asset.name,
|
|
198
|
-
}));
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Any script or asset (images, css, etc).
|
|
203
|
-
*/
|
|
204
|
-
class AnyCalculator extends Calculator {
|
|
205
|
-
calculate() {
|
|
206
|
-
return this.assets
|
|
207
|
-
.filter((asset) => !asset.name.endsWith('.map'))
|
|
208
|
-
.map((asset) => ({
|
|
209
|
-
size: this.getAssetSize(asset),
|
|
210
|
-
label: asset.name,
|
|
211
|
-
}));
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Any compoonent stylesheet
|
|
216
|
-
*/
|
|
217
|
-
class AnyComponentStyleCalculator extends Calculator {
|
|
218
|
-
calculate() {
|
|
219
|
-
return this.assets
|
|
220
|
-
.filter((asset) => asset.componentStyle)
|
|
221
|
-
.map((asset) => ({
|
|
222
|
-
size: this.getAssetSize(asset),
|
|
223
|
-
label: asset.name,
|
|
224
|
-
}));
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Calculate the bytes given a string value.
|
|
229
|
-
*/
|
|
230
|
-
function calculateBytes(input, baseline, factor = 1) {
|
|
231
|
-
const matches = input.trim().match(/^(\d+(?:\.\d+)?)[ \t]*(%|[kmg]?b)?$/i);
|
|
232
|
-
if (!matches) {
|
|
233
|
-
return NaN;
|
|
234
|
-
}
|
|
235
|
-
const baselineBytes = (baseline && calculateBytes(baseline)) || 0;
|
|
236
|
-
let value = Number(matches[1]);
|
|
237
|
-
switch (matches[2] && matches[2].toLowerCase()) {
|
|
238
|
-
case '%':
|
|
239
|
-
value = (baselineBytes * value) / 100;
|
|
240
|
-
break;
|
|
241
|
-
case 'kb':
|
|
242
|
-
value *= 1024;
|
|
243
|
-
break;
|
|
244
|
-
case 'mb':
|
|
245
|
-
value *= 1024 * 1024;
|
|
246
|
-
break;
|
|
247
|
-
case 'gb':
|
|
248
|
-
value *= 1024 * 1024 * 1024;
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
if (baselineBytes === 0) {
|
|
252
|
-
return value;
|
|
253
|
-
}
|
|
254
|
-
return baselineBytes + value * factor;
|
|
255
|
-
}
|
|
256
|
-
function* checkBudgets(budgets, stats, checkComponentStyles) {
|
|
257
|
-
// Ignore AnyComponentStyle budgets as these are handled in `AnyComponentStyleBudgetChecker` unless requested
|
|
258
|
-
const computableBudgets = checkComponentStyles
|
|
259
|
-
? budgets
|
|
260
|
-
: budgets.filter((budget) => budget.type !== schema_1.Type.AnyComponentStyle);
|
|
261
|
-
for (const budget of computableBudgets) {
|
|
262
|
-
const sizes = calculateSizes(budget, stats);
|
|
263
|
-
for (const { size, label } of sizes) {
|
|
264
|
-
yield* checkThresholds(calculateThresholds(budget), size, label);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
exports.checkBudgets = checkBudgets;
|
|
269
|
-
function* checkThresholds(thresholds, size, label) {
|
|
270
|
-
for (const threshold of thresholds) {
|
|
271
|
-
switch (threshold.type) {
|
|
272
|
-
case ThresholdType.Max: {
|
|
273
|
-
if (size <= threshold.limit) {
|
|
274
|
-
continue;
|
|
275
|
-
}
|
|
276
|
-
const sizeDifference = (0, stats_1.formatSize)(size - threshold.limit);
|
|
277
|
-
yield {
|
|
278
|
-
severity: threshold.severity,
|
|
279
|
-
label,
|
|
280
|
-
message: `${label} exceeded maximum budget. Budget ${(0, stats_1.formatSize)(threshold.limit)} was not met by ${sizeDifference} with a total of ${(0, stats_1.formatSize)(size)}.`,
|
|
281
|
-
};
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
case ThresholdType.Min: {
|
|
285
|
-
if (size >= threshold.limit) {
|
|
286
|
-
continue;
|
|
287
|
-
}
|
|
288
|
-
const sizeDifference = (0, stats_1.formatSize)(threshold.limit - size);
|
|
289
|
-
yield {
|
|
290
|
-
severity: threshold.severity,
|
|
291
|
-
label,
|
|
292
|
-
message: `${label} failed to meet minimum budget. Budget ${(0, stats_1.formatSize)(threshold.limit)} was not met by ${sizeDifference} with a total of ${(0, stats_1.formatSize)(size)}.`,
|
|
293
|
-
};
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
default: {
|
|
297
|
-
throw new Error(`Unexpected threshold type: ${ThresholdType[threshold.type]}`);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
exports.checkThresholds = checkThresholds;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
export declare function checkPort(port: number, host: string): Promise<number>;
|
package/src/utils/check-port.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.checkPort = void 0;
|
|
14
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
15
|
-
const node_net_1 = require("node:net");
|
|
16
|
-
const load_esm_1 = require("./load-esm");
|
|
17
|
-
const tty_1 = require("./tty");
|
|
18
|
-
function createInUseError(port) {
|
|
19
|
-
return new Error(`Port ${port} is already in use. Use '--port' to specify a different port.`);
|
|
20
|
-
}
|
|
21
|
-
async function checkPort(port, host) {
|
|
22
|
-
// Disabled due to Vite not handling port 0 and instead always using the default value (5173)
|
|
23
|
-
// TODO: Enable this again once Vite is fixed
|
|
24
|
-
// if (port === 0) {
|
|
25
|
-
// return 0;
|
|
26
|
-
// }
|
|
27
|
-
return new Promise((resolve, reject) => {
|
|
28
|
-
const server = (0, node_net_1.createServer)();
|
|
29
|
-
server
|
|
30
|
-
.once('error', (err) => {
|
|
31
|
-
if (err.code !== 'EADDRINUSE') {
|
|
32
|
-
reject(err);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (!tty_1.isTTY) {
|
|
36
|
-
reject(createInUseError(port));
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
(0, load_esm_1.loadEsmModule)('inquirer')
|
|
40
|
-
.then(({ default: { prompt } }) => prompt({
|
|
41
|
-
type: 'confirm',
|
|
42
|
-
name: 'useDifferent',
|
|
43
|
-
message: `Port ${port} is already in use.\nWould you like to use a different port?`,
|
|
44
|
-
default: true,
|
|
45
|
-
}))
|
|
46
|
-
.then((answers) => answers.useDifferent ? resolve(checkPort(0, host)) : reject(createInUseError(port)), () => reject(createInUseError(port)));
|
|
47
|
-
})
|
|
48
|
-
.once('listening', () => {
|
|
49
|
-
// Get the actual address from the listening server instance
|
|
50
|
-
const address = server.address();
|
|
51
|
-
(0, node_assert_1.default)(address && typeof address !== 'string', 'Port check server address should always be an object.');
|
|
52
|
-
server.close();
|
|
53
|
-
resolve(address.port);
|
|
54
|
-
})
|
|
55
|
-
.listen(port, host);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
exports.checkPort = checkPort;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Delete an output directory, but error out if it's the root of the project.
|
|
10
|
-
*/
|
|
11
|
-
export declare function deleteOutputDir(root: string, outputPath: string, emptyOnlyDirectories?: string[]): Promise<void>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.deleteOutputDir = void 0;
|
|
11
|
-
const promises_1 = require("node:fs/promises");
|
|
12
|
-
const node_path_1 = require("node:path");
|
|
13
|
-
/**
|
|
14
|
-
* Delete an output directory, but error out if it's the root of the project.
|
|
15
|
-
*/
|
|
16
|
-
async function deleteOutputDir(root, outputPath, emptyOnlyDirectories) {
|
|
17
|
-
const resolvedOutputPath = (0, node_path_1.resolve)(root, outputPath);
|
|
18
|
-
if (resolvedOutputPath === root) {
|
|
19
|
-
throw new Error('Output path MUST not be project root directory!');
|
|
20
|
-
}
|
|
21
|
-
const directoriesToEmpty = emptyOnlyDirectories
|
|
22
|
-
? new Set(emptyOnlyDirectories.map((directory) => (0, node_path_1.join)(resolvedOutputPath, directory)))
|
|
23
|
-
: undefined;
|
|
24
|
-
// Avoid removing the actual directory to avoid errors in cases where the output
|
|
25
|
-
// directory is mounted or symlinked. Instead the contents are removed.
|
|
26
|
-
let entries;
|
|
27
|
-
try {
|
|
28
|
-
entries = await (0, promises_1.readdir)(resolvedOutputPath);
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
throw error;
|
|
35
|
-
}
|
|
36
|
-
for (const entry of entries) {
|
|
37
|
-
const fullEntry = (0, node_path_1.join)(resolvedOutputPath, entry);
|
|
38
|
-
// Leave requested directories. This allows symlinks to continue to function.
|
|
39
|
-
if (directoriesToEmpty?.has(fullEntry)) {
|
|
40
|
-
await deleteOutputDir(resolvedOutputPath, fullEntry);
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
await (0, promises_1.rm)(fullEntry, { force: true, recursive: true, maxRetries: 3 });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.deleteOutputDir = deleteOutputDir;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { BuilderContext } from '@angular-devkit/architect';
|
|
9
|
-
import { Schema as BrowserBuilderSchema, I18NTranslation } from '../builders/browser/schema';
|
|
10
|
-
import { Schema as ServerBuilderSchema } from '../builders/server/schema';
|
|
11
|
-
import { TranslationLoader } from './load-translations';
|
|
12
|
-
export interface LocaleDescription {
|
|
13
|
-
files: {
|
|
14
|
-
path: string;
|
|
15
|
-
integrity?: string;
|
|
16
|
-
format?: string;
|
|
17
|
-
}[];
|
|
18
|
-
translation?: Record<string, unknown>;
|
|
19
|
-
dataPath?: string;
|
|
20
|
-
baseHref?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface I18nOptions {
|
|
23
|
-
inlineLocales: Set<string>;
|
|
24
|
-
sourceLocale: string;
|
|
25
|
-
locales: Record<string, LocaleDescription>;
|
|
26
|
-
flatOutput?: boolean;
|
|
27
|
-
readonly shouldInline: boolean;
|
|
28
|
-
hasDefinedSourceLocale?: boolean;
|
|
29
|
-
}
|
|
30
|
-
export declare function createI18nOptions(projectMetadata: {
|
|
31
|
-
i18n?: unknown;
|
|
32
|
-
}, inline?: boolean | string[]): I18nOptions;
|
|
33
|
-
export declare function configureI18nBuild<T extends BrowserBuilderSchema | ServerBuilderSchema>(context: BuilderContext, options: T): Promise<{
|
|
34
|
-
buildOptions: T;
|
|
35
|
-
i18n: I18nOptions;
|
|
36
|
-
}>;
|
|
37
|
-
export declare function loadTranslations(locale: string, desc: LocaleDescription, workspaceRoot: string, loader: TranslationLoader, logger: {
|
|
38
|
-
warn: (message: string) => void;
|
|
39
|
-
error: (message: string) => void;
|
|
40
|
-
}, usedFormats?: Set<string>, duplicateTranslation?: I18NTranslation): void;
|