@angular-devkit/build-angular 18.0.0-next.2 → 18.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builders.json +1 -5
- package/package.json +21 -20
- package/src/builders/app-shell/index.js +3 -5
- package/src/builders/browser/index.d.ts +1 -1
- package/src/builders/browser/index.js +9 -13
- package/src/builders/browser-esbuild/index.d.ts +2 -2
- package/src/builders/browser-esbuild/index.js +6 -9
- package/src/builders/dev-server/builder.d.ts +2 -2
- package/src/builders/dev-server/builder.js +11 -6
- package/src/builders/dev-server/index.d.ts +1 -1
- package/src/builders/dev-server/webpack-server.d.ts +1 -1
- package/src/builders/dev-server/webpack-server.js +5 -6
- package/src/builders/extract-i18n/application-extraction.js +2 -2
- package/src/builders/extract-i18n/builder.js +3 -4
- package/src/builders/extract-i18n/options.d.ts +1 -1
- package/src/builders/extract-i18n/options.js +2 -2
- package/src/builders/jest/index.js +2 -2
- package/src/builders/karma/index.js +3 -4
- package/src/builders/ng-packagr/index.js +8 -7
- package/src/builders/ng-packagr/schema.d.ts +4 -0
- package/src/builders/ng-packagr/schema.json +4 -0
- package/src/builders/prerender/index.js +2 -2
- package/src/builders/prerender/render-worker.js +1 -1
- package/src/builders/server/index.js +3 -4
- package/src/builders/server/platform-server-exports-loader.js +2 -1
- package/src/builders/ssr-dev-server/index.js +34 -34
- package/src/builders/web-test-runner/index.js +2 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -2
- package/src/tools/babel/presets/application.js +1 -1
- package/src/tools/webpack/configs/styles.js +2 -2
- package/src/tools/webpack/plugins/any-component-style-budget-checker.d.ts +2 -2
- package/src/tools/webpack/plugins/any-component-style-budget-checker.js +14 -17
- package/src/tools/webpack/plugins/css-optimizer-plugin.js +2 -2
- package/src/tools/webpack/plugins/index-html-webpack-plugin.d.ts +1 -1
- package/src/tools/webpack/plugins/index-html-webpack-plugin.js +3 -3
- package/src/tools/webpack/plugins/javascript-optimizer-plugin.js +2 -2
- package/src/tools/webpack/plugins/service-worker-plugin.js +2 -2
- package/src/tools/webpack/utils/stats.d.ts +1 -14
- package/src/tools/webpack/utils/stats.js +3 -207
- package/src/utils/action-executor.d.ts +1 -1
- package/src/utils/i18n-inlining.d.ts +1 -1
- package/src/utils/i18n-webpack.d.ts +16 -0
- package/src/utils/i18n-webpack.js +107 -0
- package/src/utils/index.d.ts +1 -2
- package/src/utils/index.js +4 -2
- package/src/utils/normalize-builder-schema.js +2 -2
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/normalize-optimization.d.ts +1 -1
- package/src/utils/normalize-optimization.js +0 -2
- package/src/utils/output-paths.d.ts +1 -1
- package/src/utils/webpack-browser-config.d.ts +1 -1
- package/src/utils/webpack-browser-config.js +2 -2
- package/src/builders/application/build-action.d.ts +0 -33
- package/src/builders/application/build-action.js +0 -183
- package/src/builders/application/execute-build.d.ts +0 -11
- package/src/builders/application/execute-build.js +0 -127
- package/src/builders/application/execute-post-bundle.d.ts +0 -25
- package/src/builders/application/execute-post-bundle.js +0 -96
- package/src/builders/application/i18n.d.ts +0 -29
- package/src/builders/application/i18n.js +0 -128
- package/src/builders/application/index.d.ts +0 -57
- package/src/builders/application/index.js +0 -121
- package/src/builders/application/options.d.ts +0 -149
- package/src/builders/application/options.js +0 -352
- package/src/builders/application/schema.d.ts +0 -512
- package/src/builders/application/schema.js +0 -58
- package/src/builders/application/schema.json +0 -635
- package/src/builders/application/setup-bundling.d.ts +0 -19
- package/src/builders/application/setup-bundling.js +0 -71
- package/src/builders/dev-server/vite-server.d.ts +0 -30
- package/src/builders/dev-server/vite-server.js +0 -502
- package/src/tools/babel/plugins/adjust-static-class-members.d.ts +0 -27
- package/src/tools/babel/plugins/adjust-static-class-members.js +0 -351
- package/src/tools/babel/plugins/adjust-typescript-enums.d.ts +0 -23
- package/src/tools/babel/plugins/adjust-typescript-enums.js +0 -113
- package/src/tools/babel/plugins/elide-angular-metadata.d.ts +0 -23
- package/src/tools/babel/plugins/elide-angular-metadata.js +0 -110
- package/src/tools/babel/plugins/index.d.ts +0 -11
- package/src/tools/babel/plugins/index.js +0 -21
- package/src/tools/babel/plugins/pure-toplevel-functions.d.ts +0 -16
- package/src/tools/babel/plugins/pure-toplevel-functions.js +0 -90
- package/src/tools/esbuild/angular/angular-host.d.ts +0 -26
- package/src/tools/esbuild/angular/angular-host.js +0 -72
- package/src/tools/esbuild/angular/compilation/angular-compilation.d.ts +0 -42
- package/src/tools/esbuild/angular/compilation/angular-compilation.js +0 -94
- package/src/tools/esbuild/angular/compilation/aot-compilation.d.ts +0 -21
- package/src/tools/esbuild/angular/compilation/aot-compilation.js +0 -228
- package/src/tools/esbuild/angular/compilation/factory.d.ts +0 -16
- package/src/tools/esbuild/angular/compilation/factory.js +0 -56
- package/src/tools/esbuild/angular/compilation/index.d.ts +0 -10
- package/src/tools/esbuild/angular/compilation/index.js +0 -17
- package/src/tools/esbuild/angular/compilation/jit-compilation.d.ts +0 -21
- package/src/tools/esbuild/angular/compilation/jit-compilation.js +0 -106
- package/src/tools/esbuild/angular/compilation/noop-compilation.d.ts +0 -20
- package/src/tools/esbuild/angular/compilation/noop-compilation.js +0 -26
- package/src/tools/esbuild/angular/compilation/parallel-compilation.d.ts +0 -42
- package/src/tools/esbuild/angular/compilation/parallel-compilation.js +0 -123
- package/src/tools/esbuild/angular/compilation/parallel-worker.d.ts +0 -33
- package/src/tools/esbuild/angular/compilation/parallel-worker.js +0 -90
- package/src/tools/esbuild/angular/compilation-state.d.ts +0 -15
- package/src/tools/esbuild/angular/compilation-state.js +0 -44
- package/src/tools/esbuild/angular/compiler-plugin.d.ts +0 -27
- package/src/tools/esbuild/angular/compiler-plugin.js +0 -433
- package/src/tools/esbuild/angular/component-stylesheets.d.ts +0 -44
- package/src/tools/esbuild/angular/component-stylesheets.js +0 -150
- package/src/tools/esbuild/angular/diagnostics.d.ts +0 -15
- package/src/tools/esbuild/angular/diagnostics.js +0 -69
- package/src/tools/esbuild/angular/file-reference-tracker.d.ts +0 -17
- package/src/tools/esbuild/angular/file-reference-tracker.js +0 -57
- package/src/tools/esbuild/angular/jit-plugin-callbacks.d.ts +0 -23
- package/src/tools/esbuild/angular/jit-plugin-callbacks.js +0 -117
- package/src/tools/esbuild/angular/jit-resource-transformer.d.ts +0 -17
- package/src/tools/esbuild/angular/jit-resource-transformer.js +0 -186
- package/src/tools/esbuild/angular/source-file-cache.d.ts +0 -18
- package/src/tools/esbuild/angular/source-file-cache.js +0 -65
- package/src/tools/esbuild/angular/uri.d.ts +0 -54
- package/src/tools/esbuild/angular/uri.js +0 -74
- package/src/tools/esbuild/angular/web-worker-transformer.d.ts +0 -17
- package/src/tools/esbuild/angular/web-worker-transformer.js +0 -94
- package/src/tools/esbuild/application-code-bundle.d.ts +0 -20
- package/src/tools/esbuild/application-code-bundle.js +0 -368
- package/src/tools/esbuild/budget-stats.d.ts +0 -19
- package/src/tools/esbuild/budget-stats.js +0 -59
- package/src/tools/esbuild/bundler-context.d.ts +0 -75
- package/src/tools/esbuild/bundler-context.js +0 -366
- package/src/tools/esbuild/bundler-execution-result.d.ts +0 -71
- package/src/tools/esbuild/bundler-execution-result.js +0 -131
- package/src/tools/esbuild/cache.d.ts +0 -88
- package/src/tools/esbuild/cache.js +0 -92
- package/src/tools/esbuild/commonjs-checker.d.ts +0 -28
- package/src/tools/esbuild/commonjs-checker.js +0 -151
- package/src/tools/esbuild/compiler-plugin-options.d.ts +0 -16
- package/src/tools/esbuild/compiler-plugin-options.js +0 -49
- package/src/tools/esbuild/external-packages-plugin.d.ts +0 -18
- package/src/tools/esbuild/external-packages-plugin.js +0 -70
- package/src/tools/esbuild/global-scripts.d.ts +0 -16
- package/src/tools/esbuild/global-scripts.js +0 -142
- package/src/tools/esbuild/global-styles.d.ts +0 -10
- package/src/tools/esbuild/global-styles.js +0 -74
- package/src/tools/esbuild/i18n-inliner-worker.d.ts +0 -42
- package/src/tools/esbuild/i18n-inliner-worker.js +0 -136
- package/src/tools/esbuild/i18n-inliner.d.ts +0 -44
- package/src/tools/esbuild/i18n-inliner.js +0 -150
- package/src/tools/esbuild/i18n-locale-plugin.d.ts +0 -22
- package/src/tools/esbuild/i18n-locale-plugin.js +0 -120
- package/src/tools/esbuild/index-html-generator.d.ts +0 -15
- package/src/tools/esbuild/index-html-generator.js +0 -129
- package/src/tools/esbuild/javascript-transformer-worker.d.ts +0 -19
- package/src/tools/esbuild/javascript-transformer-worker.js +0 -154
- package/src/tools/esbuild/javascript-transformer.d.ts +0 -54
- package/src/tools/esbuild/javascript-transformer.js +0 -143
- package/src/tools/esbuild/license-extractor.d.ts +0 -25
- package/src/tools/esbuild/license-extractor.js +0 -158
- package/src/tools/esbuild/load-result-cache.d.ts +0 -21
- package/src/tools/esbuild/load-result-cache.js +0 -75
- package/src/tools/esbuild/profiling.d.ts +0 -11
- package/src/tools/esbuild/profiling.js +0 -78
- package/src/tools/esbuild/rxjs-esm-resolution-plugin.d.ts +0 -18
- package/src/tools/esbuild/rxjs-esm-resolution-plugin.js +0 -44
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.d.ts +0 -17
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.js +0 -73
- package/src/tools/esbuild/stylesheets/bundle-options.d.ts +0 -35
- package/src/tools/esbuild/stylesheets/bundle-options.js +0 -64
- package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.d.ts +0 -25
- package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.js +0 -57
- package/src/tools/esbuild/stylesheets/css-language.d.ts +0 -9
- package/src/tools/esbuild/stylesheets/css-language.js +0 -15
- package/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts +0 -18
- package/src/tools/esbuild/stylesheets/css-resource-plugin.js +0 -107
- package/src/tools/esbuild/stylesheets/less-language.d.ts +0 -9
- package/src/tools/esbuild/stylesheets/less-language.js +0 -155
- package/src/tools/esbuild/stylesheets/sass-language.d.ts +0 -10
- package/src/tools/esbuild/stylesheets/sass-language.js +0 -185
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts +0 -58
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js +0 -282
- package/src/tools/esbuild/utils.d.ts +0 -41
- package/src/tools/esbuild/utils.js +0 -378
- package/src/tools/esbuild/virtual-module-plugin.d.ts +0 -33
- package/src/tools/esbuild/virtual-module-plugin.js +0 -43
- package/src/tools/esbuild/watcher.d.ts +0 -25
- package/src/tools/esbuild/watcher.js +0 -118
- package/src/tools/sass/lexer.d.ts +0 -18
- package/src/tools/sass/lexer.js +0 -161
- package/src/tools/sass/rebasing-importer.d.ts +0 -101
- package/src/tools/sass/rebasing-importer.js +0 -337
- package/src/tools/sass/sass-service.d.ts +0 -49
- package/src/tools/sass/sass-service.js +0 -213
- package/src/tools/sass/worker.d.ts +0 -8
- package/src/tools/sass/worker.js +0 -164
- package/src/tools/vite/angular-memory-plugin.d.ts +0 -24
- package/src/tools/vite/angular-memory-plugin.js +0 -268
- package/src/tools/vite/i18n-locale-plugin.d.ts +0 -18
- package/src/tools/vite/i18n-locale-plugin.js +0 -55
- package/src/typings.d.ts +0 -21
- package/src/utils/bundle-calculator.d.ts +0 -44
- package/src/utils/bundle-calculator.js +0 -302
- package/src/utils/check-port.d.ts +0 -8
- package/src/utils/check-port.js +0 -58
- package/src/utils/delete-output-dir.d.ts +0 -11
- package/src/utils/delete-output-dir.js +0 -46
- package/src/utils/i18n-options.d.ts +0 -40
- package/src/utils/i18n-options.js +0 -254
- package/src/utils/index-file/augment-index-html.d.ts +0 -40
- package/src/utils/index-file/augment-index-html.js +0 -238
- package/src/utils/index-file/html-rewriting-stream.d.ts +0 -11
- package/src/utils/index-file/html-rewriting-stream.js +0 -28
- package/src/utils/index-file/index-html-generator.d.ts +0 -47
- package/src/utils/index-file/index-html-generator.js +0 -119
- package/src/utils/index-file/inline-critical-css.d.ts +0 -24
- package/src/utils/index-file/inline-critical-css.js +0 -179
- package/src/utils/index-file/inline-fonts.d.ts +0 -23
- package/src/utils/index-file/inline-fonts.js +0 -267
- package/src/utils/index-file/style-nonce.d.ts +0 -12
- package/src/utils/index-file/style-nonce.js +0 -53
- package/src/utils/load-proxy-config.d.ts +0 -8
- package/src/utils/load-proxy-config.js +0 -192
- package/src/utils/load-translations.d.ts +0 -16
- package/src/utils/load-translations.js +0 -84
- package/src/utils/postcss-configuration.d.ts +0 -17
- package/src/utils/postcss-configuration.js +0 -86
- package/src/utils/purge-cache.d.ts +0 -10
- package/src/utils/purge-cache.js +0 -40
- package/src/utils/routes-extractor/extractor.d.ts +0 -15
- package/src/utils/routes-extractor/extractor.js +0 -97
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.d.ts +0 -18
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js +0 -129
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.d.ts +0 -8
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js +0 -13
- package/src/utils/server-rendering/fetch-patch.d.ts +0 -8
- package/src/utils/server-rendering/fetch-patch.js +0 -66
- package/src/utils/server-rendering/load-esm-from-memory.d.ts +0 -10
- package/src/utils/server-rendering/load-esm-from-memory.js +0 -26
- package/src/utils/server-rendering/main-bundle-exports.d.ts +0 -27
- package/src/utils/server-rendering/main-bundle-exports.js +0 -9
- package/src/utils/server-rendering/prerender.d.ts +0 -23
- package/src/utils/server-rendering/prerender.js +0 -192
- package/src/utils/server-rendering/render-page.d.ts +0 -26
- package/src/utils/server-rendering/render-page.js +0 -110
- package/src/utils/server-rendering/render-worker.d.ts +0 -22
- package/src/utils/server-rendering/render-worker.js +0 -30
- package/src/utils/server-rendering/routes-extractor-worker.d.ts +0 -21
- package/src/utils/server-rendering/routes-extractor-worker.js +0 -53
- package/src/utils/service-worker.d.ts +0 -25
- package/src/utils/service-worker.js +0 -211
- package/src/utils/supported-browsers.d.ts +0 -10
- package/src/utils/supported-browsers.js +0 -42
- package/src/utils/version.d.ts +0 -8
- package/src/utils/version.js +0 -59
|
@@ -31,23 +31,23 @@ 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
|
-
const
|
|
36
|
+
const node_path_1 = require("node:path");
|
|
36
37
|
const rxjs_1 = require("rxjs");
|
|
37
38
|
const normalize_cache_1 = require("../../utils/normalize-cache");
|
|
38
|
-
const purge_cache_1 = require("../../utils/purge-cache");
|
|
39
39
|
/**
|
|
40
40
|
* @experimental Direct usage of this function is considered experimental.
|
|
41
41
|
*/
|
|
42
42
|
function execute(options, context) {
|
|
43
43
|
return (0, rxjs_1.from)((async () => {
|
|
44
44
|
// Purge old build disk cache.
|
|
45
|
-
await (0,
|
|
45
|
+
await (0, private_1.purgeStaleBuildCache)(context);
|
|
46
46
|
const root = context.workspaceRoot;
|
|
47
47
|
const packager = (await Promise.resolve().then(() => __importStar(require('ng-packagr')))).ngPackagr();
|
|
48
|
-
packager.forProject((0,
|
|
48
|
+
packager.forProject((0, node_path_1.resolve)(root, options.project));
|
|
49
49
|
if (options.tsConfig) {
|
|
50
|
-
packager.withTsConfig((0,
|
|
50
|
+
packager.withTsConfig((0, node_path_1.resolve)(root, options.tsConfig));
|
|
51
51
|
}
|
|
52
52
|
const projectName = context.target?.project;
|
|
53
53
|
if (!projectName) {
|
|
@@ -57,10 +57,11 @@ function execute(options, context) {
|
|
|
57
57
|
const { enabled: cacheEnabled, path: cacheDirectory } = (0, normalize_cache_1.normalizeCacheOptions)(metadata, context.workspaceRoot);
|
|
58
58
|
const ngPackagrOptions = {
|
|
59
59
|
cacheEnabled,
|
|
60
|
-
|
|
60
|
+
poll: options.poll,
|
|
61
|
+
cacheDirectory: (0, node_path_1.join)(cacheDirectory, 'ng-packagr'),
|
|
61
62
|
};
|
|
62
63
|
return { packager, ngPackagrOptions };
|
|
63
|
-
})()).pipe((0, rxjs_1.switchMap)(({ packager, ngPackagrOptions }) => options.watch ? packager.watch(ngPackagrOptions) : packager.build(ngPackagrOptions)), (0, rxjs_1.
|
|
64
|
+
})()).pipe((0, rxjs_1.switchMap)(({ packager, ngPackagrOptions }) => options.watch ? packager.watch(ngPackagrOptions) : packager.build(ngPackagrOptions)), (0, rxjs_1.map)(() => ({ success: true })), (0, rxjs_1.catchError)((err) => (0, rxjs_1.of)({ success: false, error: err.message })));
|
|
64
65
|
}
|
|
65
66
|
exports.execute = execute;
|
|
66
67
|
exports.default = (0, architect_1.createBuilder)(execute);
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* ng-packagr target options for Build Architect. Use to build library projects.
|
|
3
3
|
*/
|
|
4
4
|
export interface Schema {
|
|
5
|
+
/**
|
|
6
|
+
* Enable and define the file watching poll time period in milliseconds.
|
|
7
|
+
*/
|
|
8
|
+
poll?: number;
|
|
5
9
|
/**
|
|
6
10
|
* The file path for the ng-packagr configuration file, relative to the current workspace.
|
|
7
11
|
*/
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"type": "boolean",
|
|
17
17
|
"description": "Run build when files change.",
|
|
18
18
|
"default": false
|
|
19
|
+
},
|
|
20
|
+
"poll": {
|
|
21
|
+
"type": "number",
|
|
22
|
+
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
"additionalProperties": false,
|
|
@@ -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}`,
|
|
@@ -223,21 +223,24 @@ async function initBrowserSync(browserSyncInstance, nodeServerPort, options, con
|
|
|
223
223
|
if (hasPathname) {
|
|
224
224
|
const { createProxyMiddleware } = await Promise.resolve().then(() => __importStar(require('http-proxy-middleware')));
|
|
225
225
|
// Remove leading slash
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}),
|
|
236
|
-
ws: true,
|
|
237
|
-
logLevel: 'silent',
|
|
238
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
226
|
+
bsOptions.scriptPath = (p) => p.substring(1);
|
|
227
|
+
bsOptions.middleware = [
|
|
228
|
+
createProxyMiddleware({
|
|
229
|
+
pathFilter: defaultSocketIoPath,
|
|
230
|
+
target: url.format({
|
|
231
|
+
protocol: 'http',
|
|
232
|
+
hostname: host,
|
|
233
|
+
port: bsPort,
|
|
234
|
+
pathname: path,
|
|
239
235
|
}),
|
|
240
|
-
|
|
236
|
+
ws: true,
|
|
237
|
+
logger: {
|
|
238
|
+
info: () => { },
|
|
239
|
+
warn: () => { },
|
|
240
|
+
error: () => { },
|
|
241
|
+
},
|
|
242
|
+
}),
|
|
243
|
+
];
|
|
241
244
|
}
|
|
242
245
|
}
|
|
243
246
|
if (proxyConfig) {
|
|
@@ -283,21 +286,18 @@ function getSslConfig(root, options) {
|
|
|
283
286
|
return ssl;
|
|
284
287
|
}
|
|
285
288
|
async function getProxyConfig(root, proxyConfig) {
|
|
286
|
-
const proxy = await (0,
|
|
287
|
-
|
|
289
|
+
const proxy = await (0, private_1.loadProxyConfiguration)(root, proxyConfig);
|
|
290
|
+
if (!proxy) {
|
|
291
|
+
return [];
|
|
292
|
+
}
|
|
288
293
|
const { createProxyMiddleware } = await Promise.resolve().then(() => __importStar(require('http-proxy-middleware')));
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
context));
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
createdProxies.push(
|
|
294
|
+
return Object.entries(proxy).map(([key, context]) => {
|
|
295
|
+
const filterRegExp = new RegExp(key);
|
|
296
|
+
return createProxyMiddleware({
|
|
297
|
+
pathFilter: (pathname) => filterRegExp.test(pathname),
|
|
297
298
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return createdProxies;
|
|
299
|
+
...context,
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
302
|
}
|
|
303
303
|
exports.default = (0, architect_1.createBuilder)(execute);
|
|
@@ -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,14 +5,14 @@
|
|
|
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 { Budget } from '../../../builders/browser/schema';
|
|
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.
|
|
13
13
|
*/
|
|
14
14
|
export declare class AnyComponentStyleBudgetChecker {
|
|
15
15
|
private readonly budgets;
|
|
16
|
-
constructor(budgets:
|
|
16
|
+
constructor(budgets: BudgetEntry[]);
|
|
17
17
|
apply(compiler: Compiler): void;
|
|
18
18
|
}
|
|
@@ -31,10 +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 schema_1 = require("../../../builders/browser/schema");
|
|
37
|
-
const bundle_calculator_1 = require("../../../utils/bundle-calculator");
|
|
38
37
|
const webpack_diagnostics_1 = require("../../../utils/webpack-diagnostics");
|
|
39
38
|
const PLUGIN_NAME = 'AnyComponentStyleBudgetChecker';
|
|
40
39
|
/**
|
|
@@ -44,7 +43,7 @@ const PLUGIN_NAME = 'AnyComponentStyleBudgetChecker';
|
|
|
44
43
|
class AnyComponentStyleBudgetChecker {
|
|
45
44
|
budgets;
|
|
46
45
|
constructor(budgets) {
|
|
47
|
-
this.budgets = budgets.filter((budget) => budget.type ===
|
|
46
|
+
this.budgets = budgets.filter((budget) => budget.type === private_1.BudgetType.AnyComponentStyle);
|
|
48
47
|
}
|
|
49
48
|
apply(compiler) {
|
|
50
49
|
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|
@@ -64,22 +63,20 @@ class AnyComponentStyleBudgetChecker {
|
|
|
64
63
|
const componentStyles = Object.keys(compilation.assets)
|
|
65
64
|
.filter((name) => cssExtensions.includes(path.extname(name)))
|
|
66
65
|
.map((name) => ({
|
|
66
|
+
name,
|
|
67
67
|
size: compilation.assets[name].size(),
|
|
68
|
-
|
|
68
|
+
componentStyle: true,
|
|
69
69
|
}));
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
default:
|
|
81
|
-
assertNever(severity);
|
|
82
|
-
}
|
|
70
|
+
for (const { severity, message } of (0, private_1.checkBudgets)(this.budgets, { chunks: [], assets: componentStyles }, true)) {
|
|
71
|
+
switch (severity) {
|
|
72
|
+
case private_1.ThresholdSeverity.Warning:
|
|
73
|
+
(0, webpack_diagnostics_1.addWarning)(compilation, message);
|
|
74
|
+
break;
|
|
75
|
+
case private_1.ThresholdSeverity.Error:
|
|
76
|
+
(0, webpack_diagnostics_1.addError)(compilation, message);
|
|
77
|
+
break;
|
|
78
|
+
default:
|
|
79
|
+
assertNever(severity);
|
|
83
80
|
}
|
|
84
81
|
}
|
|
85
82
|
});
|
|
@@ -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() {
|
|
@@ -51,7 +51,7 @@ class IndexHtmlWebpackPlugin extends index_html_generator_1.IndexHtmlGenerator {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
const { content, warnings, errors } = await this.process({
|
|
54
|
+
const { csrContent: content, warnings, errors, } = await this.process({
|
|
55
55
|
files,
|
|
56
56
|
outputPath: (0, path_1.dirname)(this.options.outputPath),
|
|
57
57
|
baseHref: this.options.baseHref,
|
|
@@ -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,25 +5,12 @@
|
|
|
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
|
-
export declare function formatSize(size: number): string;
|
|
15
|
-
export type BundleStatsData = [
|
|
16
|
-
files: string,
|
|
17
|
-
names: string,
|
|
18
|
-
rawSize: number | string,
|
|
19
|
-
estimatedTransferSize: number | string
|
|
20
|
-
];
|
|
21
|
-
export interface BundleStats {
|
|
22
|
-
initial: boolean;
|
|
23
|
-
stats: BundleStatsData;
|
|
24
|
-
}
|
|
25
|
-
export declare function generateEsbuildBuildStatsTable([browserStats, serverStats]: [browserStats: BundleStats[], serverStats: BundleStats[]], colors: boolean, showTotalSize: boolean, showEstimatedTransferSize: boolean, budgetFailures?: BudgetCalculatorResult[], verbose?: boolean): string;
|
|
26
|
-
export declare function generateBuildStatsTable(data: BundleStats[], colors: boolean, showTotalSize: boolean, showEstimatedTransferSize: boolean, budgetFailures?: BudgetCalculatorResult[]): string;
|
|
27
14
|
export declare function statsWarningsToString(json: StatsCompilation, statsConfig: WebpackStatsOptions): string;
|
|
28
15
|
export declare function statsErrorsToString(json: StatsCompilation, statsConfig: WebpackStatsOptions): string;
|
|
29
16
|
export declare function statsHasErrors(json: StatsCompilation): boolean;
|