@angular-devkit/build-angular 18.0.0-next.3 → 18.0.0-next.5
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 +14 -13
- package/src/builders/app-shell/index.js +3 -5
- package/src/builders/browser/index.d.ts +1 -1
- package/src/builders/browser/index.js +8 -12
- 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 +3 -4
- 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 +7 -7
- 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 +1 -1
- package/src/tools/webpack/plugins/any-component-style-budget-checker.js +5 -5
- 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 +2 -2
- 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 -1
- package/src/tools/webpack/utils/stats.js +2 -2
- package/src/utils/i18n-webpack.d.ts +1 -1
- package/src/utils/i18n-webpack.js +5 -6
- 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/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 -125
- package/src/builders/application/execute-post-bundle.d.ts +0 -25
- package/src/builders/application/execute-post-bundle.js +0 -93
- 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 -369
- 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 -441
- 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 -81
- 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 -147
- 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 -114
- 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 -334
- package/src/tools/sass/sass-service.d.ts +0 -72
- 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 -192
- 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 -303
- 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/format-bytes.d.ts +0 -8
- package/src/utils/format-bytes.js +0 -22
- package/src/utils/i18n-options.d.ts +0 -33
- package/src/utils/i18n-options.js +0 -161
- package/src/utils/index-file/add-event-dispatch-contract.d.ts +0 -8
- package/src/utils/index-file/add-event-dispatch-contract.js +0 -28
- package/src/utils/index-file/augment-index-html.d.ts +0 -40
- package/src/utils/index-file/augment-index-html.js +0 -239
- 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 -57
- package/src/utils/index-file/index-html-generator.js +0 -135
- 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/nonce.d.ts +0 -12
- package/src/utils/index-file/nonce.js +0 -55
- package/src/utils/load-proxy-config.d.ts +0 -8
- package/src/utils/load-proxy-config.js +0 -189
- 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/resolve-assets.d.ts +0 -18
- package/src/utils/resolve-assets.js +0 -35
- 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/stats-table.d.ts +0 -20
- package/src/utils/stats-table.js +0 -205
- 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
|
@@ -34,6 +34,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
};
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.execute = void 0;
|
|
37
|
+
const private_1 = require("@angular/build/private");
|
|
37
38
|
const architect_1 = require("@angular-devkit/architect");
|
|
38
39
|
const fs = __importStar(require("fs"));
|
|
39
40
|
const promises_1 = require("node:fs/promises");
|
|
@@ -43,7 +44,6 @@ const piscina_1 = __importDefault(require("piscina"));
|
|
|
43
44
|
const utils_1 = require("../../utils");
|
|
44
45
|
const environment_options_1 = require("../../utils/environment-options");
|
|
45
46
|
const error_1 = require("../../utils/error");
|
|
46
|
-
const service_worker_1 = require("../../utils/service-worker");
|
|
47
47
|
const webpack_browser_config_1 = require("../../utils/webpack-browser-config");
|
|
48
48
|
class RoutesSet extends Set {
|
|
49
49
|
add(value) {
|
|
@@ -188,7 +188,7 @@ async function _renderUniversal(options, context, browserResult, serverResult, b
|
|
|
188
188
|
if (browserOptions.serviceWorker) {
|
|
189
189
|
spinner.start('Generating service worker...');
|
|
190
190
|
try {
|
|
191
|
-
await (0,
|
|
191
|
+
await (0, private_1.augmentAppWithServiceWorker)(projectRoot, context.workspaceRoot, outputPath, browserOptions.baseHref || '/', browserOptions.ngswConfigPath);
|
|
192
192
|
}
|
|
193
193
|
catch (error) {
|
|
194
194
|
spinner.fail('Service worker generation failed.');
|
|
@@ -84,7 +84,7 @@ async function render({ indexFile, deployUrl, minifyCss, outputPath, serverBundl
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
if (inlineCriticalCss) {
|
|
87
|
-
const { InlineCriticalCssProcessor } = await Promise.resolve().then(() => __importStar(require('
|
|
87
|
+
const { InlineCriticalCssProcessor } = await Promise.resolve().then(() => __importStar(require('@angular/build/private')));
|
|
88
88
|
const inlineCriticalCssProcessor = new InlineCriticalCssProcessor({
|
|
89
89
|
deployUrl: deployUrl,
|
|
90
90
|
minify: minifyCss,
|
|
@@ -31,6 +31,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.execute = void 0;
|
|
34
|
+
const private_1 = require("@angular/build/private");
|
|
34
35
|
const architect_1 = require("@angular-devkit/architect");
|
|
35
36
|
const build_webpack_1 = require("@angular-devkit/build-webpack");
|
|
36
37
|
const promises_1 = require("node:fs/promises");
|
|
@@ -45,9 +46,7 @@ const copy_assets_1 = require("../../utils/copy-assets");
|
|
|
45
46
|
const error_1 = require("../../utils/error");
|
|
46
47
|
const i18n_inlining_1 = require("../../utils/i18n-inlining");
|
|
47
48
|
const output_paths_1 = require("../../utils/output-paths");
|
|
48
|
-
const purge_cache_1 = require("../../utils/purge-cache");
|
|
49
49
|
const spinner_1 = require("../../utils/spinner");
|
|
50
|
-
const version_1 = require("../../utils/version");
|
|
51
50
|
const webpack_browser_config_1 = require("../../utils/webpack-browser-config");
|
|
52
51
|
/**
|
|
53
52
|
* @experimental Direct usage of this function is considered experimental.
|
|
@@ -55,7 +54,7 @@ const webpack_browser_config_1 = require("../../utils/webpack-browser-config");
|
|
|
55
54
|
function execute(options, context, transforms = {}) {
|
|
56
55
|
const root = context.workspaceRoot;
|
|
57
56
|
// Check Angular version.
|
|
58
|
-
(0,
|
|
57
|
+
(0, private_1.assertCompatibleAngularVersion)(root);
|
|
59
58
|
const baseOutputPath = path.resolve(root, options.outputPath);
|
|
60
59
|
let outputPaths;
|
|
61
60
|
return (0, rxjs_1.from)(initialize(options, context, transforms.webpackConfiguration)).pipe((0, rxjs_1.concatMap)(({ config, i18n, projectRoot, projectSourceRoot }) => {
|
|
@@ -134,7 +133,7 @@ exports.execute = execute;
|
|
|
134
133
|
exports.default = (0, architect_1.createBuilder)(execute);
|
|
135
134
|
async function initialize(options, context, webpackConfigurationTransform) {
|
|
136
135
|
// Purge old build disk cache.
|
|
137
|
-
await (0,
|
|
136
|
+
await (0, private_1.purgeStaleBuildCache)(context);
|
|
138
137
|
await checkTsConfigForPreserveWhitespacesSetting(context, options.tsConfig);
|
|
139
138
|
const browserslist = (await Promise.resolve().then(() => __importStar(require('browserslist')))).default;
|
|
140
139
|
const originalOutputPath = options.outputPath;
|
|
@@ -15,6 +15,7 @@ const node_path_1 = require("node:path");
|
|
|
15
15
|
* @see https://github.com/webpack/webpack/issues/15936.
|
|
16
16
|
*/
|
|
17
17
|
function default_1(content, map) {
|
|
18
|
+
const extractorPath = (0, node_path_1.join)((0, node_path_1.dirname)(require.resolve('@angular/build/package.json')), 'src/utils/routes-extractor/extractor.js');
|
|
18
19
|
const source = `${content}
|
|
19
20
|
|
|
20
21
|
// EXPORTS added by @angular-devkit/build-angular
|
|
@@ -22,7 +23,7 @@ function default_1(content, map) {
|
|
|
22
23
|
` +
|
|
23
24
|
// We do not import it directly so that node.js modules are resolved using the correct context.
|
|
24
25
|
// Remove source map URL comments from the code if a sourcemap is present as this will not match the file.
|
|
25
|
-
(0, node_fs_1.readFileSync)(
|
|
26
|
+
(0, node_fs_1.readFileSync)(extractorPath, 'utf-8').replace(/^\/\/# sourceMappingURL=[^\r\n]*/gm, '');
|
|
26
27
|
this.callback(null, source, map);
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
@@ -31,13 +31,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.log = exports.execute = void 0;
|
|
34
|
+
const private_1 = require("@angular/build/private");
|
|
34
35
|
const architect_1 = require("@angular-devkit/architect");
|
|
35
36
|
const core_1 = require("@angular-devkit/core");
|
|
36
37
|
const path_1 = require("path");
|
|
37
38
|
const rxjs_1 = require("rxjs");
|
|
38
39
|
const url = __importStar(require("url"));
|
|
39
|
-
const utils_1 = require("
|
|
40
|
-
const utils_2 = require("./utils");
|
|
40
|
+
const utils_1 = require("./utils");
|
|
41
41
|
/** Log messages to ignore and not rely to the logger */
|
|
42
42
|
const IGNORED_STDOUT_MESSAGES = [
|
|
43
43
|
'server listening on',
|
|
@@ -78,7 +78,7 @@ function execute(options, context) {
|
|
|
78
78
|
DON'T USE IT FOR PRODUCTION!
|
|
79
79
|
****************************************************************************************
|
|
80
80
|
`);
|
|
81
|
-
return (0, rxjs_1.zip)(browserTargetRun, serverTargetRun, (0,
|
|
81
|
+
return (0, rxjs_1.zip)(browserTargetRun, serverTargetRun, (0, utils_1.getAvailablePort)()).pipe((0, rxjs_1.switchMap)(([br, sr, nodeServerPort]) => {
|
|
82
82
|
return (0, rxjs_1.combineLatest)([br.output, sr.output]).pipe(
|
|
83
83
|
// This is needed so that if both server and browser emit close to each other
|
|
84
84
|
// we only emit once. This typically happens on the first build.
|
|
@@ -101,7 +101,7 @@ function execute(options, context) {
|
|
|
101
101
|
context.logger.info('\nCompiled successfully.');
|
|
102
102
|
}
|
|
103
103
|
}), (0, rxjs_1.debounce)(([builderOutput]) => builderOutput.success && !options.inspect
|
|
104
|
-
? (0,
|
|
104
|
+
? (0, utils_1.waitUntilServerIsListening)(nodeServerPort)
|
|
105
105
|
: rxjs_1.EMPTY), (0, rxjs_1.finalize)(() => {
|
|
106
106
|
void br.stop();
|
|
107
107
|
void sr.stop();
|
|
@@ -162,7 +162,7 @@ function startNodeServer(serverOutput, port, logger, inspectMode = false) {
|
|
|
162
162
|
args.unshift('--inspect-brk');
|
|
163
163
|
}
|
|
164
164
|
return (0, rxjs_1.of)(null).pipe((0, rxjs_1.delay)(0), // Avoid EADDRINUSE error since it will cause the kill event to be finish.
|
|
165
|
-
(0, rxjs_1.switchMap)(() => (0,
|
|
165
|
+
(0, rxjs_1.switchMap)(() => (0, utils_1.spawnAsObservable)('node', args, { env, shell: true })), (0, rxjs_1.tap)((res) => log({ stderr: res.stderr, stdout: res.stdout }, logger)), (0, rxjs_1.ignoreElements)(),
|
|
166
166
|
// Emit a signal after the process has been started
|
|
167
167
|
(0, rxjs_1.startWith)(undefined));
|
|
168
168
|
}
|
|
@@ -171,7 +171,7 @@ async function initBrowserSync(browserSyncInstance, nodeServerPort, options, con
|
|
|
171
171
|
return browserSyncInstance;
|
|
172
172
|
}
|
|
173
173
|
const { port: browserSyncPort, open, host, publicHost, proxyConfig } = options;
|
|
174
|
-
const bsPort = browserSyncPort || (await (0,
|
|
174
|
+
const bsPort = browserSyncPort || (await (0, utils_1.getAvailablePort)());
|
|
175
175
|
const bsOptions = {
|
|
176
176
|
proxy: {
|
|
177
177
|
target: `localhost:${nodeServerPort}`,
|
|
@@ -286,7 +286,7 @@ function getSslConfig(root, options) {
|
|
|
286
286
|
return ssl;
|
|
287
287
|
}
|
|
288
288
|
async function getProxyConfig(root, proxyConfig) {
|
|
289
|
-
const proxy = await (0,
|
|
289
|
+
const proxy = await (0, private_1.loadProxyConfiguration)(root, proxyConfig);
|
|
290
290
|
if (!proxy) {
|
|
291
291
|
return [];
|
|
292
292
|
}
|
|
@@ -10,12 +10,12 @@ 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
|
+
const private_1 = require("@angular/build/private");
|
|
13
14
|
const architect_1 = require("@angular-devkit/architect");
|
|
14
15
|
const node_fs_1 = require("node:fs");
|
|
15
16
|
const node_module_1 = require("node:module");
|
|
16
17
|
const node_path_1 = __importDefault(require("node:path"));
|
|
17
18
|
const test_files_1 = require("../../utils/test-files");
|
|
18
|
-
const application_1 = require("../application");
|
|
19
19
|
const schema_1 = require("../browser-esbuild/schema");
|
|
20
20
|
const builder_status_warnings_1 = require("./builder-status-warnings");
|
|
21
21
|
const options_1 = require("./options");
|
|
@@ -67,7 +67,7 @@ async function buildTests(testFiles, outputPath, options, ctx) {
|
|
|
67
67
|
}
|
|
68
68
|
// Build tests with `application` builder, using test files as entry points.
|
|
69
69
|
// Also bundle in Jasmine and the Jasmine runner script, which need to share chunked dependencies.
|
|
70
|
-
const buildOutput = await first((0,
|
|
70
|
+
const buildOutput = await first((0, private_1.buildApplicationInternal)({
|
|
71
71
|
entryPoints,
|
|
72
72
|
tsConfig: options.tsConfig,
|
|
73
73
|
outputPath,
|
package/src/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export * from './transforms';
|
|
9
9
|
export { AssetPattern, AssetPatternClass as AssetPatternObject, Budget, CrossOrigin, FileReplacement, OptimizationClass as OptimizationObject, OptimizationUnion, OutputHashing, Schema as BrowserBuilderOptions, SourceMapClass as SourceMapObject, SourceMapUnion, StylePreprocessorOptions, Type, } from './builders/browser/schema';
|
|
10
10
|
export { buildWebpackBrowser as executeBrowserBuilder, BrowserBuilderOutput, } from './builders/browser';
|
|
11
|
-
export { buildApplication, ApplicationBuilderOptions } from '
|
|
11
|
+
export { buildApplication, ApplicationBuilderOptions } from '@angular/build';
|
|
12
12
|
export { executeDevServerBuilder, DevServerBuilderOptions, DevServerBuilderOutput, } from './builders/dev-server';
|
|
13
13
|
export { execute as executeExtractI18nBuilder, ExtractI18nBuilderOptions, } from './builders/extract-i18n';
|
|
14
14
|
export { execute as executeKarmaBuilder, KarmaBuilderOptions, KarmaConfigOptions, } from './builders/karma';
|
package/src/index.js
CHANGED
|
@@ -29,8 +29,8 @@ Object.defineProperty(exports, "OutputHashing", { enumerable: true, get: functio
|
|
|
29
29
|
Object.defineProperty(exports, "Type", { enumerable: true, get: function () { return schema_1.Type; } });
|
|
30
30
|
var browser_1 = require("./builders/browser");
|
|
31
31
|
Object.defineProperty(exports, "executeBrowserBuilder", { enumerable: true, get: function () { return browser_1.buildWebpackBrowser; } });
|
|
32
|
-
var
|
|
33
|
-
Object.defineProperty(exports, "buildApplication", { enumerable: true, get: function () { return
|
|
32
|
+
var build_1 = require("@angular/build");
|
|
33
|
+
Object.defineProperty(exports, "buildApplication", { enumerable: true, get: function () { return build_1.buildApplication; } });
|
|
34
34
|
var dev_server_1 = require("./builders/dev-server");
|
|
35
35
|
Object.defineProperty(exports, "executeDevServerBuilder", { enumerable: true, get: function () { return dev_server_1.executeDevServerBuilder; } });
|
|
36
36
|
var extract_i18n_1 = require("./builders/extract-i18n");
|
|
@@ -147,7 +147,7 @@ function default_1(api, options) {
|
|
|
147
147
|
needRuntimeTransform = true;
|
|
148
148
|
}
|
|
149
149
|
if (options.optimize) {
|
|
150
|
-
const { adjustStaticMembers, adjustTypeScriptEnums, elideAngularMetadata, markTopLevelPure, } = require('
|
|
150
|
+
const { adjustStaticMembers, adjustTypeScriptEnums, elideAngularMetadata, markTopLevelPure, } = require('@angular/build/private');
|
|
151
151
|
if (options.optimize.pureTopLevel) {
|
|
152
152
|
plugins.push(markTopLevelPure);
|
|
153
153
|
}
|
|
@@ -34,11 +34,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
};
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.getStylesConfig = void 0;
|
|
37
|
+
const private_1 = require("@angular/build/private");
|
|
37
38
|
const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
|
|
38
39
|
const path = __importStar(require("node:path"));
|
|
39
40
|
const node_url_1 = require("node:url");
|
|
40
41
|
const tailwind_1 = require("../../../utils/tailwind");
|
|
41
|
-
const sass_service_1 = require("../../sass/sass-service");
|
|
42
42
|
const plugins_1 = require("../plugins");
|
|
43
43
|
const css_optimizer_plugin_1 = require("../plugins/css-optimizer-plugin");
|
|
44
44
|
const styles_webpack_plugin_1 = require("../plugins/styles-webpack-plugin");
|
|
@@ -66,7 +66,7 @@ async function getStylesConfig(wco) {
|
|
|
66
66
|
extraPlugins.push(new plugins_1.RemoveHashPlugin({ chunkNames: noInjectNames, hashFormat }));
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
const sassImplementation = new
|
|
69
|
+
const sassImplementation = new private_1.SassWorkerImplementation();
|
|
70
70
|
extraPlugins.push({
|
|
71
71
|
apply(compiler) {
|
|
72
72
|
compiler.hooks.shutdown.tap('sass-worker', () => {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
+
import { BudgetEntry } from '@angular/build/private';
|
|
8
9
|
import { Compiler } from 'webpack';
|
|
9
|
-
import { BudgetEntry } from '../../../utils/bundle-calculator';
|
|
10
10
|
/**
|
|
11
11
|
* Check budget sizes for component styles by emitting a warning or error if a
|
|
12
12
|
* budget is exceeded by a particular component's styles.
|
|
@@ -31,9 +31,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.AnyComponentStyleBudgetChecker = void 0;
|
|
34
|
+
const private_1 = require("@angular/build/private");
|
|
34
35
|
const path = __importStar(require("path"));
|
|
35
36
|
const webpack_1 = require("webpack");
|
|
36
|
-
const bundle_calculator_1 = require("../../../utils/bundle-calculator");
|
|
37
37
|
const webpack_diagnostics_1 = require("../../../utils/webpack-diagnostics");
|
|
38
38
|
const PLUGIN_NAME = 'AnyComponentStyleBudgetChecker';
|
|
39
39
|
/**
|
|
@@ -43,7 +43,7 @@ const PLUGIN_NAME = 'AnyComponentStyleBudgetChecker';
|
|
|
43
43
|
class AnyComponentStyleBudgetChecker {
|
|
44
44
|
budgets;
|
|
45
45
|
constructor(budgets) {
|
|
46
|
-
this.budgets = budgets.filter((budget) => budget.type ===
|
|
46
|
+
this.budgets = budgets.filter((budget) => budget.type === private_1.BudgetType.AnyComponentStyle);
|
|
47
47
|
}
|
|
48
48
|
apply(compiler) {
|
|
49
49
|
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|
@@ -67,12 +67,12 @@ class AnyComponentStyleBudgetChecker {
|
|
|
67
67
|
size: compilation.assets[name].size(),
|
|
68
68
|
componentStyle: true,
|
|
69
69
|
}));
|
|
70
|
-
for (const { severity, message } of (0,
|
|
70
|
+
for (const { severity, message } of (0, private_1.checkBudgets)(this.budgets, { chunks: [], assets: componentStyles }, true)) {
|
|
71
71
|
switch (severity) {
|
|
72
|
-
case
|
|
72
|
+
case private_1.ThresholdSeverity.Warning:
|
|
73
73
|
(0, webpack_diagnostics_1.addWarning)(compilation, message);
|
|
74
74
|
break;
|
|
75
|
-
case
|
|
75
|
+
case private_1.ThresholdSeverity.Error:
|
|
76
76
|
(0, webpack_diagnostics_1.addError)(compilation, message);
|
|
77
77
|
break;
|
|
78
78
|
default:
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.CssOptimizerPlugin = void 0;
|
|
11
|
+
const private_1 = require("@angular/build/private");
|
|
11
12
|
const webpack_diagnostics_1 = require("../../../utils/webpack-diagnostics");
|
|
12
|
-
const utils_1 = require("../../esbuild/utils");
|
|
13
13
|
const esbuild_executor_1 = require("./esbuild-executor");
|
|
14
14
|
/**
|
|
15
15
|
* The name of the plugin provided to Webpack when tapping Webpack compiler hooks.
|
|
@@ -26,7 +26,7 @@ class CssOptimizerPlugin {
|
|
|
26
26
|
esbuild = new esbuild_executor_1.EsbuildExecutor();
|
|
27
27
|
constructor(options) {
|
|
28
28
|
if (options?.supportedBrowsers) {
|
|
29
|
-
this.targets = (0,
|
|
29
|
+
this.targets = (0, private_1.transformSupportedBrowsersToTargets)(options.supportedBrowsers);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
apply(compiler) {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
+
import { IndexHtmlGenerator, IndexHtmlGeneratorOptions, IndexHtmlGeneratorProcessOptions } from '@angular/build/private';
|
|
8
9
|
import { Compilation, Compiler } from 'webpack';
|
|
9
|
-
import { IndexHtmlGenerator, IndexHtmlGeneratorOptions, IndexHtmlGeneratorProcessOptions } from '../../../utils/index-file/index-html-generator';
|
|
10
10
|
export interface IndexHtmlWebpackPluginOptions extends IndexHtmlGeneratorOptions, Omit<IndexHtmlGeneratorProcessOptions, 'files'> {
|
|
11
11
|
}
|
|
12
12
|
export declare class IndexHtmlWebpackPlugin extends IndexHtmlGenerator {
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.IndexHtmlWebpackPlugin = void 0;
|
|
11
|
+
const private_1 = require("@angular/build/private");
|
|
11
12
|
const path_1 = require("path");
|
|
12
13
|
const webpack_1 = require("webpack");
|
|
13
14
|
const error_1 = require("../../../utils/error");
|
|
14
|
-
const index_html_generator_1 = require("../../../utils/index-file/index-html-generator");
|
|
15
15
|
const webpack_diagnostics_1 = require("../../../utils/webpack-diagnostics");
|
|
16
16
|
const PLUGIN_NAME = 'index-html-webpack-plugin';
|
|
17
|
-
class IndexHtmlWebpackPlugin extends
|
|
17
|
+
class IndexHtmlWebpackPlugin extends private_1.IndexHtmlGenerator {
|
|
18
18
|
options;
|
|
19
19
|
_compilation;
|
|
20
20
|
get compilation() {
|
|
@@ -11,10 +11,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.JavaScriptOptimizerPlugin = void 0;
|
|
14
|
+
const private_1 = require("@angular/build/private");
|
|
14
15
|
const piscina_1 = __importDefault(require("piscina"));
|
|
15
16
|
const environment_options_1 = require("../../../utils/environment-options");
|
|
16
17
|
const webpack_diagnostics_1 = require("../../../utils/webpack-diagnostics");
|
|
17
|
-
const utils_1 = require("../../esbuild/utils");
|
|
18
18
|
const esbuild_executor_1 = require("./esbuild-executor");
|
|
19
19
|
/**
|
|
20
20
|
* The maximum number of Workers that will be created to execute optimize tasks.
|
|
@@ -38,7 +38,7 @@ class JavaScriptOptimizerPlugin {
|
|
|
38
38
|
constructor(options) {
|
|
39
39
|
this.options = options;
|
|
40
40
|
if (options.supportedBrowsers) {
|
|
41
|
-
this.targets = (0,
|
|
41
|
+
this.targets = (0, private_1.transformSupportedBrowsersToTargets)(options.supportedBrowsers);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
apply(compiler) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.ServiceWorkerPlugin = void 0;
|
|
11
|
-
const
|
|
11
|
+
const private_1 = require("@angular/build/private");
|
|
12
12
|
class ServiceWorkerPlugin {
|
|
13
13
|
options;
|
|
14
14
|
constructor(options) {
|
|
@@ -31,7 +31,7 @@ class ServiceWorkerPlugin {
|
|
|
31
31
|
throw new Error('Compilation output path cannot be empty.');
|
|
32
32
|
}
|
|
33
33
|
try {
|
|
34
|
-
await (0,
|
|
34
|
+
await (0, private_1.augmentAppWithServiceWorker)(projectRoot, root, outputPath, baseHref, ngswConfigPath,
|
|
35
35
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
36
|
compiler.inputFileSystem.promises,
|
|
37
37
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
+
import { BudgetCalculatorResult } from '@angular/build/private';
|
|
8
9
|
import { WebpackLoggingCallback } from '@angular-devkit/build-webpack';
|
|
9
10
|
import { logging } from '@angular-devkit/core';
|
|
10
11
|
import { Configuration, StatsCompilation } from 'webpack';
|
|
11
12
|
import { Schema as BrowserBuilderOptions } from '../../../builders/browser/schema';
|
|
12
|
-
import { BudgetCalculatorResult } from '../../../utils/bundle-calculator';
|
|
13
13
|
import { WebpackStatsOptions } from './helpers';
|
|
14
14
|
export declare function statsWarningsToString(json: StatsCompilation, statsConfig: WebpackStatsOptions): string;
|
|
15
15
|
export declare function statsErrorsToString(json: StatsCompilation, statsConfig: WebpackStatsOptions): string;
|
|
@@ -34,11 +34,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
};
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.webpackStatsLogger = exports.generateBuildEventStats = exports.createWebpackLoggingCallback = exports.statsHasWarnings = exports.statsHasErrors = exports.statsErrorsToString = exports.statsWarningsToString = void 0;
|
|
37
|
+
const private_1 = require("@angular/build/private");
|
|
37
38
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
38
39
|
const path = __importStar(require("node:path"));
|
|
39
40
|
const utils_1 = require("../../../utils");
|
|
40
41
|
const color_1 = require("../../../utils/color");
|
|
41
|
-
const stats_table_1 = require("../../../utils/stats-table");
|
|
42
42
|
const async_chunks_1 = require("./async-chunks");
|
|
43
43
|
const helpers_1 = require("./helpers");
|
|
44
44
|
function getBuildDuration(webpackStats) {
|
|
@@ -105,7 +105,7 @@ statsConfig, budgetFailures) {
|
|
|
105
105
|
}
|
|
106
106
|
unchangedChunkNumber = json.chunks.length - changedChunksStats.length;
|
|
107
107
|
runsCache.add(json.outputPath || '');
|
|
108
|
-
const statsTable = (0,
|
|
108
|
+
const statsTable = (0, private_1.generateBuildStatsTable)(changedChunksStats, colors, unchangedChunkNumber === 0, hasEstimatedTransferSizes, budgetFailures);
|
|
109
109
|
// In some cases we do things outside of webpack context
|
|
110
110
|
// Such us index generation, service worker augmentation etc...
|
|
111
111
|
// This will correct the time and include these.
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
+
import { type I18nOptions, loadTranslations } from '@angular/build/private';
|
|
8
9
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
9
10
|
import { Schema as BrowserBuilderSchema } from '../builders/browser/schema';
|
|
10
11
|
import { Schema as ServerBuilderSchema } from '../builders/server/schema';
|
|
11
|
-
import { I18nOptions, loadTranslations } from './i18n-options';
|
|
12
12
|
export { I18nOptions, loadTranslations };
|
|
13
13
|
export declare function configureI18nBuild<T extends BrowserBuilderSchema | ServerBuilderSchema>(context: BuilderContext, options: T): Promise<{
|
|
14
14
|
buildOptions: T;
|
|
@@ -11,14 +11,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.configureI18nBuild = exports.loadTranslations = void 0;
|
|
14
|
+
const private_1 = require("@angular/build/private");
|
|
15
|
+
Object.defineProperty(exports, "loadTranslations", { enumerable: true, get: function () { return private_1.loadTranslations; } });
|
|
14
16
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
15
17
|
const node_module_1 = require("node:module");
|
|
16
18
|
const node_os_1 = __importDefault(require("node:os"));
|
|
17
19
|
const node_path_1 = __importDefault(require("node:path"));
|
|
18
20
|
const read_tsconfig_1 = require("../utils/read-tsconfig");
|
|
19
|
-
const i18n_options_1 = require("./i18n-options");
|
|
20
|
-
Object.defineProperty(exports, "loadTranslations", { enumerable: true, get: function () { return i18n_options_1.loadTranslations; } });
|
|
21
|
-
const load_translations_1 = require("./load-translations");
|
|
22
21
|
/**
|
|
23
22
|
* The base module location used to search for locale specific data.
|
|
24
23
|
*/
|
|
@@ -30,7 +29,7 @@ async function configureI18nBuild(context, options) {
|
|
|
30
29
|
const buildOptions = { ...options };
|
|
31
30
|
const tsConfig = await (0, read_tsconfig_1.readTsconfig)(buildOptions.tsConfig, context.workspaceRoot);
|
|
32
31
|
const metadata = await context.getProjectMetadata(context.target);
|
|
33
|
-
const i18n = (0,
|
|
32
|
+
const i18n = (0, private_1.createI18nOptions)(metadata, buildOptions.localize);
|
|
34
33
|
// No additional processing needed if no inlining requested and no source locale defined.
|
|
35
34
|
if (!i18n.shouldInline && !i18n.hasDefinedSourceLocale) {
|
|
36
35
|
return { buildOptions, i18n };
|
|
@@ -65,8 +64,8 @@ async function configureI18nBuild(context, options) {
|
|
|
65
64
|
if (!desc.files.length) {
|
|
66
65
|
continue;
|
|
67
66
|
}
|
|
68
|
-
loader ??= await (0,
|
|
69
|
-
(0,
|
|
67
|
+
loader ??= await (0, private_1.createTranslationLoader)();
|
|
68
|
+
(0, private_1.loadTranslations)(locale, desc, context.workspaceRoot, loader, {
|
|
70
69
|
warn(message) {
|
|
71
70
|
context.logger.warn(message);
|
|
72
71
|
},
|
package/src/utils/index.d.ts
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
export * from './default-progress';
|
|
9
|
-
export
|
|
9
|
+
export { deleteOutputDir, loadProxyConfiguration } from '@angular/build/private';
|
|
10
10
|
export * from './run-module-as-observable-fork';
|
|
11
|
-
export * from './load-proxy-config';
|
|
12
11
|
export * from './normalize-file-replacements';
|
|
13
12
|
export * from './normalize-asset-patterns';
|
|
14
13
|
export * from './normalize-source-maps';
|
package/src/utils/index.js
CHANGED
|
@@ -21,10 +21,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
21
21
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.loadProxyConfiguration = exports.deleteOutputDir = void 0;
|
|
24
25
|
__exportStar(require("./default-progress"), exports);
|
|
25
|
-
|
|
26
|
+
var private_1 = require("@angular/build/private");
|
|
27
|
+
Object.defineProperty(exports, "deleteOutputDir", { enumerable: true, get: function () { return private_1.deleteOutputDir; } });
|
|
28
|
+
Object.defineProperty(exports, "loadProxyConfiguration", { enumerable: true, get: function () { return private_1.loadProxyConfiguration; } });
|
|
26
29
|
__exportStar(require("./run-module-as-observable-fork"), exports);
|
|
27
|
-
__exportStar(require("./load-proxy-config"), exports);
|
|
28
30
|
__exportStar(require("./normalize-file-replacements"), exports);
|
|
29
31
|
__exportStar(require("./normalize-asset-patterns"), exports);
|
|
30
32
|
__exportStar(require("./normalize-source-maps"), exports);
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.normalizeBrowserSchema = void 0;
|
|
11
|
+
const private_1 = require("@angular/build/private");
|
|
11
12
|
const normalize_asset_patterns_1 = require("./normalize-asset-patterns");
|
|
12
13
|
const normalize_cache_1 = require("./normalize-cache");
|
|
13
14
|
const normalize_file_replacements_1 = require("./normalize-file-replacements");
|
|
14
15
|
const normalize_optimization_1 = require("./normalize-optimization");
|
|
15
16
|
const normalize_polyfills_1 = require("./normalize-polyfills");
|
|
16
17
|
const normalize_source_maps_1 = require("./normalize-source-maps");
|
|
17
|
-
const supported_browsers_1 = require("./supported-browsers");
|
|
18
18
|
function normalizeBrowserSchema(workspaceRoot, projectRoot, projectSourceRoot, options, metadata, logger) {
|
|
19
19
|
return {
|
|
20
20
|
...options,
|
|
@@ -38,7 +38,7 @@ function normalizeBrowserSchema(workspaceRoot, projectRoot, projectSourceRoot, o
|
|
|
38
38
|
// A value of 0 is falsy and will disable polling rather then enable
|
|
39
39
|
// 500 ms is a sensible default in this case
|
|
40
40
|
poll: options.poll === 0 ? 500 : options.poll,
|
|
41
|
-
supportedBrowsers: (0,
|
|
41
|
+
supportedBrowsers: (0, private_1.getSupportedBrowsers)(projectRoot, logger),
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
exports.normalizeBrowserSchema = normalizeBrowserSchema;
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.normalizeCacheOptions = void 0;
|
|
11
11
|
const node_path_1 = require("node:path");
|
|
12
12
|
/** Version placeholder is replaced during the build process with actual package version */
|
|
13
|
-
const VERSION = '18.0.0-next.
|
|
13
|
+
const VERSION = '18.0.0-next.5';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { FontsClass, OptimizationClass, OptimizationUnion, StylesClass } from '../builders/
|
|
8
|
+
import { FontsClass, OptimizationClass, OptimizationUnion, StylesClass } from '../builders/browser/schema';
|
|
9
9
|
export type NormalizedOptimizationOptions = Required<Omit<OptimizationClass, 'fonts' | 'styles'>> & {
|
|
10
10
|
fonts: FontsClass;
|
|
11
11
|
styles: StylesClass;
|
|
@@ -17,7 +17,6 @@ function normalizeOptimization(optimization = true) {
|
|
|
17
17
|
? optimization.styles
|
|
18
18
|
: {
|
|
19
19
|
minify: styleOptimization,
|
|
20
|
-
removeSpecialComments: styleOptimization,
|
|
21
20
|
inlineCritical: styleOptimization,
|
|
22
21
|
},
|
|
23
22
|
fonts: typeof optimization.fonts === 'object'
|
|
@@ -32,7 +31,6 @@ function normalizeOptimization(optimization = true) {
|
|
|
32
31
|
styles: {
|
|
33
32
|
minify: optimization,
|
|
34
33
|
inlineCritical: optimization,
|
|
35
|
-
removeSpecialComments: optimization,
|
|
36
34
|
},
|
|
37
35
|
fonts: {
|
|
38
36
|
inline: optimization,
|
|
@@ -1,33 +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, BuilderOutput } from '@angular-devkit/architect';
|
|
9
|
-
import { BuildOutputFile } from '../../tools/esbuild/bundler-context';
|
|
10
|
-
import { ExecutionResult, RebuildState } from '../../tools/esbuild/bundler-execution-result';
|
|
11
|
-
import { NormalizedCachedOptions } from '../../utils/normalize-cache';
|
|
12
|
-
import { NormalizedOutputOptions } from './options';
|
|
13
|
-
type BuildActionOutput = (ExecutionResult['outputWithFiles'] | ExecutionResult['output']) & BuilderOutput;
|
|
14
|
-
export declare function runEsBuildBuildAction(action: (rebuildState?: RebuildState) => Promise<ExecutionResult>, options: {
|
|
15
|
-
workspaceRoot: string;
|
|
16
|
-
projectRoot: string;
|
|
17
|
-
outputOptions: NormalizedOutputOptions;
|
|
18
|
-
logger: BuilderContext['logger'];
|
|
19
|
-
cacheOptions: NormalizedCachedOptions;
|
|
20
|
-
writeToFileSystem: boolean;
|
|
21
|
-
writeToFileSystemFilter: ((file: BuildOutputFile) => boolean) | undefined;
|
|
22
|
-
watch?: boolean;
|
|
23
|
-
verbose?: boolean;
|
|
24
|
-
progress?: boolean;
|
|
25
|
-
deleteOutputPath?: boolean;
|
|
26
|
-
poll?: number;
|
|
27
|
-
signal?: AbortSignal;
|
|
28
|
-
preserveSymlinks?: boolean;
|
|
29
|
-
clearScreen?: boolean;
|
|
30
|
-
colors?: boolean;
|
|
31
|
-
jsonLogs?: boolean;
|
|
32
|
-
}): AsyncIterable<BuildActionOutput>;
|
|
33
|
-
export {};
|