@angular/build 18.1.0-next.0 → 18.1.0-next.2
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/package.json +23 -14
- package/src/builders/application/build-action.d.ts +1 -1
- package/src/builders/application/build-action.js +2 -3
- package/src/builders/application/execute-build.d.ts +1 -1
- package/src/builders/application/execute-build.js +2 -3
- package/src/builders/application/execute-post-bundle.d.ts +1 -1
- package/src/builders/application/execute-post-bundle.js +2 -3
- package/src/builders/application/i18n.d.ts +1 -1
- package/src/builders/application/i18n.js +3 -4
- package/src/builders/application/index.d.ts +1 -1
- package/src/builders/application/index.js +3 -4
- package/src/builders/application/options.d.ts +3 -3
- package/src/builders/application/options.js +2 -3
- package/src/builders/application/setup-bundling.d.ts +1 -1
- package/src/builders/application/setup-bundling.js +3 -9
- package/src/builders/dev-server/builder.d.ts +1 -2
- package/src/builders/dev-server/builder.js +2 -3
- package/src/builders/dev-server/index.d.ts +1 -1
- package/src/builders/dev-server/index.js +1 -1
- package/src/builders/dev-server/internal.d.ts +1 -1
- package/src/builders/dev-server/internal.js +1 -1
- package/src/builders/dev-server/options.d.ts +5 -1
- package/src/builders/dev-server/options.js +27 -3
- package/src/builders/dev-server/output.d.ts +1 -1
- package/src/builders/dev-server/output.js +1 -1
- package/src/builders/dev-server/schema.d.ts +10 -0
- package/src/builders/dev-server/schema.json +11 -0
- package/src/builders/dev-server/vite-server.d.ts +1 -1
- package/src/builders/dev-server/vite-server.js +43 -35
- package/src/builders/extract-i18n/application-extraction.d.ts +1 -1
- package/src/builders/extract-i18n/application-extraction.js +2 -3
- package/src/builders/extract-i18n/builder.d.ts +1 -1
- package/src/builders/extract-i18n/builder.js +2 -3
- package/src/builders/extract-i18n/index.d.ts +1 -1
- package/src/builders/extract-i18n/index.js +1 -1
- package/src/builders/extract-i18n/options.d.ts +1 -1
- package/src/builders/extract-i18n/options.js +2 -3
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/private.d.ts +1 -1
- package/src/private.js +1 -1
- package/src/tools/babel/plugins/adjust-static-class-members.d.ts +1 -2
- package/src/tools/babel/plugins/adjust-static-class-members.js +3 -4
- package/src/tools/babel/plugins/adjust-typescript-enums.d.ts +1 -2
- package/src/tools/babel/plugins/adjust-typescript-enums.js +3 -4
- package/src/tools/babel/plugins/elide-angular-metadata.d.ts +1 -2
- package/src/tools/babel/plugins/elide-angular-metadata.js +3 -4
- package/src/tools/babel/plugins/index.d.ts +1 -1
- package/src/tools/babel/plugins/index.js +1 -1
- package/src/tools/babel/plugins/pure-toplevel-functions.d.ts +1 -2
- package/src/tools/babel/plugins/pure-toplevel-functions.js +2 -2
- package/src/tools/babel/typings.d.ts +1 -1
- package/src/tools/esbuild/angular/angular-host.d.ts +1 -1
- package/src/tools/esbuild/angular/angular-host.js +3 -4
- package/src/tools/esbuild/angular/compilation/angular-compilation.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/angular-compilation.js +1 -1
- package/src/tools/esbuild/angular/compilation/aot-compilation.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/aot-compilation.js +43 -8
- package/src/tools/esbuild/angular/compilation/factory.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/factory.js +2 -3
- package/src/tools/esbuild/angular/compilation/index.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/index.js +1 -1
- package/src/tools/esbuild/angular/compilation/jit-bootstrap-transformer.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/jit-bootstrap-transformer.js +3 -4
- package/src/tools/esbuild/angular/compilation/jit-compilation.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/jit-compilation.js +1 -1
- package/src/tools/esbuild/angular/compilation/noop-compilation.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/noop-compilation.js +1 -1
- package/src/tools/esbuild/angular/compilation/parallel-compilation.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/parallel-compilation.js +1 -1
- package/src/tools/esbuild/angular/compilation/parallel-worker.d.ts +3 -2
- package/src/tools/esbuild/angular/compilation/parallel-worker.js +11 -8
- package/src/tools/esbuild/angular/compilation-state.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation-state.js +3 -3
- package/src/tools/esbuild/angular/compiler-plugin.d.ts +2 -2
- package/src/tools/esbuild/angular/compiler-plugin.js +27 -13
- package/src/tools/esbuild/angular/component-stylesheets.d.ts +1 -1
- package/src/tools/esbuild/angular/component-stylesheets.js +1 -1
- package/src/tools/esbuild/angular/diagnostics.d.ts +1 -1
- package/src/tools/esbuild/angular/diagnostics.js +2 -3
- package/src/tools/esbuild/angular/file-reference-tracker.d.ts +1 -1
- package/src/tools/esbuild/angular/file-reference-tracker.js +1 -1
- package/src/tools/esbuild/angular/jit-plugin-callbacks.d.ts +1 -1
- package/src/tools/esbuild/angular/jit-plugin-callbacks.js +2 -3
- package/src/tools/esbuild/angular/jit-resource-transformer.d.ts +1 -1
- package/src/tools/esbuild/angular/jit-resource-transformer.js +2 -3
- package/src/tools/esbuild/angular/source-file-cache.d.ts +1 -1
- package/src/tools/esbuild/angular/source-file-cache.js +1 -1
- package/src/tools/esbuild/angular/uri.d.ts +1 -1
- package/src/tools/esbuild/angular/uri.js +5 -5
- package/src/tools/esbuild/angular/web-worker-transformer.d.ts +1 -1
- package/src/tools/esbuild/angular/web-worker-transformer.js +2 -3
- package/src/tools/esbuild/application-code-bundle.d.ts +1 -1
- package/src/tools/esbuild/application-code-bundle.js +21 -7
- package/src/tools/esbuild/budget-stats.d.ts +1 -1
- package/src/tools/esbuild/budget-stats.js +2 -3
- package/src/tools/esbuild/bundler-context.d.ts +1 -1
- package/src/tools/esbuild/bundler-context.js +1 -1
- package/src/tools/esbuild/bundler-execution-result.d.ts +1 -1
- package/src/tools/esbuild/bundler-execution-result.js +1 -1
- package/src/tools/esbuild/cache.d.ts +1 -1
- package/src/tools/esbuild/cache.js +1 -1
- package/src/tools/esbuild/commonjs-checker.d.ts +1 -1
- package/src/tools/esbuild/commonjs-checker.js +2 -3
- package/src/tools/esbuild/compiler-plugin-options.d.ts +1 -1
- package/src/tools/esbuild/compiler-plugin-options.js +3 -4
- package/src/tools/esbuild/external-packages-plugin.d.ts +1 -1
- package/src/tools/esbuild/external-packages-plugin.js +2 -3
- package/src/tools/esbuild/global-scripts.d.ts +1 -1
- package/src/tools/esbuild/global-scripts.js +2 -3
- package/src/tools/esbuild/global-styles.d.ts +1 -1
- package/src/tools/esbuild/global-styles.js +3 -4
- package/src/tools/esbuild/i18n-inliner-worker.d.ts +2 -2
- package/src/tools/esbuild/i18n-inliner-worker.js +2 -2
- package/src/tools/esbuild/i18n-inliner.d.ts +1 -1
- package/src/tools/esbuild/i18n-inliner.js +1 -1
- package/src/tools/esbuild/i18n-locale-plugin.d.ts +1 -1
- package/src/tools/esbuild/i18n-locale-plugin.js +3 -3
- package/src/tools/esbuild/index-html-generator.d.ts +1 -1
- package/src/tools/esbuild/index-html-generator.js +9 -12
- package/src/tools/esbuild/javascript-transformer-worker.d.ts +1 -1
- package/src/tools/esbuild/javascript-transformer-worker.js +2 -2
- package/src/tools/esbuild/javascript-transformer.d.ts +2 -2
- package/src/tools/esbuild/javascript-transformer.js +1 -1
- package/src/tools/esbuild/license-extractor.d.ts +1 -1
- package/src/tools/esbuild/license-extractor.js +2 -3
- package/src/tools/esbuild/lmdb-cache-store.d.ts +1 -1
- package/src/tools/esbuild/lmdb-cache-store.js +1 -1
- package/src/tools/esbuild/load-result-cache.d.ts +1 -1
- package/src/tools/esbuild/load-result-cache.js +3 -3
- package/src/tools/esbuild/profiling.d.ts +1 -1
- package/src/tools/esbuild/profiling.js +5 -6
- package/src/tools/esbuild/rxjs-esm-resolution-plugin.d.ts +1 -1
- package/src/tools/esbuild/rxjs-esm-resolution-plugin.js +2 -3
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.d.ts +1 -1
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.js +2 -3
- package/src/tools/esbuild/stylesheets/bundle-options.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/bundle-options.js +2 -3
- package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.js +2 -3
- package/src/tools/esbuild/stylesheets/css-language.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/css-language.js +1 -1
- package/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/css-resource-plugin.js +2 -3
- package/src/tools/esbuild/stylesheets/less-language.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/less-language.js +1 -1
- package/src/tools/esbuild/stylesheets/sass-language.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/sass-language.js +30 -4
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts +9 -2
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js +46 -41
- package/src/tools/esbuild/utils.d.ts +1 -1
- package/src/tools/esbuild/utils.js +16 -17
- package/src/tools/esbuild/virtual-module-plugin.d.ts +1 -1
- package/src/tools/esbuild/virtual-module-plugin.js +2 -3
- package/src/tools/esbuild/watcher.d.ts +1 -1
- package/src/tools/esbuild/watcher.js +3 -3
- package/src/tools/sass/lexer.d.ts +1 -1
- package/src/tools/sass/lexer.js +2 -3
- package/src/tools/sass/rebasing-importer.d.ts +1 -1
- package/src/tools/sass/rebasing-importer.js +3 -3
- package/src/tools/sass/sass-service.d.ts +1 -1
- package/src/tools/sass/sass-service.js +4 -2
- package/src/tools/sass/worker.d.ts +3 -5
- package/src/tools/sass/worker.js +2 -2
- package/src/tools/vite/angular-memory-plugin.d.ts +1 -1
- package/src/tools/vite/angular-memory-plugin.js +2 -3
- package/src/tools/vite/i18n-locale-plugin.d.ts +1 -1
- package/src/tools/vite/i18n-locale-plugin.js +3 -3
- package/src/utils/bundle-calculator.d.ts +1 -1
- package/src/utils/bundle-calculator.js +5 -5
- package/src/utils/check-port.d.ts +1 -1
- package/src/utils/check-port.js +28 -9
- package/src/utils/color.d.ts +1 -1
- package/src/utils/color.js +1 -1
- package/src/utils/delete-output-dir.d.ts +1 -1
- package/src/utils/delete-output-dir.js +2 -3
- package/src/utils/environment-options.d.ts +1 -1
- package/src/utils/environment-options.js +1 -1
- package/src/utils/error.d.ts +1 -1
- package/src/utils/error.js +2 -3
- package/src/utils/format-bytes.d.ts +1 -1
- package/src/utils/format-bytes.js +2 -3
- package/src/utils/i18n-options.d.ts +1 -1
- package/src/utils/i18n-options.js +3 -4
- package/src/utils/index-file/add-event-dispatch-contract.d.ts +1 -1
- package/src/utils/index-file/add-event-dispatch-contract.js +2 -3
- package/src/utils/index-file/augment-index-html.d.ts +1 -1
- package/src/utils/index-file/augment-index-html.js +22 -10
- package/src/utils/index-file/html-rewriting-stream.d.ts +1 -1
- package/src/utils/index-file/html-rewriting-stream.js +2 -3
- package/src/utils/index-file/index-html-generator.d.ts +1 -1
- package/src/utils/index-file/index-html-generator.js +1 -1
- package/src/utils/index-file/inline-critical-css.d.ts +1 -1
- package/src/utils/index-file/inline-critical-css.js +1 -1
- package/src/utils/index-file/inline-fonts.d.ts +1 -1
- package/src/utils/index-file/inline-fonts.js +1 -1
- package/src/utils/index-file/nonce.d.ts +1 -1
- package/src/utils/index-file/nonce.js +2 -3
- package/src/utils/index-file/valid-self-closing-tags.d.ts +1 -1
- package/src/utils/index-file/valid-self-closing-tags.js +1 -1
- package/src/utils/index.d.ts +1 -1
- package/src/utils/index.js +1 -1
- package/src/utils/load-esm.d.ts +1 -1
- package/src/utils/load-esm.js +2 -3
- package/src/utils/load-proxy-config.d.ts +1 -1
- package/src/utils/load-proxy-config.js +2 -3
- package/src/utils/load-translations.d.ts +1 -1
- package/src/utils/load-translations.js +2 -3
- package/src/utils/normalize-asset-patterns.d.ts +1 -1
- package/src/utils/normalize-asset-patterns.js +3 -3
- package/src/utils/normalize-cache.d.ts +1 -1
- package/src/utils/normalize-cache.js +3 -4
- package/src/utils/normalize-optimization.d.ts +1 -1
- package/src/utils/normalize-optimization.js +2 -3
- package/src/utils/normalize-source-maps.d.ts +1 -1
- package/src/utils/normalize-source-maps.js +2 -3
- package/src/utils/postcss-configuration.d.ts +1 -1
- package/src/utils/postcss-configuration.js +4 -5
- package/src/utils/purge-cache.d.ts +1 -1
- package/src/utils/purge-cache.js +2 -3
- package/src/utils/resolve-assets.d.ts +1 -1
- package/src/utils/resolve-assets.js +2 -3
- package/src/utils/routes-extractor/extractor.d.ts +1 -1
- package/src/utils/routes-extractor/extractor.js +1 -1
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.d.ts +1 -1
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js +4 -5
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.d.ts +1 -1
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js +1 -1
- package/src/utils/server-rendering/fetch-patch.d.ts +1 -1
- package/src/utils/server-rendering/fetch-patch.js +2 -3
- package/src/utils/server-rendering/load-esm-from-memory.d.ts +1 -1
- package/src/utils/server-rendering/load-esm-from-memory.js +2 -3
- package/src/utils/server-rendering/main-bundle-exports.d.ts +1 -1
- package/src/utils/server-rendering/main-bundle-exports.js +1 -1
- package/src/utils/server-rendering/prerender.d.ts +1 -1
- package/src/utils/server-rendering/prerender.js +2 -3
- package/src/utils/server-rendering/render-page.d.ts +1 -1
- package/src/utils/server-rendering/render-page.js +2 -3
- package/src/utils/server-rendering/render-worker.d.ts +1 -1
- package/src/utils/server-rendering/render-worker.js +1 -1
- package/src/utils/server-rendering/routes-extractor-worker.d.ts +1 -1
- package/src/utils/server-rendering/routes-extractor-worker.js +1 -1
- package/src/utils/service-worker.d.ts +1 -3
- package/src/utils/service-worker.js +4 -5
- package/src/utils/spinner.d.ts +1 -1
- package/src/utils/spinner.js +1 -1
- package/src/utils/stats-table.d.ts +1 -1
- package/src/utils/stats-table.js +3 -4
- package/src/utils/supported-browsers.d.ts +1 -1
- package/src/utils/supported-browsers.js +2 -3
- package/src/utils/tty.d.ts +1 -1
- package/src/utils/tty.js +2 -3
- package/src/utils/url.d.ts +1 -1
- package/src/utils/url.js +2 -3
- package/src/utils/version.d.ts +1 -1
- package/src/utils/version.js +2 -3
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.JIT_NAMESPACE_REGEXP = exports.JIT_TEMPLATE_NAMESPACE = exports.JIT_STYLE_NAMESPACE = void 0;
|
|
11
|
+
exports.generateJitFileUri = generateJitFileUri;
|
|
12
|
+
exports.generateJitInlineUri = generateJitInlineUri;
|
|
13
|
+
exports.parseJitUri = parseJitUri;
|
|
11
14
|
/**
|
|
12
15
|
* A string value representing the base namespace for Angular JIT mode related imports.
|
|
13
16
|
*/
|
|
@@ -39,7 +42,6 @@ exports.JIT_NAMESPACE_REGEXP = new RegExp(`^${JIT_BASE_NAMESPACE}:(template|styl
|
|
|
39
42
|
function generateJitFileUri(file, type) {
|
|
40
43
|
return `${JIT_BASE_NAMESPACE}:${type}:file;${file}`;
|
|
41
44
|
}
|
|
42
|
-
exports.generateJitFileUri = generateJitFileUri;
|
|
43
45
|
/**
|
|
44
46
|
* Generates an Angular JIT mode namespace URI for a given inline style or template.
|
|
45
47
|
* The provided content is base64 encoded and included in the URI.
|
|
@@ -50,7 +52,6 @@ exports.generateJitFileUri = generateJitFileUri;
|
|
|
50
52
|
function generateJitInlineUri(data, type) {
|
|
51
53
|
return `${JIT_BASE_NAMESPACE}:${type}:inline;${Buffer.from(data).toString('base64')}`;
|
|
52
54
|
}
|
|
53
|
-
exports.generateJitInlineUri = generateJitInlineUri;
|
|
54
55
|
/**
|
|
55
56
|
* Parses a string containing a JIT namespace URI.
|
|
56
57
|
* JIT namespace URIs are used to encode the information for an Angular component's stylesheets
|
|
@@ -71,4 +72,3 @@ function parseJitUri(uri) {
|
|
|
71
72
|
specifier: matches[3],
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
|
-
exports.parseJitUri = parseJitUri;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
9
|
/**
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.createWorkerTransformer =
|
|
13
|
+
exports.createWorkerTransformer = createWorkerTransformer;
|
|
14
14
|
const typescript_1 = __importDefault(require("typescript"));
|
|
15
15
|
/**
|
|
16
16
|
* Creates a TypeScript Transformer to process Worker and SharedWorker entry points and transform
|
|
@@ -91,4 +91,3 @@ function createWorkerTransformer(fileProcessor) {
|
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
exports.createWorkerTransformer = createWorkerTransformer;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { BuildOptions } from 'esbuild';
|
|
9
9
|
import type { NormalizedApplicationBuildOptions } from '../../builders/application/options';
|
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.createBrowserCodeBundleOptions = createBrowserCodeBundleOptions;
|
|
14
|
+
exports.createBrowserPolyfillBundleOptions = createBrowserPolyfillBundleOptions;
|
|
15
|
+
exports.createServerCodeBundleOptions = createServerCodeBundleOptions;
|
|
16
|
+
exports.createServerPolyfillBundleOptions = createServerPolyfillBundleOptions;
|
|
14
17
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
15
18
|
const node_crypto_1 = require("node:crypto");
|
|
16
19
|
const promises_1 = require("node:fs/promises");
|
|
@@ -66,7 +69,6 @@ function createBrowserCodeBundleOptions(options, target, sourceFileCache) {
|
|
|
66
69
|
}
|
|
67
70
|
return buildOptions;
|
|
68
71
|
}
|
|
69
|
-
exports.createBrowserCodeBundleOptions = createBrowserCodeBundleOptions;
|
|
70
72
|
function createBrowserPolyfillBundleOptions(options, target, sourceFileCache) {
|
|
71
73
|
const namespace = 'angular:polyfills';
|
|
72
74
|
const polyfillBundleOptions = getEsBuildCommonPolyfillsOptions(options, namespace, true, sourceFileCache);
|
|
@@ -104,7 +106,6 @@ function createBrowserPolyfillBundleOptions(options, target, sourceFileCache) {
|
|
|
104
106
|
// cannot be used with fully incremental bundling yet.
|
|
105
107
|
return hasTypeScriptEntries ? buildOptions : () => buildOptions;
|
|
106
108
|
}
|
|
107
|
-
exports.createBrowserPolyfillBundleOptions = createBrowserPolyfillBundleOptions;
|
|
108
109
|
/**
|
|
109
110
|
* Create an esbuild 'build' options object for the server bundle.
|
|
110
111
|
* @param options The builder's user-provider normalized options.
|
|
@@ -185,7 +186,6 @@ function createServerCodeBundleOptions(options, target, sourceFileCache) {
|
|
|
185
186
|
}
|
|
186
187
|
return buildOptions;
|
|
187
188
|
}
|
|
188
|
-
exports.createServerCodeBundleOptions = createServerCodeBundleOptions;
|
|
189
189
|
function createServerPolyfillBundleOptions(options, target, sourceFileCache) {
|
|
190
190
|
const serverPolyfills = [];
|
|
191
191
|
const polyfillsFromConfig = new Set(options.polyfills);
|
|
@@ -230,7 +230,6 @@ function createServerPolyfillBundleOptions(options, target, sourceFileCache) {
|
|
|
230
230
|
};
|
|
231
231
|
return () => buildOptions;
|
|
232
232
|
}
|
|
233
|
-
exports.createServerPolyfillBundleOptions = createServerPolyfillBundleOptions;
|
|
234
233
|
function getEsBuildCommonOptions(options) {
|
|
235
234
|
const { workspaceRoot, outExtension, optimizationOptions, sourcemapOptions, tsconfig, externalDependencies, outputNames, preserveSymlinks, jit, loaderExtensions, jsonLogs, } = options;
|
|
236
235
|
// Ensure unique hashes for i18n translation changes when using post-process inlining.
|
|
@@ -285,7 +284,7 @@ function getEsBuildCommonPolyfillsOptions(options, namespace, tryToResolvePolyfi
|
|
|
285
284
|
splitting: false,
|
|
286
285
|
plugins: [(0, sourcemap_ignorelist_plugin_1.createSourcemapIgnorelistPlugin)()],
|
|
287
286
|
};
|
|
288
|
-
|
|
287
|
+
let polyfills = options.polyfills ? [...options.polyfills] : [];
|
|
289
288
|
// Angular JIT mode requires the runtime compiler
|
|
290
289
|
if (jit) {
|
|
291
290
|
polyfills.unshift('@angular/compiler');
|
|
@@ -294,6 +293,8 @@ function getEsBuildCommonPolyfillsOptions(options, namespace, tryToResolvePolyfi
|
|
|
294
293
|
// Locale data should go first so that project provided polyfill code can augment if needed.
|
|
295
294
|
let needLocaleDataPlugin = false;
|
|
296
295
|
if (i18nOptions.shouldInline) {
|
|
296
|
+
// Remove localize polyfill as this is not needed for build time i18n.
|
|
297
|
+
polyfills = polyfills.filter((path) => !path.startsWith('@angular/localize'));
|
|
297
298
|
// Add locale data for all active locales
|
|
298
299
|
// TODO: Inject each individually within the inlining process itself
|
|
299
300
|
for (const locale of i18nOptions.inlineLocales) {
|
|
@@ -318,6 +319,7 @@ function getEsBuildCommonPolyfillsOptions(options, namespace, tryToResolvePolyfi
|
|
|
318
319
|
loadContent: async (_, build) => {
|
|
319
320
|
let hasLocalizePolyfill = false;
|
|
320
321
|
let polyfillPaths = polyfills;
|
|
322
|
+
let warnings;
|
|
321
323
|
if (tryToResolvePolyfillsAsRelative) {
|
|
322
324
|
polyfillPaths = await Promise.all(polyfills.map(async (path) => {
|
|
323
325
|
hasLocalizePolyfill ||= path.startsWith('@angular/localize');
|
|
@@ -335,6 +337,8 @@ function getEsBuildCommonPolyfillsOptions(options, namespace, tryToResolvePolyfi
|
|
|
335
337
|
else {
|
|
336
338
|
hasLocalizePolyfill = polyfills.some((p) => p.startsWith('@angular/localize'));
|
|
337
339
|
}
|
|
340
|
+
// Add localize polyfill if needed.
|
|
341
|
+
// TODO: remove in version 19 or later.
|
|
338
342
|
if (!i18nOptions.shouldInline && !hasLocalizePolyfill) {
|
|
339
343
|
const result = await build.resolve('@angular/localize', {
|
|
340
344
|
kind: 'import-statement',
|
|
@@ -342,6 +346,15 @@ function getEsBuildCommonPolyfillsOptions(options, namespace, tryToResolvePolyfi
|
|
|
342
346
|
});
|
|
343
347
|
if (result.path) {
|
|
344
348
|
polyfillPaths.push('@angular/localize/init');
|
|
349
|
+
(warnings ??= []).push({
|
|
350
|
+
text: 'Polyfill for "@angular/localize/init" was added automatically.',
|
|
351
|
+
notes: [
|
|
352
|
+
{
|
|
353
|
+
text: 'In the future, this functionality will be removed. ' +
|
|
354
|
+
'Please add this polyfill in the "polyfills" section of your "angular.json" instead.',
|
|
355
|
+
},
|
|
356
|
+
],
|
|
357
|
+
});
|
|
345
358
|
}
|
|
346
359
|
}
|
|
347
360
|
// Generate module contents with an import statement per defined polyfill
|
|
@@ -360,6 +373,7 @@ function getEsBuildCommonPolyfillsOptions(options, namespace, tryToResolvePolyfi
|
|
|
360
373
|
return {
|
|
361
374
|
contents,
|
|
362
375
|
loader: 'js',
|
|
376
|
+
warnings,
|
|
363
377
|
resolveDir: workspaceRoot,
|
|
364
378
|
};
|
|
365
379
|
},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { Metafile } from 'esbuild';
|
|
9
9
|
import type { BudgetStats } from '../../utils/bundle-calculator';
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.generateBudgetStats =
|
|
10
|
+
exports.generateBudgetStats = generateBudgetStats;
|
|
11
11
|
const node_path_1 = require("node:path");
|
|
12
12
|
/**
|
|
13
13
|
* Generates a bundle budget calculator compatible stats object that provides
|
|
@@ -56,4 +56,3 @@ function generateBudgetStats(metafile, initialFiles) {
|
|
|
56
56
|
}
|
|
57
57
|
return stats;
|
|
58
58
|
}
|
|
59
|
-
exports.generateBudgetStats = generateBudgetStats;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { BuildOptions, Message, Metafile, OutputFile } from 'esbuild';
|
|
9
9
|
import { LoadResultCache } from './load-result-cache';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { Message, PartialMessage } from 'esbuild';
|
|
9
9
|
import type { ChangedFiles } from '../../tools/esbuild/watcher';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.ExecutionResult = void 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* @fileoverview
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.MemoryCache = exports.Cache = void 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { Metafile, PartialMessage } from 'esbuild';
|
|
9
9
|
/**
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.checkCommonJSModules =
|
|
10
|
+
exports.checkCommonJSModules = checkCommonJSModules;
|
|
11
11
|
/**
|
|
12
12
|
* Checks the input files of a build to determine if any of the files included
|
|
13
13
|
* in the build are not ESM. ESM files can be tree-shaken and otherwise optimized
|
|
@@ -107,7 +107,6 @@ function checkCommonJSModules(metafile, allowedCommonJsDependencies) {
|
|
|
107
107
|
}
|
|
108
108
|
return messages;
|
|
109
109
|
}
|
|
110
|
-
exports.checkCommonJSModules = checkCommonJSModules;
|
|
111
110
|
/**
|
|
112
111
|
* Determines if a file path has an extension that is a JavaScript or TypeScript
|
|
113
112
|
* code file.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { NormalizedApplicationBuildOptions } from '../../builders/application/options';
|
|
9
9
|
import type { createCompilerPlugin } from './angular/compiler-plugin';
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.createCompilerPluginOptions =
|
|
10
|
+
exports.createCompilerPluginOptions = createCompilerPluginOptions;
|
|
11
11
|
function createCompilerPluginOptions(options, target, sourceFileCache) {
|
|
12
12
|
const { workspaceRoot, optimizationOptions, sourcemapOptions, tsconfig, outputNames, fileReplacements, externalDependencies, preserveSymlinks, stylePreprocessorOptions, advancedOptimizations, inlineStyleLanguage, jit, cacheOptions, tailwindConfiguration, postcssConfiguration, publicPath, } = options;
|
|
13
13
|
return {
|
|
14
14
|
// JS/TS options
|
|
15
15
|
pluginOptions: {
|
|
16
|
-
sourcemap: !!sourcemapOptions.scripts,
|
|
16
|
+
sourcemap: !!sourcemapOptions.scripts && (sourcemapOptions.hidden ? 'external' : true),
|
|
17
17
|
thirdPartySourcemaps: sourcemapOptions.vendor,
|
|
18
18
|
tsconfig,
|
|
19
19
|
jit,
|
|
@@ -46,4 +46,3 @@ function createCompilerPluginOptions(options, target, sourceFileCache) {
|
|
|
46
46
|
},
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
exports.createCompilerPluginOptions = createCompilerPluginOptions;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { Plugin } from 'esbuild';
|
|
9
9
|
/**
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.createExternalPackagesPlugin =
|
|
10
|
+
exports.createExternalPackagesPlugin = createExternalPackagesPlugin;
|
|
11
11
|
const node_path_1 = require("node:path");
|
|
12
12
|
const EXTERNAL_PACKAGE_RESOLUTION = Symbol('EXTERNAL_PACKAGE_RESOLUTION');
|
|
13
13
|
/**
|
|
@@ -72,4 +72,3 @@ function createExternalPackagesPlugin(options) {
|
|
|
72
72
|
},
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
exports.createExternalPackagesPlugin = createExternalPackagesPlugin;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { NormalizedApplicationBuildOptions } from '../../builders/application/options';
|
|
9
9
|
import { BundlerOptionsFactory } from './bundler-context';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -33,7 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
34
|
};
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.createGlobalScriptsBundleOptions =
|
|
36
|
+
exports.createGlobalScriptsBundleOptions = createGlobalScriptsBundleOptions;
|
|
37
37
|
const magic_string_1 = __importStar(require("magic-string"));
|
|
38
38
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
39
39
|
const promises_1 = require("node:fs/promises");
|
|
@@ -139,4 +139,3 @@ function createGlobalScriptsBundleOptions(options, target, initial) {
|
|
|
139
139
|
};
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
exports.createGlobalScriptsBundleOptions = createGlobalScriptsBundleOptions;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { NormalizedApplicationBuildOptions } from '../../builders/application/options';
|
|
9
9
|
import { BundlerOptionsFactory } from './bundler-context';
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.createGlobalStylesBundleOptions =
|
|
13
|
+
exports.createGlobalStylesBundleOptions = createGlobalStylesBundleOptions;
|
|
14
14
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
15
15
|
const bundle_options_1 = require("./stylesheets/bundle-options");
|
|
16
16
|
const virtual_module_plugin_1 = require("./virtual-module-plugin");
|
|
@@ -34,7 +34,7 @@ function createGlobalStylesBundleOptions(options, target, initial) {
|
|
|
34
34
|
workspaceRoot,
|
|
35
35
|
optimization: !!optimizationOptions.styles.minify,
|
|
36
36
|
inlineFonts: !!optimizationOptions.fonts.inline,
|
|
37
|
-
sourcemap: !!sourcemapOptions.styles,
|
|
37
|
+
sourcemap: !!sourcemapOptions.styles && (sourcemapOptions.hidden ? 'external' : true),
|
|
38
38
|
preserveSymlinks,
|
|
39
39
|
target,
|
|
40
40
|
externalDependencies,
|
|
@@ -71,4 +71,3 @@ function createGlobalStylesBundleOptions(options, target, initial) {
|
|
|
71
71
|
return buildOptions;
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
exports.createGlobalStylesBundleOptions = createGlobalStylesBundleOptions;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* The options passed to the inliner for each file request
|
|
@@ -35,7 +35,7 @@ export default function inlineLocale(request: InlineRequest): Promise<{
|
|
|
35
35
|
code: string;
|
|
36
36
|
map: string | undefined;
|
|
37
37
|
messages: {
|
|
38
|
-
type: "
|
|
38
|
+
type: "warning" | "error";
|
|
39
39
|
message: string;
|
|
40
40
|
}[];
|
|
41
41
|
}>;
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.default = inlineLocale;
|
|
13
14
|
const remapping_1 = __importDefault(require("@ampproject/remapping"));
|
|
14
15
|
const core_1 = require("@babel/core");
|
|
15
16
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
@@ -39,7 +40,6 @@ async function inlineLocale(request) {
|
|
|
39
40
|
messages: result.diagnostics.messages,
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
exports.default = inlineLocale;
|
|
43
43
|
/**
|
|
44
44
|
* Cached instance of the `@angular/localize/tools` module.
|
|
45
45
|
* This is used to remove the need to repeatedly import the module per file translation.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { BuildOutputFile } from './bundler-context';
|
|
9
9
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { Plugin } from 'esbuild';
|
|
9
9
|
/**
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.LOCALE_DATA_BASE_MODULE = exports.LOCALE_DATA_NAMESPACE = void 0;
|
|
11
|
+
exports.createAngularLocaleDataPlugin = createAngularLocaleDataPlugin;
|
|
11
12
|
/**
|
|
12
13
|
* The internal namespace used by generated locale import statements and Angular locale data plugin.
|
|
13
14
|
*/
|
|
@@ -117,4 +118,3 @@ function createAngularLocaleDataPlugin() {
|
|
|
117
118
|
},
|
|
118
119
|
};
|
|
119
120
|
}
|
|
120
|
-
exports.createAngularLocaleDataPlugin = createAngularLocaleDataPlugin;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { NormalizedApplicationBuildOptions } from '../../builders/application/options';
|
|
9
9
|
import { BuildOutputFile, InitialFileRecord } from './bundler-context';
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.generateIndexHtml =
|
|
13
|
+
exports.generateIndexHtml = generateIndexHtml;
|
|
14
14
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
15
15
|
const node_path_1 = __importDefault(require("node:path"));
|
|
16
16
|
const index_html_generator_1 = require("../../utils/index-file/index-html-generator");
|
|
@@ -19,7 +19,7 @@ const bundler_context_1 = require("./bundler-context");
|
|
|
19
19
|
* The maximum number of module preload link elements that should be added for
|
|
20
20
|
* initial scripts.
|
|
21
21
|
*/
|
|
22
|
-
const MODULE_PRELOAD_MAX =
|
|
22
|
+
const MODULE_PRELOAD_MAX = 10;
|
|
23
23
|
async function generateIndexHtml(initialFiles, outputFiles, buildOptions, lang) {
|
|
24
24
|
// Analyze metafile for initial link-based hints.
|
|
25
25
|
// Skip if the internal externalPackages option is enabled since this option requires
|
|
@@ -28,19 +28,14 @@ async function generateIndexHtml(initialFiles, outputFiles, buildOptions, lang)
|
|
|
28
28
|
const { indexHtmlOptions, externalPackages, optimizationOptions, crossOrigin, subresourceIntegrity, baseHref, } = buildOptions;
|
|
29
29
|
(0, node_assert_1.default)(indexHtmlOptions, 'indexHtmlOptions cannot be undefined.');
|
|
30
30
|
if (!externalPackages && indexHtmlOptions.preloadInitial) {
|
|
31
|
-
|
|
31
|
+
const modulePreloads = [];
|
|
32
32
|
for (const [key, value] of initialFiles) {
|
|
33
33
|
if (value.entrypoint || value.serverFile) {
|
|
34
34
|
// Entry points are already referenced in the HTML
|
|
35
35
|
continue;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
if (value.type === 'script' && modulePreloadCount < MODULE_PRELOAD_MAX) {
|
|
42
|
-
modulePreloadCount++;
|
|
43
|
-
hints.push({ url: key, mode: 'modulepreload' });
|
|
37
|
+
if (value.type === 'script') {
|
|
38
|
+
modulePreloads.push({ url: key, mode: 'modulepreload', depth: value.depth });
|
|
44
39
|
}
|
|
45
40
|
else if (value.type === 'style') {
|
|
46
41
|
// Provide an "as" value of "style" to ensure external URLs which may not have a
|
|
@@ -48,6 +43,9 @@ async function generateIndexHtml(initialFiles, outputFiles, buildOptions, lang)
|
|
|
48
43
|
hints.push({ url: key, mode: 'preload', as: 'style' });
|
|
49
44
|
}
|
|
50
45
|
}
|
|
46
|
+
// Limit the number of module preloads with smallest depth given priority
|
|
47
|
+
modulePreloads.sort((a, b) => a.depth - b.depth);
|
|
48
|
+
hints.push(...modulePreloads.slice(0, MODULE_PRELOAD_MAX));
|
|
51
49
|
}
|
|
52
50
|
/** Virtual output path to support reading in-memory files. */
|
|
53
51
|
const browserOutputFiles = outputFiles.filter(({ type }) => type === bundler_context_1.BuildOutputFileType.Browser);
|
|
@@ -89,4 +87,3 @@ async function generateIndexHtml(initialFiles, outputFiles, buildOptions, lang)
|
|
|
89
87
|
hints,
|
|
90
88
|
});
|
|
91
89
|
}
|
|
92
|
-
exports.generateIndexHtml = generateIndexHtml;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
interface JavaScriptTransformRequest {
|
|
9
9
|
filename: string;
|