@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
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeAssetPatterns = exports.MissingAssetSourceRootException = 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.normalizeAssetPatterns = exports.MissingAssetSourceRootException = void 0;
|
|
11
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
12
|
const fs_1 = require("fs");
|
|
13
13
|
class MissingAssetSourceRootException extends core_1.BaseException {
|
|
@@ -23,8 +23,7 @@ function normalizeAssetPatterns(assetPatterns, root, projectRoot, maybeSourceRoo
|
|
|
23
23
|
if (assetPatterns.length === 0) {
|
|
24
24
|
return [];
|
|
25
25
|
}
|
|
26
|
-
return assetPatterns
|
|
27
|
-
.map(assetPattern => {
|
|
26
|
+
return assetPatterns.map((assetPattern) => {
|
|
28
27
|
// Normalize string asset patterns to objects.
|
|
29
28
|
if (typeof assetPattern === 'string') {
|
|
30
29
|
const assetPath = core_1.normalize(assetPattern);
|
|
@@ -33,7 +32,7 @@ function normalizeAssetPatterns(assetPatterns, root, projectRoot, maybeSourceRoo
|
|
|
33
32
|
if (!resolvedAssetPath.startsWith(resolvedSourceRoot)) {
|
|
34
33
|
throw new MissingAssetSourceRootException(assetPattern);
|
|
35
34
|
}
|
|
36
|
-
let glob, input
|
|
35
|
+
let glob, input;
|
|
37
36
|
let isDirectory = false;
|
|
38
37
|
try {
|
|
39
38
|
isDirectory = fs_1.statSync(core_1.getSystemPath(resolvedAssetPath)).isDirectory();
|
|
@@ -54,7 +53,7 @@ function normalizeAssetPatterns(assetPatterns, root, projectRoot, maybeSourceRoo
|
|
|
54
53
|
input = core_1.dirname(assetPath);
|
|
55
54
|
}
|
|
56
55
|
// Output directory for both is the relative path from source root to input.
|
|
57
|
-
output = core_1.relative(resolvedSourceRoot, core_1.resolve(root, input));
|
|
56
|
+
const output = core_1.relative(resolvedSourceRoot, core_1.resolve(root, input));
|
|
58
57
|
// Return the asset pattern in object format.
|
|
59
58
|
return { glob, input, output };
|
|
60
59
|
}
|
|
@@ -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
|
|
@@ -20,16 +20,15 @@ function normalizeBrowserSchema(root, projectRoot, sourceRoot, options) {
|
|
|
20
20
|
fileReplacements: normalize_file_replacements_1.normalizeFileReplacements(options.fileReplacements || [], root),
|
|
21
21
|
optimization: normalize_optimization_1.normalizeOptimization(options.optimization),
|
|
22
22
|
sourceMap: normalizedSourceMapOptions,
|
|
23
|
-
preserveSymlinks: options.preserveSymlinks === undefined
|
|
23
|
+
preserveSymlinks: options.preserveSymlinks === undefined
|
|
24
|
+
? process.execArgv.includes('--preserve-symlinks')
|
|
25
|
+
: options.preserveSymlinks,
|
|
24
26
|
statsJson: options.statsJson || false,
|
|
25
|
-
forkTypeChecker: options.forkTypeChecker || false,
|
|
26
27
|
budgets: options.budgets || [],
|
|
27
28
|
scripts: options.scripts || [],
|
|
28
29
|
styles: options.styles || [],
|
|
29
30
|
stylePreprocessorOptions: {
|
|
30
|
-
includePaths: options.stylePreprocessorOptions
|
|
31
|
-
&& options.stylePreprocessorOptions.includePaths
|
|
32
|
-
|| [],
|
|
31
|
+
includePaths: (options.stylePreprocessorOptions && options.stylePreprocessorOptions.includePaths) || [],
|
|
33
32
|
},
|
|
34
33
|
// Using just `--poll` will result in a value of 0 which is very likely not the intention
|
|
35
34
|
// A value of 0 is falsy and will disable polling rather then enable
|
|
@@ -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
|
|
@@ -20,8 +20,7 @@ function normalizeFileReplacements(fileReplacements, root) {
|
|
|
20
20
|
if (fileReplacements.length === 0) {
|
|
21
21
|
return [];
|
|
22
22
|
}
|
|
23
|
-
const normalizedReplacement = fileReplacements
|
|
24
|
-
.map(replacement => normalizeFileReplacement(replacement, root));
|
|
23
|
+
const normalizedReplacement = fileReplacements.map((replacement) => normalizeFileReplacement(replacement, root));
|
|
25
24
|
for (const { replace, with: replacementWith } of normalizedReplacement) {
|
|
26
25
|
if (!fs_1.existsSync(core_1.getSystemPath(replacementWith))) {
|
|
27
26
|
throw new MissingFileReplacementException(core_1.getSystemPath(replacementWith));
|
|
@@ -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
|
|
@@ -12,13 +12,17 @@ function normalizeOptimization(optimization = true) {
|
|
|
12
12
|
if (typeof optimization === 'object') {
|
|
13
13
|
return {
|
|
14
14
|
scripts: !!optimization.scripts,
|
|
15
|
-
styles: typeof optimization.styles === 'object'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
styles: typeof optimization.styles === 'object'
|
|
16
|
+
? optimization.styles
|
|
17
|
+
: {
|
|
18
|
+
minify: !!optimization.styles,
|
|
19
|
+
inlineCritical: !!optimization.styles,
|
|
20
|
+
},
|
|
21
|
+
fonts: typeof optimization.fonts === 'object'
|
|
22
|
+
? optimization.fonts
|
|
23
|
+
: {
|
|
24
|
+
inline: !!optimization.fonts,
|
|
25
|
+
},
|
|
22
26
|
};
|
|
23
27
|
}
|
|
24
28
|
return {
|
|
@@ -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
|
|
@@ -11,8 +11,8 @@ exports.normalizeSourceMaps = void 0;
|
|
|
11
11
|
function normalizeSourceMaps(sourceMap) {
|
|
12
12
|
const scripts = typeof sourceMap === 'object' ? sourceMap.scripts : sourceMap;
|
|
13
13
|
const styles = typeof sourceMap === 'object' ? sourceMap.styles : sourceMap;
|
|
14
|
-
const hidden = typeof sourceMap === 'object' && sourceMap.hidden || false;
|
|
15
|
-
const vendor = typeof sourceMap === 'object' && sourceMap.vendor || false;
|
|
14
|
+
const hidden = (typeof sourceMap === 'object' && sourceMap.hidden) || false;
|
|
15
|
+
const vendor = (typeof sourceMap === 'object' && sourceMap.vendor) || false;
|
|
16
16
|
return {
|
|
17
17
|
vendor,
|
|
18
18
|
hidden,
|
|
@@ -1,2 +1,9 @@
|
|
|
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 { I18nOptions } from './i18n-options';
|
|
2
9
|
export declare function ensureOutputPaths(baseOutputPath: string, i18n: I18nOptions): Map<string, string>;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ensureOutputPaths = 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.ensureOutputPaths = void 0;
|
|
11
11
|
const fs_1 = require("fs");
|
|
12
12
|
const path_1 = require("path");
|
|
13
13
|
function ensureOutputPaths(baseOutputPath, i18n) {
|
|
14
14
|
const outputPaths = i18n.shouldInline
|
|
15
|
-
? [...i18n.inlineLocales].map(l => [
|
|
15
|
+
? [...i18n.inlineLocales].map((l) => [
|
|
16
|
+
l,
|
|
17
|
+
i18n.flatOutput ? baseOutputPath : path_1.join(baseOutputPath, l),
|
|
18
|
+
])
|
|
16
19
|
: [['', baseOutputPath]];
|
|
17
20
|
for (const [, outputPath] of outputPaths) {
|
|
18
21
|
if (!fs_1.existsSync(outputPath)) {
|
|
@@ -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.generateEntryPoints = void 0;
|
|
4
11
|
const helpers_1 = require("../webpack/utils/helpers");
|
|
@@ -6,8 +13,8 @@ function generateEntryPoints(appConfig) {
|
|
|
6
13
|
// Add all styles/scripts, except lazy-loaded ones.
|
|
7
14
|
const extraEntryPoints = (extraEntryPoints, defaultBundleName) => {
|
|
8
15
|
const entryPoints = helpers_1.normalizeExtraEntryPoints(extraEntryPoints, defaultBundleName)
|
|
9
|
-
.filter(entry => entry.inject)
|
|
10
|
-
.map(entry => entry.bundleName);
|
|
16
|
+
.filter((entry) => entry.inject)
|
|
17
|
+
.map((entry) => entry.bundleName);
|
|
11
18
|
// remove duplicates
|
|
12
19
|
return [...new Set(entryPoints)];
|
|
13
20
|
};
|
|
@@ -22,7 +29,7 @@ function generateEntryPoints(appConfig) {
|
|
|
22
29
|
'main',
|
|
23
30
|
];
|
|
24
31
|
const duplicates = [
|
|
25
|
-
...new Set(entryPoints.filter(x => entryPoints.indexOf(x) !== entryPoints.lastIndexOf(x))),
|
|
32
|
+
...new Set(entryPoints.filter((x) => entryPoints.indexOf(x) !== entryPoints.lastIndexOf(x))),
|
|
26
33
|
];
|
|
27
34
|
if (duplicates.length > 0) {
|
|
28
35
|
throw new Error(`Multiple bundles have been named the same: '${duplicates.join(`', '`)}'.`);
|
|
@@ -1,9 +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
9
|
require('../../../../../lib/bootstrap-local');
|
|
9
|
-
module.exports = require('./process-bundle.ts');
|
|
10
|
+
module.exports = require('./process-bundle.ts');
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="packages/angular_devkit/build_angular/src/babel-bazel" />
|
|
2
1
|
/**
|
|
3
2
|
* @license
|
|
4
|
-
* Copyright Google
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
4
|
*
|
|
6
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
6
|
* found in the LICENSE file at https://angular.io/license
|
|
8
7
|
*/
|
|
8
|
+
/// <reference types="packages/angular_devkit/build_angular/src/babel-bazel" />
|
|
9
9
|
import { PluginObj } from '@babel/core';
|
|
10
10
|
import { I18nOptions } from './i18n-options';
|
|
11
11
|
export interface ProcessBundleOptions {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.inlineLocales = exports.createI18nPlugins = exports.process = exports.setup = 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.inlineLocales = exports.createI18nPlugins = exports.process = exports.setup = void 0;
|
|
11
11
|
const core_1 = require("@babel/core");
|
|
12
12
|
const template_1 = require("@babel/template");
|
|
13
13
|
const cacache = require("cacache");
|
|
@@ -19,7 +19,7 @@ const terser_1 = require("terser");
|
|
|
19
19
|
const v8 = require("v8");
|
|
20
20
|
const webpack_1 = require("webpack");
|
|
21
21
|
const environment_options_1 = require("./environment-options");
|
|
22
|
-
const { ConcatSource, OriginalSource, ReplaceSource, SourceMapSource
|
|
22
|
+
const { ConcatSource, OriginalSource, ReplaceSource, SourceMapSource } = webpack_1.sources;
|
|
23
23
|
// If code size is larger than 500KB, consider lower fidelity but faster sourcemap merge
|
|
24
24
|
const FAST_SOURCEMAP_THRESHOLD = 500 * 1024;
|
|
25
25
|
let cachePath;
|
|
@@ -76,11 +76,12 @@ async function process(options) {
|
|
|
76
76
|
filename,
|
|
77
77
|
// using false ensures that babel will NOT search and process sourcemap comments (large memory usage)
|
|
78
78
|
// The types do not include the false option even though it is valid
|
|
79
|
-
//
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
80
|
inputSourceMap: false,
|
|
81
81
|
babelrc: false,
|
|
82
82
|
configFile: false,
|
|
83
|
-
presets: [
|
|
83
|
+
presets: [
|
|
84
|
+
[
|
|
84
85
|
require.resolve('@babel/preset-env'),
|
|
85
86
|
{
|
|
86
87
|
// browserslist-compatible query or object of minimum environment versions to support
|
|
@@ -90,7 +91,8 @@ async function process(options) {
|
|
|
90
91
|
// 'transform-typeof-symbol' generates slower code
|
|
91
92
|
exclude: ['transform-typeof-symbol'],
|
|
92
93
|
},
|
|
93
|
-
]
|
|
94
|
+
],
|
|
95
|
+
],
|
|
94
96
|
plugins: [
|
|
95
97
|
createIifeWrapperPlugin(),
|
|
96
98
|
...(options.replacements ? [createReplacePlugin(options.replacements)] : []),
|
|
@@ -137,7 +139,6 @@ async function mergeSourceMaps(inputCode, inputSourceMap, resultCode, resultSour
|
|
|
137
139
|
}
|
|
138
140
|
// SourceMapSource produces high-quality sourcemaps
|
|
139
141
|
// Final sourcemap will always be available when providing the input sourcemaps
|
|
140
|
-
// tslint:disable-next-line: no-non-null-assertion
|
|
141
142
|
const finalSourceMap = new SourceMapSource(resultCode, filename, resultSourceMap, inputCode, inputSourceMap, true).map();
|
|
142
143
|
return finalSourceMap;
|
|
143
144
|
}
|
|
@@ -146,9 +147,9 @@ async function mergeSourceMapsFast(first, second) {
|
|
|
146
147
|
const generator = new source_map_1.SourceMapGenerator();
|
|
147
148
|
// sourcemap package adds the sourceRoot to all position source paths if not removed
|
|
148
149
|
delete first.sourceRoot;
|
|
149
|
-
await source_map_1.SourceMapConsumer.with(first, null, originalConsumer => {
|
|
150
|
-
return source_map_1.SourceMapConsumer.with(second, null, newConsumer => {
|
|
151
|
-
newConsumer.eachMapping(mapping => {
|
|
150
|
+
await source_map_1.SourceMapConsumer.with(first, null, (originalConsumer) => {
|
|
151
|
+
return source_map_1.SourceMapConsumer.with(second, null, (newConsumer) => {
|
|
152
|
+
newConsumer.eachMapping((mapping) => {
|
|
152
153
|
if (mapping.originalLine === null) {
|
|
153
154
|
return;
|
|
154
155
|
}
|
|
@@ -259,10 +260,10 @@ async function terserMangle(code, options = {}) {
|
|
|
259
260
|
{
|
|
260
261
|
asObject: true,
|
|
261
262
|
// typings don't include asObject option
|
|
262
|
-
//
|
|
263
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
263
264
|
},
|
|
264
265
|
});
|
|
265
|
-
//
|
|
266
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
266
267
|
const outputCode = minifyOutput.code;
|
|
267
268
|
let outputMap;
|
|
268
269
|
if (options.map && minifyOutput.map) {
|
|
@@ -284,11 +285,7 @@ function createFileEntry(filename, code, map, integrityAlgorithm) {
|
|
|
284
285
|
};
|
|
285
286
|
}
|
|
286
287
|
function generateIntegrityValue(hashAlgorithm, code) {
|
|
287
|
-
return
|
|
288
|
-
'-' +
|
|
289
|
-
crypto_1.createHash(hashAlgorithm)
|
|
290
|
-
.update(code)
|
|
291
|
-
.digest('base64'));
|
|
288
|
+
return hashAlgorithm + '-' + crypto_1.createHash(hashAlgorithm).update(code).digest('base64');
|
|
292
289
|
}
|
|
293
290
|
// The webpack runtime chunk is already ES5.
|
|
294
291
|
// However, two variants are still needed due to lazy routing and SRI differences
|
|
@@ -365,26 +362,20 @@ async function createI18nPlugins(locale, translation, missingTranslation, should
|
|
|
365
362
|
const localizeDiag = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/diagnostics'));
|
|
366
363
|
const diagnostics = new localizeDiag.Diagnostics();
|
|
367
364
|
if (shouldInline) {
|
|
368
|
-
const es2015 = await Promise.resolve().then(() => require(
|
|
369
|
-
// tslint:disable-next-line: trailing-comma
|
|
370
|
-
'@angular/localize/src/tools/src/translate/source_files/es2015_translate_plugin'));
|
|
365
|
+
const es2015 = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/translate/source_files/es2015_translate_plugin'));
|
|
371
366
|
plugins.push(
|
|
372
|
-
//
|
|
367
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
373
368
|
es2015.makeEs2015TranslatePlugin(diagnostics, (translation || {}), {
|
|
374
369
|
missingTranslation: translation === undefined ? 'ignore' : missingTranslation,
|
|
375
370
|
}));
|
|
376
|
-
const es5 = await Promise.resolve().then(() => require(
|
|
377
|
-
// tslint:disable-next-line: trailing-comma
|
|
378
|
-
'@angular/localize/src/tools/src/translate/source_files/es5_translate_plugin'));
|
|
371
|
+
const es5 = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/translate/source_files/es5_translate_plugin'));
|
|
379
372
|
plugins.push(
|
|
380
|
-
//
|
|
373
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
381
374
|
es5.makeEs5TranslatePlugin(diagnostics, (translation || {}), {
|
|
382
375
|
missingTranslation: translation === undefined ? 'ignore' : missingTranslation,
|
|
383
376
|
}));
|
|
384
377
|
}
|
|
385
|
-
const inlineLocale = await Promise.resolve().then(() => require(
|
|
386
|
-
// tslint:disable-next-line: trailing-comma
|
|
387
|
-
'@angular/localize/src/tools/src/translate/source_files/locale_plugin'));
|
|
378
|
+
const inlineLocale = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/translate/source_files/locale_plugin'));
|
|
388
379
|
plugins.push(inlineLocale.makeLocalePlugin(locale));
|
|
389
380
|
if (localeDataContent) {
|
|
390
381
|
plugins.push({
|
|
@@ -440,7 +431,7 @@ async function inlineLocales(options) {
|
|
|
440
431
|
const inputMap = options.map && JSON.parse(options.map);
|
|
441
432
|
for (const locale of i18n.inlineLocales) {
|
|
442
433
|
const isSourceLocale = locale === i18n.sourceLocale;
|
|
443
|
-
//
|
|
434
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
444
435
|
const translations = isSourceLocale ? {} : i18n.locales[locale].translation || {};
|
|
445
436
|
let localeDataContent;
|
|
446
437
|
if (options.setLocale) {
|
|
@@ -455,7 +446,7 @@ async function inlineLocales(options) {
|
|
|
455
446
|
filename: options.filename,
|
|
456
447
|
// using false ensures that babel will NOT search and process sourcemap comments (large memory usage)
|
|
457
448
|
// The types do not include the false option even though it is valid
|
|
458
|
-
//
|
|
449
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
459
450
|
inputSourceMap: false,
|
|
460
451
|
babelrc: false,
|
|
461
452
|
configFile: false,
|
|
@@ -497,11 +488,11 @@ async function inlineLocalesDirect(ast, options) {
|
|
|
497
488
|
}
|
|
498
489
|
for (const locale of i18n.inlineLocales) {
|
|
499
490
|
const content = new ReplaceSource(inputMap
|
|
500
|
-
? //
|
|
491
|
+
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
501
492
|
new SourceMapSource(options.code, options.filename, inputMap)
|
|
502
493
|
: new OriginalSource(options.code, options.filename));
|
|
503
494
|
const isSourceLocale = locale === i18n.sourceLocale;
|
|
504
|
-
//
|
|
495
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
505
496
|
const translations = isSourceLocale ? {} : i18n.locales[locale].translation || {};
|
|
506
497
|
for (const position of positions) {
|
|
507
498
|
const translated = utils.translate(diagnostics, translations, position.messageParts, position.expressions, isSourceLocale ? 'ignore' : options.missingTranslation || 'warning');
|
|
@@ -520,8 +511,8 @@ async function inlineLocalesDirect(ast, options) {
|
|
|
520
511
|
localeDataSource = new OriginalSource(localeDataContent, path.basename(localeDataPath));
|
|
521
512
|
}
|
|
522
513
|
outputSource = localeDataSource
|
|
523
|
-
// The semicolon ensures that there is no syntax error between statements
|
|
524
|
-
|
|
514
|
+
? // The semicolon ensures that there is no syntax error between statements
|
|
515
|
+
new ConcatSource(setLocaleText, localeDataSource, ';\n', content)
|
|
525
516
|
: new ConcatSource(setLocaleText, content);
|
|
526
517
|
}
|
|
527
518
|
const { source: outputCode, map: outputMap } = outputSource.sourceAndMap();
|
|
@@ -564,9 +555,9 @@ function findLocalizePositions(ast, options, utils) {
|
|
|
564
555
|
utils.isGlobalIdentifier(callee)) {
|
|
565
556
|
const [messageParts, expressions] = unwrapLocalizeCall(path, utils);
|
|
566
557
|
positions.push({
|
|
567
|
-
//
|
|
558
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
568
559
|
start: path.node.start,
|
|
569
|
-
//
|
|
560
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
570
561
|
end: path.node.end,
|
|
571
562
|
messageParts,
|
|
572
563
|
expressions,
|
|
@@ -581,9 +572,9 @@ function findLocalizePositions(ast, options, utils) {
|
|
|
581
572
|
if (core_1.types.isIdentifier(path.node.tag) && path.node.tag.name === localizeName) {
|
|
582
573
|
const [messageParts, expressions] = unwrapTemplateLiteral(path, utils);
|
|
583
574
|
positions.push({
|
|
584
|
-
//
|
|
575
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
585
576
|
start: path.node.start,
|
|
586
|
-
//
|
|
577
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
587
578
|
end: path.node.end,
|
|
588
579
|
messageParts,
|
|
589
580
|
expressions,
|
|
@@ -611,7 +602,7 @@ async function loadLocaleData(path, optimize, es5) {
|
|
|
611
602
|
const transformResult = await core_1.transformAsync(content, {
|
|
612
603
|
filename: path,
|
|
613
604
|
// The types do not include the false option even though it is valid
|
|
614
|
-
//
|
|
605
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
615
606
|
inputSourceMap: false,
|
|
616
607
|
babelrc: false,
|
|
617
608
|
configFile: false,
|
|
@@ -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
|
|
@@ -17,9 +17,7 @@ const path = require("path");
|
|
|
17
17
|
* it will resolve 'tsconfigPath' from this path.
|
|
18
18
|
*/
|
|
19
19
|
function readTsconfig(tsconfigPath, workspaceRoot) {
|
|
20
|
-
const tsConfigFullPath = workspaceRoot
|
|
21
|
-
? path.resolve(workspaceRoot, tsconfigPath)
|
|
22
|
-
: tsconfigPath;
|
|
20
|
+
const tsConfigFullPath = workspaceRoot ? path.resolve(workspaceRoot, tsconfigPath) : tsconfigPath;
|
|
23
21
|
// We use 'ng' instead of 'ts' here because 'ts' is not aware of 'angularCompilerOptions'
|
|
24
22
|
// and will not merged them if they are at un upper level tsconfig file when using `extends`.
|
|
25
23
|
const ng = require('@angular/compiler-cli');
|
|
@@ -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.runModuleAsObservableFork = void 0;
|
|
4
11
|
const child_process_1 = require("child_process");
|
|
@@ -6,9 +13,9 @@ const path_1 = require("path");
|
|
|
6
13
|
const rxjs_1 = require("rxjs");
|
|
7
14
|
const treeKill = require('tree-kill');
|
|
8
15
|
function runModuleAsObservableFork(cwd, modulePath, exportName,
|
|
9
|
-
//
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
17
|
args) {
|
|
11
|
-
return new rxjs_1.Observable(obs => {
|
|
18
|
+
return new rxjs_1.Observable((obs) => {
|
|
12
19
|
const workerPath = path_1.resolve(__dirname, './run-module-worker.js');
|
|
13
20
|
const debugArgRegex = /--inspect(?:-brk|-port)?|--debug(?:-brk|-port)/;
|
|
14
21
|
const execArgv = process.execArgv.filter((arg) => {
|
|
@@ -1,11 +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
|
-
|
|
9
8
|
process.on('message', (message) => {
|
|
10
9
|
// Only process messages with the hash in 'run-module-as-observable-fork.ts'.
|
|
11
10
|
if (message.hash === '5d4b9a5c0a4e0f9977598437b0e85bcc') {
|
|
@@ -17,4 +16,3 @@ process.on('message', (message) => {
|
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
});
|
|
20
|
-
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.augmentAppWithServiceWorker = 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.augmentAppWithServiceWorker = void 0;
|
|
11
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
12
|
const crypto = require("crypto");
|
|
13
13
|
const fs_1 = require("fs");
|
package/src/utils/spinner.d.ts
CHANGED
package/src/utils/spinner.js
CHANGED
package/src/utils/strip-bom.d.ts
CHANGED