@angular-devkit/build-angular 12.0.0-rc.0 → 12.0.0
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/README.md +14 -13
- package/package.json +24 -24
- package/plugins/karma.d.ts +1 -1
- package/plugins/karma.js +1 -1
- package/src/app-shell/index.d.ts +7 -0
- package/src/app-shell/index.js +9 -7
- package/src/app-shell/schema.json +1 -4
- package/src/babel/babel-loader.d.ts +2 -1
- package/src/babel/presets/application.d.ts +7 -0
- package/src/babel/presets/application.js +3 -3
- package/src/babel/webpack-loader.d.ts +7 -0
- package/src/babel/webpack-loader.js +6 -5
- package/src/babel-bazel.d.ts +2 -1
- package/src/browser/index.d.ts +1 -1
- package/src/browser/index.js +34 -33
- package/src/browser/schema.d.ts +1 -5
- package/src/browser/schema.json +11 -57
- package/src/browser/tests/setup.d.ts +1 -1
- package/src/browser/tests/setup.js +7 -0
- package/src/dev-server/index.d.ts +1 -1
- package/src/dev-server/index.js +22 -15
- package/src/dev-server/schema.json +1 -3
- package/src/dev-server/tests/execute-fetch.d.ts +1 -1
- package/src/dev-server/tests/execute-fetch.js +4 -4
- package/src/dev-server/tests/setup.d.ts +7 -0
- package/src/dev-server/tests/setup.js +7 -0
- package/src/extract-i18n/index.d.ts +1 -1
- package/src/extract-i18n/index.js +10 -12
- package/src/extract-i18n/ivy-extract-loader.d.ts +7 -0
- package/src/extract-i18n/ivy-extract-loader.js +7 -6
- package/src/extract-i18n/schema.json +2 -14
- package/src/index.d.ts +6 -6
- package/src/index.js +1 -1
- package/src/karma/find-tests.d.ts +7 -0
- package/src/karma/find-tests.js +4 -4
- package/src/karma/index.d.ts +1 -1
- package/src/karma/index.js +21 -13
- package/src/karma/schema.json +7 -28
- package/src/ng-packagr/index.d.ts +1 -1
- package/src/ng-packagr/index.js +4 -4
- package/src/ng-packagr/schema.json +1 -3
- package/src/protractor/index.d.ts +1 -1
- package/src/protractor/index.js +8 -8
- package/src/protractor/schema.json +1 -3
- package/src/server/index.d.ts +1 -1
- package/src/server/index.js +6 -6
- package/src/server/schema.d.ts +1 -5
- package/src/server/schema.json +7 -35
- package/src/test-utils.d.ts +1 -1
- package/src/test-utils.js +4 -4
- package/src/testing/builder-harness.d.ts +2 -2
- package/src/testing/builder-harness.js +10 -8
- package/src/testing/file-watching.d.ts +1 -1
- package/src/testing/file-watching.js +7 -0
- package/src/testing/index.d.ts +1 -1
- package/src/testing/index.js +7 -0
- package/src/testing/jasmine-helpers.d.ts +2 -2
- package/src/testing/jasmine-helpers.js +7 -0
- package/src/transforms.d.ts +1 -1
- package/src/transforms.js +7 -0
- package/src/tslint/index.d.ts +7 -0
- package/src/tslint/index.js +10 -12
- package/src/tslint/schema.json +1 -1
- package/src/typings.d.ts +2 -1
- package/src/utils/action-cache.d.ts +7 -0
- package/src/utils/action-cache.js +6 -8
- package/src/utils/action-executor.d.ts +7 -0
- package/src/utils/action-executor.js +13 -28
- package/src/utils/build-browser-features.d.ts +1 -1
- package/src/utils/build-browser-features.js +3 -7
- package/src/utils/build-options.d.ts +1 -2
- package/src/utils/build-options.js +1 -1
- package/src/utils/bundle-calculator.d.ts +7 -0
- package/src/utils/bundle-calculator.js +32 -31
- package/src/utils/cache-path.d.ts +7 -0
- package/src/utils/cache-path.js +3 -3
- package/src/utils/check-port.d.ts +7 -0
- package/src/utils/check-port.js +4 -4
- package/src/utils/color.d.ts +1 -1
- package/src/utils/color.js +3 -3
- package/src/utils/copy-assets.d.ts +7 -0
- package/src/utils/copy-assets.js +3 -3
- package/src/utils/copy-file.d.ts +2 -2
- package/src/utils/copy-file.js +4 -4
- package/src/utils/default-progress.d.ts +1 -1
- package/src/utils/default-progress.js +1 -1
- package/src/utils/delete-output-dir.d.ts +7 -0
- package/src/utils/delete-output-dir.js +3 -3
- package/src/utils/empty.js +0 -1
- package/src/utils/environment-options.d.ts +7 -0
- package/src/utils/environment-options.js +3 -3
- package/src/utils/find-up.d.ts +7 -0
- package/src/utils/find-up.js +3 -3
- package/src/utils/i18n-inlining.d.ts +1 -1
- package/src/utils/i18n-inlining.js +8 -1
- package/src/utils/i18n-options.d.ts +1 -1
- package/src/utils/i18n-options.js +11 -3
- package/src/utils/index-file/augment-index-html.d.ts +1 -1
- package/src/utils/index-file/augment-index-html.js +6 -11
- package/src/utils/index-file/html-rewriting-stream.d.ts +1 -1
- package/src/utils/index-file/html-rewriting-stream.js +2 -2
- package/src/utils/index-file/index-html-generator.d.ts +1 -1
- package/src/utils/index-file/index-html-generator.js +7 -11
- package/src/utils/index-file/inline-critical-css.d.ts +1 -1
- package/src/utils/index-file/inline-critical-css.js +1 -1
- package/src/utils/index-file/inline-fonts.d.ts +1 -1
- package/src/utils/index-file/inline-fonts.js +18 -19
- package/src/utils/index.d.ts +1 -1
- package/src/utils/index.js +1 -1
- package/src/utils/is-directory.d.ts +1 -1
- package/src/utils/is-directory.js +2 -3
- package/src/utils/load-translations.d.ts +7 -0
- package/src/utils/load-translations.js +9 -19
- package/src/utils/normalize-asset-patterns.d.ts +1 -1
- package/src/utils/normalize-asset-patterns.js +6 -7
- package/src/utils/normalize-builder-schema.d.ts +1 -1
- package/src/utils/normalize-builder-schema.js +5 -6
- package/src/utils/normalize-file-replacements.d.ts +1 -1
- package/src/utils/normalize-file-replacements.js +2 -3
- package/src/utils/normalize-optimization.d.ts +1 -1
- package/src/utils/normalize-optimization.js +12 -8
- package/src/utils/normalize-source-maps.d.ts +1 -1
- package/src/utils/normalize-source-maps.js +3 -3
- package/src/utils/output-paths.d.ts +7 -0
- package/src/utils/output-paths.js +7 -4
- package/src/utils/package-chunk-sort.d.ts +1 -1
- package/src/utils/package-chunk-sort.js +10 -3
- package/src/utils/process-bundle-bootstrap.js +3 -2
- package/src/utils/process-bundle.d.ts +2 -2
- package/src/utils/process-bundle.js +31 -40
- package/src/utils/read-tsconfig.d.ts +1 -1
- package/src/utils/read-tsconfig.js +2 -4
- package/src/utils/run-module-as-observable-fork.d.ts +1 -1
- package/src/utils/run-module-as-observable-fork.js +9 -2
- package/src/utils/run-module-worker.js +1 -3
- package/src/utils/service-worker.d.ts +1 -1
- package/src/utils/service-worker.js +3 -3
- package/src/utils/spinner.d.ts +1 -1
- package/src/utils/spinner.js +1 -1
- package/src/utils/strip-bom.d.ts +1 -1
- package/src/utils/strip-bom.js +2 -3
- package/src/utils/tty.d.ts +1 -1
- package/src/utils/tty.js +1 -1
- package/src/utils/url.d.ts +1 -1
- package/src/utils/url.js +1 -1
- package/src/utils/version.d.ts +1 -1
- package/src/utils/version.js +3 -3
- package/src/utils/webpack-browser-config.d.ts +1 -1
- package/src/utils/webpack-browser-config.js +9 -2
- package/src/utils/webpack-diagnostics.d.ts +2 -2
- package/src/utils/webpack-diagnostics.js +4 -4
- package/src/utils/workers.d.ts +1 -1
- package/src/utils/workers.js +1 -1
- package/src/webpack/configs/browser.d.ts +7 -0
- package/src/webpack/configs/browser.js +3 -3
- package/src/webpack/configs/common.d.ts +7 -0
- package/src/webpack/configs/common.js +16 -19
- package/src/webpack/configs/dev-server.d.ts +1 -1
- package/src/webpack/configs/dev-server.js +7 -6
- package/src/webpack/configs/index.d.ts +1 -1
- package/src/webpack/configs/index.js +7 -7
- package/src/webpack/configs/server.d.ts +7 -0
- package/src/webpack/configs/server.js +4 -4
- package/src/webpack/configs/stats.d.ts +1 -1
- package/src/webpack/configs/stats.js +1 -1
- package/src/webpack/configs/styles.d.ts +7 -0
- package/src/webpack/configs/styles.js +6 -10
- package/src/webpack/configs/test.d.ts +1 -1
- package/src/webpack/configs/test.js +2 -5
- package/src/webpack/configs/typescript.d.ts +7 -0
- package/src/webpack/configs/typescript.js +4 -6
- package/src/webpack/configs/worker.d.ts +7 -0
- package/src/webpack/configs/worker.js +3 -3
- package/src/webpack/es5-jit-polyfills.js +2 -1
- package/src/webpack/es5-polyfills.js +2 -3
- package/src/webpack/jit-polyfills.js +2 -1
- package/src/webpack/plugins/analytics.d.ts +2 -2
- package/src/webpack/plugins/analytics.js +9 -9
- package/src/webpack/plugins/any-component-style-budget-checker.d.ts +1 -1
- package/src/webpack/plugins/any-component-style-budget-checker.js +3 -9
- package/src/webpack/plugins/builder-watch-plugin.d.ts +1 -1
- package/src/webpack/plugins/builder-watch-plugin.js +7 -0
- package/src/webpack/plugins/common-js-usage-warn-plugin.d.ts +1 -1
- package/src/webpack/plugins/common-js-usage-warn-plugin.js +10 -10
- package/src/webpack/plugins/dedupe-module-resolve-plugin.d.ts +1 -1
- package/src/webpack/plugins/dedupe-module-resolve-plugin.js +9 -2
- package/src/webpack/plugins/hmr/hmr-accept.d.ts +1 -1
- package/src/webpack/plugins/hmr/hmr-accept.js +6 -9
- package/src/webpack/plugins/hmr/hmr-loader.d.ts +1 -1
- package/src/webpack/plugins/hmr/hmr-loader.js +2 -2
- package/src/webpack/plugins/index-html-webpack-plugin.d.ts +7 -0
- package/src/webpack/plugins/index-html-webpack-plugin.js +6 -6
- package/src/webpack/plugins/index.d.ts +2 -2
- package/src/webpack/plugins/index.js +1 -1
- package/src/webpack/plugins/karma/karma-context.html +31 -30
- package/src/webpack/plugins/karma/karma-debug.html +34 -33
- package/src/webpack/plugins/karma/karma.d.ts +7 -0
- package/src/webpack/plugins/karma/karma.js +13 -11
- package/src/webpack/plugins/optimize-css-webpack-plugin.d.ts +7 -0
- package/src/webpack/plugins/optimize-css-webpack-plugin.js +18 -11
- package/src/webpack/plugins/postcss-cli-resources.d.ts +7 -0
- package/src/webpack/plugins/postcss-cli-resources.js +11 -9
- package/src/webpack/plugins/remove-hash-plugin.d.ts +1 -1
- package/src/webpack/plugins/remove-hash-plugin.js +9 -4
- package/src/webpack/plugins/scripts-webpack-plugin.d.ts +1 -1
- package/src/webpack/plugins/scripts-webpack-plugin.js +11 -10
- package/src/webpack/plugins/single-test-transform.d.ts +1 -1
- package/src/webpack/plugins/single-test-transform.js +5 -5
- package/src/webpack/plugins/suppress-entry-chunks-webpack-plugin.d.ts +1 -1
- package/src/webpack/plugins/suppress-entry-chunks-webpack-plugin.js +1 -1
- package/src/webpack/utils/async-chunks.d.ts +1 -1
- package/src/webpack/utils/async-chunks.js +9 -1
- package/src/webpack/utils/helpers.d.ts +1 -1
- package/src/webpack/utils/helpers.js +2 -2
- package/src/webpack/utils/stats.d.ts +1 -1
- package/src/webpack/utils/stats.js +39 -33
package/src/utils/strip-bom.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
-
// tslint:disable
|
|
10
|
-
// TODO: cleanup this file, it's copied as is from Angular CLI.
|
|
11
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
10
|
exports.stripBom = void 0;
|
|
11
|
+
// TODO: cleanup this file, it's copied as is from Angular CLI.
|
|
13
12
|
// Strip BOM from file data.
|
|
14
13
|
// https://stackoverflow.com/questions/24356713
|
|
15
14
|
function stripBom(data) {
|
package/src/utils/tty.d.ts
CHANGED
package/src/utils/tty.js
CHANGED
package/src/utils/url.d.ts
CHANGED
package/src/utils/url.js
CHANGED
package/src/utils/version.d.ts
CHANGED
package/src/utils/version.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertCompatibleAngularVersion = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.assertCompatibleAngularVersion = void 0;
|
|
11
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
12
|
const semver_1 = require("semver");
|
|
13
13
|
function assertCompatibleAngularVersion(projectRoot, logger) {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
exports.getIndexInputFile = exports.getIndexOutputFile = exports.generateBrowserWebpackConfigFromContext = exports.generateI18nBrowserWebpackConfigFromContext = exports.generateWebpackConfig = void 0;
|
|
4
11
|
const core_1 = require("@angular-devkit/core");
|
|
@@ -63,8 +70,8 @@ async function generateI18nBrowserWebpackConfigFromContext(options, context, web
|
|
|
63
70
|
(_a = config.plugins) !== null && _a !== void 0 ? _a : (config.plugins = []);
|
|
64
71
|
config.plugins.push({
|
|
65
72
|
apply(compiler) {
|
|
66
|
-
compiler.hooks.compilation.tap('build-angular', compilation => {
|
|
67
|
-
webpack_1.JavascriptModulesPlugin.getCompilationHooks(compilation).chunkHash.tap('build-angular', (_, hash) => {
|
|
73
|
+
compiler.hooks.compilation.tap('build-angular', (compilation) => {
|
|
74
|
+
webpack_1.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation).chunkHash.tap('build-angular', (_, hash) => {
|
|
68
75
|
hash.update('$localize' + i18nHash);
|
|
69
76
|
});
|
|
70
77
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright Google
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
7
|
+
*/
|
|
8
8
|
import { Compilation } from 'webpack';
|
|
9
9
|
export declare function addWarning(compilation: Compilation, message: string): void;
|
|
10
10
|
export declare function addError(compilation: Compilation, message: string): void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addError = exports.addWarning = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
|
-
*/
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.addError = exports.addWarning = void 0;
|
|
11
11
|
const webpack_1 = require("webpack");
|
|
12
12
|
function addWarning(compilation, message) {
|
|
13
13
|
compilation.warnings.push(new webpack_1.WebpackError(message));
|
package/src/utils/workers.d.ts
CHANGED
package/src/utils/workers.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import * as webpack from 'webpack';
|
|
2
9
|
import { WebpackConfigOptions } from '../../utils/build-options';
|
|
3
10
|
export declare function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configuration;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBrowserConfig = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getBrowserConfig = void 0;
|
|
11
11
|
const typescript_1 = require("typescript");
|
|
12
12
|
const utils_1 = require("../../utils");
|
|
13
13
|
const plugins_1 = require("../plugins");
|
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import { Configuration } from 'webpack';
|
|
2
9
|
import { WebpackConfigOptions } from '../../utils/build-options';
|
|
3
10
|
export declare function getCommonConfig(wco: WebpackConfigOptions): Configuration;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCommonConfig = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getCommonConfig = void 0;
|
|
11
11
|
const build_optimizer_1 = require("@angular-devkit/build-optimizer");
|
|
12
12
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
13
13
|
const fs_1 = require("fs");
|
|
@@ -24,11 +24,11 @@ const plugins_1 = require("../plugins");
|
|
|
24
24
|
const helpers_1 = require("../utils/helpers");
|
|
25
25
|
const stats_1 = require("../utils/stats");
|
|
26
26
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
27
|
-
//
|
|
27
|
+
// eslint-disable-next-line max-lines-per-function
|
|
28
28
|
function getCommonConfig(wco) {
|
|
29
29
|
var _a;
|
|
30
30
|
const { root, projectRoot, buildOptions, tsConfig } = wco;
|
|
31
|
-
const { platform = 'browser', sourceMap: { styles: stylesSourceMap, scripts: scriptsSourceMap, vendor: vendorSourceMap
|
|
31
|
+
const { platform = 'browser', sourceMap: { styles: stylesSourceMap, scripts: scriptsSourceMap, vendor: vendorSourceMap }, optimization: { styles: stylesOptimization, scripts: scriptsOptimization }, } = buildOptions;
|
|
32
32
|
const extraPlugins = [];
|
|
33
33
|
const extraRules = [];
|
|
34
34
|
const entryPoints = {};
|
|
@@ -94,7 +94,7 @@ function getCommonConfig(wco) {
|
|
|
94
94
|
throw new Error(`Script file ${input} does not exist.`);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
const existingEntry = prev.find(el => el.bundleName === bundleName);
|
|
97
|
+
const existingEntry = prev.find((el) => el.bundleName === bundleName);
|
|
98
98
|
if (existingEntry) {
|
|
99
99
|
if (existingEntry.inject && !inject) {
|
|
100
100
|
// All entries have to be lazy for the bundle to be lazy.
|
|
@@ -128,7 +128,7 @@ function getCommonConfig(wco) {
|
|
|
128
128
|
if (buildOptions.assets.length) {
|
|
129
129
|
const copyWebpackPluginPatterns = buildOptions.assets.map((asset) => {
|
|
130
130
|
// Resolve input paths relative to workspace root and add slash at the end.
|
|
131
|
-
//
|
|
131
|
+
// eslint-disable-next-line prefer-const
|
|
132
132
|
let { input, output, ignore = [], glob } = asset;
|
|
133
133
|
input = path.resolve(root, input).replace(/\\/g, '/');
|
|
134
134
|
input = input.endsWith('/') ? input : input + '/';
|
|
@@ -154,14 +154,12 @@ function getCommonConfig(wco) {
|
|
|
154
154
|
// causes negate patterns not to match.
|
|
155
155
|
// See: https://github.com/webpack-contrib/copy-webpack-plugin/issues/498#issuecomment-639327909
|
|
156
156
|
...ignore,
|
|
157
|
-
].map(i => path.posix.join(input, i)),
|
|
157
|
+
].map((i) => path.posix.join(input, i)),
|
|
158
158
|
},
|
|
159
159
|
};
|
|
160
160
|
});
|
|
161
161
|
extraPlugins.push(new CopyWebpackPlugin({
|
|
162
162
|
patterns: copyWebpackPluginPatterns,
|
|
163
|
-
// The typings for copy-webpack-plugin use the old @types/webpack package
|
|
164
|
-
// tslint:disable-next-line: no-any
|
|
165
163
|
}));
|
|
166
164
|
}
|
|
167
165
|
if (buildOptions.progress) {
|
|
@@ -180,7 +178,7 @@ function getCommonConfig(wco) {
|
|
|
180
178
|
spinner.start(`Generating ${platform} application bundles...`);
|
|
181
179
|
break;
|
|
182
180
|
case 1:
|
|
183
|
-
spinner.succeed(`${platform.replace(/^\w/, s => s.toUpperCase())} application bundle generation complete.`);
|
|
181
|
+
spinner.succeed(`${platform.replace(/^\w/, (s) => s.toUpperCase())} application bundle generation complete.`);
|
|
184
182
|
break;
|
|
185
183
|
default:
|
|
186
184
|
spinner.text = `Generating ${platform} application bundles (phase: ${message})...`;
|
|
@@ -217,12 +215,10 @@ function getCommonConfig(wco) {
|
|
|
217
215
|
}
|
|
218
216
|
})());
|
|
219
217
|
}
|
|
220
|
-
if (
|
|
218
|
+
if (scriptsSourceMap || stylesSourceMap) {
|
|
221
219
|
extraRules.push({
|
|
222
220
|
test: /\.m?js$/,
|
|
223
|
-
exclude: vendorSourceMap
|
|
224
|
-
? undefined
|
|
225
|
-
: /[\\\/]node_modules[\\\/]/,
|
|
221
|
+
exclude: vendorSourceMap ? undefined : /[\\\/]node_modules[\\\/]/,
|
|
226
222
|
enforce: 'pre',
|
|
227
223
|
loader: require.resolve('source-map-loader'),
|
|
228
224
|
});
|
|
@@ -242,11 +238,11 @@ function getCommonConfig(wco) {
|
|
|
242
238
|
extraMinimizers.push(new plugins_1.OptimizeCssWebpackPlugin({
|
|
243
239
|
sourceMap: stylesSourceMap,
|
|
244
240
|
// component styles retain their original file name
|
|
245
|
-
test: file => /\.(?:css|scss|sass|less|styl)$/.test(file),
|
|
241
|
+
test: (file) => /\.(?:css|scss|sass|less|styl)$/.test(file),
|
|
246
242
|
}));
|
|
247
243
|
}
|
|
248
244
|
if (scriptsOptimization) {
|
|
249
|
-
const { GLOBAL_DEFS_FOR_TERSER, GLOBAL_DEFS_FOR_TERSER_WITH_AOT } = require('@angular/compiler-cli');
|
|
245
|
+
const { GLOBAL_DEFS_FOR_TERSER, GLOBAL_DEFS_FOR_TERSER_WITH_AOT, } = require('@angular/compiler-cli');
|
|
250
246
|
const angularGlobalDefinitions = buildOptions.aot
|
|
251
247
|
? GLOBAL_DEFS_FOR_TERSER_WITH_AOT
|
|
252
248
|
: GLOBAL_DEFS_FOR_TERSER;
|
|
@@ -287,7 +283,7 @@ function getCommonConfig(wco) {
|
|
|
287
283
|
// Name mangling is handled within the browser builder
|
|
288
284
|
mangle: environment_options_1.allowMangle && platform !== 'server' && !differentialLoadingMode,
|
|
289
285
|
};
|
|
290
|
-
const globalScriptsNames = globalScriptsByBundleName.map(s => s.bundleName);
|
|
286
|
+
const globalScriptsNames = globalScriptsByBundleName.map((s) => s.bundleName);
|
|
291
287
|
extraMinimizers.push(new TerserPlugin({
|
|
292
288
|
sourceMap: scriptsSourceMap,
|
|
293
289
|
parallel: utils_1.maxWorkers,
|
|
@@ -394,7 +390,8 @@ function getCommonConfig(wco) {
|
|
|
394
390
|
...extraRules,
|
|
395
391
|
],
|
|
396
392
|
},
|
|
397
|
-
cache: !!buildOptions.watch &&
|
|
393
|
+
cache: !!buildOptions.watch &&
|
|
394
|
+
!environment_options_1.cachingDisabled && {
|
|
398
395
|
type: 'memory',
|
|
399
396
|
maxGenerations: 1,
|
|
400
397
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
@@ -38,9 +38,10 @@ function getDevServerConfig(wco) {
|
|
|
38
38
|
// There's no option to turn off file watching in webpack-dev-server, but
|
|
39
39
|
// we can override the file watcher instead.
|
|
40
40
|
extraPlugins.push({
|
|
41
|
-
//
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
42
|
apply: (compiler) => {
|
|
43
43
|
compiler.hooks.afterEnvironment.tap('angular-cli', () => {
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
44
45
|
compiler.watchFileSystem = { watch: () => { } };
|
|
45
46
|
});
|
|
46
47
|
},
|
|
@@ -50,7 +51,7 @@ function getDevServerConfig(wco) {
|
|
|
50
51
|
if (hmr) {
|
|
51
52
|
extraRules.push({
|
|
52
53
|
loader: hmr_loader_1.HmrLoader,
|
|
53
|
-
include: [main].map(p => path_1.resolve(wco.root, p)),
|
|
54
|
+
include: [main].map((p) => path_1.resolve(wco.root, p)),
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
return {
|
|
@@ -72,7 +73,7 @@ function getDevServerConfig(wco) {
|
|
|
72
73
|
rewrites: [
|
|
73
74
|
{
|
|
74
75
|
from: new RegExp(`^(?!${servePath})/.*`),
|
|
75
|
-
to: context => url.format(context.parsedUrl),
|
|
76
|
+
to: (context) => url.format(context.parsedUrl),
|
|
76
77
|
},
|
|
77
78
|
],
|
|
78
79
|
},
|
|
@@ -98,7 +99,7 @@ function getDevServerConfig(wco) {
|
|
|
98
99
|
hot: hmr,
|
|
99
100
|
proxy: addProxyConfig(root, proxyConfig),
|
|
100
101
|
contentBase: false,
|
|
101
|
-
logLevel: '
|
|
102
|
+
logLevel: 'error',
|
|
102
103
|
},
|
|
103
104
|
};
|
|
104
105
|
}
|
|
@@ -173,7 +174,7 @@ function findDefaultServePath(baseHref, deployUrl) {
|
|
|
173
174
|
// normalize baseHref
|
|
174
175
|
// for ng serve the starting base is always `/` so a relative
|
|
175
176
|
// and root relative value are identical
|
|
176
|
-
const baseHrefParts = (baseHref || '').split('/').filter(part => part !== '');
|
|
177
|
+
const baseHrefParts = (baseHref || '').split('/').filter((part) => part !== '');
|
|
177
178
|
if (baseHref && !baseHref.endsWith('/')) {
|
|
178
179
|
baseHrefParts.pop();
|
|
179
180
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
2
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
10
|
if (k2 === undefined) k2 = k;
|
|
4
11
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -10,13 +17,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
17
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
18
|
};
|
|
12
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
16
|
-
*
|
|
17
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
18
|
-
* found in the LICENSE file at https://angular.io/license
|
|
19
|
-
*/
|
|
20
20
|
__exportStar(require("./browser"), exports);
|
|
21
21
|
__exportStar(require("./common"), exports);
|
|
22
22
|
__exportStar(require("./dev-server"), exports);
|
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import { Configuration } from 'webpack';
|
|
2
9
|
import { WebpackConfigOptions } from '../../utils/build-options';
|
|
3
10
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getServerConfig = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getServerConfig = void 0;
|
|
11
11
|
const path_1 = require("path");
|
|
12
12
|
const webpack_1 = require("webpack");
|
|
13
13
|
const helpers_1 = require("../utils/helpers");
|
|
@@ -16,7 +16,7 @@ const helpers_1 = require("../utils/helpers");
|
|
|
16
16
|
* @param wco Options which include the build options and app config
|
|
17
17
|
*/
|
|
18
18
|
function getServerConfig(wco) {
|
|
19
|
-
const { sourceMap, bundleDependencies, externalDependencies = []
|
|
19
|
+
const { sourceMap, bundleDependencies, externalDependencies = [] } = wco.buildOptions;
|
|
20
20
|
const extraPlugins = [];
|
|
21
21
|
const { scripts, styles, hidden } = sourceMap;
|
|
22
22
|
if (scripts || styles) {
|
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import * as webpack from 'webpack';
|
|
2
9
|
import { WebpackConfigOptions } from '../../utils/build-options';
|
|
3
10
|
export declare function getStylesConfig(wco: WebpackConfigOptions): webpack.Configuration;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getStylesConfig = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getStylesConfig = void 0;
|
|
11
11
|
const fs = require("fs");
|
|
12
12
|
const path = require("path");
|
|
13
13
|
const build_browser_features_1 = require("../../utils/build-browser-features");
|
|
@@ -47,7 +47,7 @@ function resolveGlobalStyles(styleEntrypoints, root, preserveSymlinks) {
|
|
|
47
47
|
}
|
|
48
48
|
return { entryPoints, noInjectNames, paths };
|
|
49
49
|
}
|
|
50
|
-
//
|
|
50
|
+
// eslint-disable-next-line max-lines-per-function
|
|
51
51
|
function getStylesConfig(wco) {
|
|
52
52
|
var _a, _b, _c;
|
|
53
53
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
@@ -67,13 +67,12 @@ function getStylesConfig(wco) {
|
|
|
67
67
|
// Add plugin to remove hashes from lazy styles.
|
|
68
68
|
extraPlugins.push(new plugins_1.RemoveHashPlugin({ chunkNames: noInjectNames, hashFormat }));
|
|
69
69
|
}
|
|
70
|
-
if (globalStylePaths.some(p => p.endsWith('.styl'))) {
|
|
70
|
+
if (globalStylePaths.some((p) => p.endsWith('.styl'))) {
|
|
71
71
|
wco.logger.warn('Stylus usage is deprecated and will be removed in a future major version. ' +
|
|
72
72
|
'To opt-out of the deprecated behaviour, please migrate to another stylesheet language.');
|
|
73
73
|
}
|
|
74
74
|
let sassImplementation;
|
|
75
75
|
try {
|
|
76
|
-
// tslint:disable-next-line:no-implicit-dependencies
|
|
77
76
|
sassImplementation = require('node-sass');
|
|
78
77
|
wco.logger.warn(`'node-sass' usage is deprecated and will be removed in a future major version. ` +
|
|
79
78
|
`To opt-out of the deprecated behaviour and start using 'sass' uninstall 'node-sass'.`);
|
|
@@ -117,7 +116,7 @@ function getStylesConfig(wco) {
|
|
|
117
116
|
}
|
|
118
117
|
const { supportedBrowsers } = new build_browser_features_1.BuildBrowserFeatures(wco.projectRoot);
|
|
119
118
|
const postcssOptionsCreator = (inlineSourcemaps, extracted) => {
|
|
120
|
-
//
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
121
120
|
const optionGenerator = (loader) => ({
|
|
122
121
|
map: inlineSourcemaps
|
|
123
122
|
? {
|
|
@@ -152,7 +151,6 @@ function getStylesConfig(wco) {
|
|
|
152
151
|
}),
|
|
153
152
|
...extraPostcssPlugins,
|
|
154
153
|
postcssPresetEnv({
|
|
155
|
-
// tslint:disable-next-line: no-any
|
|
156
154
|
browsers: supportedBrowsers,
|
|
157
155
|
autoprefixer: true,
|
|
158
156
|
stage: 3,
|
|
@@ -239,7 +237,6 @@ function getStylesConfig(wco) {
|
|
|
239
237
|
includePaths,
|
|
240
238
|
// Use expanded as otherwise sass will remove comments that are needed for autoprefixer
|
|
241
239
|
// Ex: /* autoprefixer grid: autoplace */
|
|
242
|
-
// tslint:disable-next-line: max-line-length
|
|
243
240
|
// See: https://github.com/webpack-contrib/sass-loader/blob/45ad0be17264ceada5f0b4fb87e9357abe85c4ff/src/getSassOptions.js#L68-L70
|
|
244
241
|
outputStyle: 'expanded',
|
|
245
242
|
},
|
|
@@ -269,7 +266,6 @@ function getStylesConfig(wco) {
|
|
|
269
266
|
includePaths,
|
|
270
267
|
// Use expanded as otherwise sass will remove comments that are needed for autoprefixer
|
|
271
268
|
// Ex: /* autoprefixer grid: autoplace */
|
|
272
|
-
// tslint:disable-next-line: max-line-length
|
|
273
269
|
// See: https://github.com/webpack-contrib/sass-loader/blob/45ad0be17264ceada5f0b4fb87e9357abe85c4ff/src/getSassOptions.js#L68-L70
|
|
274
270
|
outputStyle: 'expanded',
|
|
275
271
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
@@ -16,10 +16,7 @@ function getTestConfig(wco) {
|
|
|
16
16
|
const extraRules = [];
|
|
17
17
|
const extraPlugins = [];
|
|
18
18
|
if (codeCoverage) {
|
|
19
|
-
const exclude = [
|
|
20
|
-
/\.(e2e|spec)\.tsx?$/,
|
|
21
|
-
/node_modules/,
|
|
22
|
-
];
|
|
19
|
+
const exclude = [/\.(e2e|spec)\.tsx?$/, /node_modules/];
|
|
23
20
|
if (codeCoverageExclude) {
|
|
24
21
|
for (const excludeGlob of codeCoverageExclude) {
|
|
25
22
|
glob
|
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
*/
|
|
1
8
|
import { AngularWebpackPlugin } from '@ngtools/webpack';
|
|
2
9
|
import { WebpackConfigOptions } from '../../utils/build-options';
|
|
3
10
|
export declare function getTypeScriptConfig(wco: WebpackConfigOptions): {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTypescriptWorkerPlugin = exports.getTypeScriptConfig = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getTypescriptWorkerPlugin = exports.getTypeScriptConfig = void 0;
|
|
11
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
12
|
const webpack_1 = require("@ngtools/webpack");
|
|
13
13
|
function ensureIvy(wco) {
|
|
@@ -75,9 +75,7 @@ function getTypeScriptConfig(wco) {
|
|
|
75
75
|
},
|
|
76
76
|
],
|
|
77
77
|
},
|
|
78
|
-
plugins: [
|
|
79
|
-
createIvyPlugin(wco, aot, tsConfigPath),
|
|
80
|
-
],
|
|
78
|
+
plugins: [createIvyPlugin(wco, aot, tsConfigPath)],
|
|
81
79
|
};
|
|
82
80
|
}
|
|
83
81
|
exports.getTypeScriptConfig = getTypeScriptConfig;
|