@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/README.md
CHANGED
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This package contains [Architect builders](/packages/angular_devkit/architect/README.md) used to build and test Angular applications and libraries.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
## Builders
|
|
6
|
+
|
|
7
|
+
| Name | Description |
|
|
8
|
+
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
9
|
+
| app-shell | Build an Angular [App shell](https://angular.io/guide/app-shell). |
|
|
10
|
+
| browser | Build an Angular application targeting a browser environment. |
|
|
11
|
+
| dev-server | A development server that provides live reloading. |
|
|
12
|
+
| extract-i18n | Extract i18n messages from an Angular application. |
|
|
13
|
+
| karma | Execute unit tests using [Karma](https://github.com/karma-runner/karma) test runner. |
|
|
14
|
+
| ng-packagr | Build and package an Angular library in [Angular Package Format (APF)](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview) format using [ng-packagr](https://github.com/ng-packagr/ng-packagr). |
|
|
15
|
+
| server | Build an Angular application targeting a [Node.js](https://nodejs.org) environment. |
|
|
16
|
+
| protractor | Run end-to-end tests using [Protractor](https://www.protractortest.org/) framework. |
|
|
17
|
+
| tslint | **Deprecated** - Statically analyze [TypeScript](https://www.typescriptlang.org/) files using [TSLint](https://palantir.github.io/tslint/). |
|
|
17
18
|
|
|
18
19
|
## Disclaimer
|
|
19
20
|
|
|
20
|
-
While the builders when executed via the Angular CLI and their associated options are considered stable, the programmatic APIs are not considered officially supported and are not subject to the breaking change guarantees of SemVer.
|
|
21
|
+
While the builders when executed via the Angular CLI and their associated options are considered stable, the programmatic APIs are not considered officially supported and are not subject to the breaking change guarantees of SemVer.
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "12.0.0
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Angular Webpack Build Facade",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
7
7
|
"builders": "builders.json",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@angular-devkit/architect": "0.1200.0
|
|
10
|
-
"@angular-devkit/build-optimizer": "0.1200.0
|
|
11
|
-
"@angular-devkit/build-webpack": "0.1200.0
|
|
12
|
-
"@angular-devkit/core": "12.0.0
|
|
13
|
-
"@babel/core": "7.
|
|
14
|
-
"@babel/generator": "7.
|
|
9
|
+
"@angular-devkit/architect": "0.1200.0",
|
|
10
|
+
"@angular-devkit/build-optimizer": "0.1200.0",
|
|
11
|
+
"@angular-devkit/build-webpack": "0.1200.0",
|
|
12
|
+
"@angular-devkit/core": "12.0.0",
|
|
13
|
+
"@babel/core": "7.14.0",
|
|
14
|
+
"@babel/generator": "7.14.1",
|
|
15
15
|
"@babel/plugin-transform-async-to-generator": "7.13.0",
|
|
16
|
-
"@babel/plugin-transform-runtime": "7.13.
|
|
17
|
-
"@babel/preset-env": "7.
|
|
18
|
-
"@babel/runtime": "7.
|
|
16
|
+
"@babel/plugin-transform-runtime": "7.13.15",
|
|
17
|
+
"@babel/preset-env": "7.14.1",
|
|
18
|
+
"@babel/runtime": "7.14.0",
|
|
19
19
|
"@babel/template": "7.12.13",
|
|
20
20
|
"@discoveryjs/json-ext": "0.5.2",
|
|
21
21
|
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
|
|
22
|
-
"@ngtools/webpack": "12.0.0
|
|
22
|
+
"@ngtools/webpack": "12.0.0",
|
|
23
23
|
"ansi-colors": "4.1.1",
|
|
24
24
|
"babel-loader": "8.2.2",
|
|
25
25
|
"browserslist": "^4.9.1",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"caniuse-lite": "^1.0.30001032",
|
|
28
28
|
"circular-dependency-plugin": "5.2.2",
|
|
29
29
|
"copy-webpack-plugin": "8.1.1",
|
|
30
|
-
"core-js": "3.
|
|
30
|
+
"core-js": "3.12.0",
|
|
31
31
|
"critters": "0.0.10",
|
|
32
32
|
"css-loader": "5.2.4",
|
|
33
|
-
"cssnano": "5.0.
|
|
33
|
+
"cssnano": "5.0.2",
|
|
34
34
|
"find-cache-dir": "3.3.1",
|
|
35
|
-
"glob": "7.1.
|
|
35
|
+
"glob": "7.1.7",
|
|
36
36
|
"https-proxy-agent": "5.0.0",
|
|
37
37
|
"inquirer": "8.0.0",
|
|
38
38
|
"jest-worker": "26.6.2",
|
|
@@ -41,34 +41,34 @@
|
|
|
41
41
|
"less-loader": "8.1.1",
|
|
42
42
|
"license-webpack-plugin": "2.3.17",
|
|
43
43
|
"loader-utils": "2.0.0",
|
|
44
|
-
"mini-css-extract-plugin": "1.5.
|
|
44
|
+
"mini-css-extract-plugin": "1.5.1",
|
|
45
45
|
"minimatch": "3.0.4",
|
|
46
|
-
"open": "8.0.
|
|
46
|
+
"open": "8.0.7",
|
|
47
47
|
"ora": "5.4.0",
|
|
48
48
|
"parse5-html-rewriting-stream": "6.0.1",
|
|
49
|
-
"postcss": "8.2.
|
|
49
|
+
"postcss": "8.2.14",
|
|
50
50
|
"postcss-import": "14.0.1",
|
|
51
51
|
"postcss-loader": "5.2.0",
|
|
52
52
|
"postcss-preset-env": "6.7.0",
|
|
53
53
|
"raw-loader": "4.0.2",
|
|
54
54
|
"regenerator-runtime": "0.13.7",
|
|
55
|
-
"resolve-url-loader": "
|
|
55
|
+
"resolve-url-loader": "4.0.0",
|
|
56
56
|
"rimraf": "3.0.2",
|
|
57
57
|
"rxjs": "6.6.7",
|
|
58
|
-
"sass": "1.32.
|
|
58
|
+
"sass": "1.32.12",
|
|
59
59
|
"sass-loader": "11.0.1",
|
|
60
60
|
"semver": "7.3.5",
|
|
61
61
|
"source-map": "0.7.3",
|
|
62
|
-
"source-map-loader": "
|
|
62
|
+
"source-map-loader": "2.0.1",
|
|
63
63
|
"source-map-support": "0.5.19",
|
|
64
64
|
"style-loader": "2.0.0",
|
|
65
65
|
"stylus": "0.54.8",
|
|
66
|
-
"stylus-loader": "
|
|
67
|
-
"terser": "5.
|
|
66
|
+
"stylus-loader": "5.0.0",
|
|
67
|
+
"terser": "5.7.0",
|
|
68
68
|
"terser-webpack-plugin": "4.2.3",
|
|
69
69
|
"text-table": "0.2.0",
|
|
70
70
|
"tree-kill": "1.2.2",
|
|
71
|
-
"webpack": "5.
|
|
71
|
+
"webpack": "5.36.2",
|
|
72
72
|
"webpack-dev-middleware": "4.1.0",
|
|
73
73
|
"webpack-dev-server": "3.11.2",
|
|
74
74
|
"webpack-merge": "5.7.3",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"url": "https://github.com/angular/angular-cli.git"
|
|
121
121
|
},
|
|
122
122
|
"engines": {
|
|
123
|
-
"node": "
|
|
123
|
+
"node": "^12.14.1 || ^14.0.0",
|
|
124
124
|
"npm": "^6.11.0 || ^7.5.6",
|
|
125
125
|
"yarn": ">= 1.13.0"
|
|
126
126
|
},
|
package/plugins/karma.d.ts
CHANGED
package/plugins/karma.js
CHANGED
package/src/app-shell/index.d.ts
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 { JsonObject } from '@angular-devkit/core';
|
|
2
9
|
import { Schema as BuildWebpackAppShellSchema } from './schema';
|
|
3
10
|
declare const _default: import("@angular-devkit/architect/src/internal").Builder<JsonObject & BuildWebpackAppShellSchema>;
|
package/src/app-shell/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6
5
|
*
|
|
7
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8
7
|
* found in the LICENSE file at https://angular.io/license
|
|
9
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const architect_1 = require("@angular-devkit/architect");
|
|
11
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
12
|
const fs = require("fs");
|
|
@@ -43,7 +43,7 @@ async function _renderUniversal(options, context, browserResult, serverResult, s
|
|
|
43
43
|
const browserIndexOutputPath = path.join(outputPath, 'index.html');
|
|
44
44
|
const indexHtml = await fs.promises.readFile(browserIndexOutputPath, 'utf8');
|
|
45
45
|
const serverBundlePath = await _getServerModuleBundlePath(options, context, serverResult, localeDirectory);
|
|
46
|
-
const { AppServerModule, renderModule
|
|
46
|
+
const { AppServerModule, renderModule } = await Promise.resolve().then(() => require(serverBundlePath));
|
|
47
47
|
const renderModuleFn = renderModule;
|
|
48
48
|
if (!(renderModuleFn && AppServerModule)) {
|
|
49
49
|
throw new Error(`renderModule method and/or AppServerModule were not exported from: ${serverBundlePath}.`);
|
|
@@ -59,12 +59,14 @@ async function _renderUniversal(options, context, browserResult, serverResult, s
|
|
|
59
59
|
? path.join(root, options.outputIndexPath)
|
|
60
60
|
: browserIndexOutputPath;
|
|
61
61
|
if (inlineCriticalCssProcessor) {
|
|
62
|
-
const { content, warnings, errors } = await inlineCriticalCssProcessor.process(html, {
|
|
62
|
+
const { content, warnings, errors } = await inlineCriticalCssProcessor.process(html, {
|
|
63
|
+
outputPath,
|
|
64
|
+
});
|
|
63
65
|
html = content;
|
|
64
66
|
if (warnings.length || errors.length) {
|
|
65
67
|
spinner.stop();
|
|
66
|
-
warnings.forEach(m => context.logger.warn(m));
|
|
67
|
-
errors.forEach(m => context.logger.error(m));
|
|
68
|
+
warnings.forEach((m) => context.logger.warn(m));
|
|
69
|
+
errors.forEach((m) => context.logger.error(m));
|
|
68
70
|
spinner.start();
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -85,7 +87,7 @@ async function _getServerModuleBundlePath(options, context, serverResult, browse
|
|
|
85
87
|
throw new Error(`Could not find server output directory: ${outputPath}.`);
|
|
86
88
|
}
|
|
87
89
|
const re = /^main\.(?:[a-zA-Z0-9]{20}\.)?js$/;
|
|
88
|
-
const maybeMain = fs.readdirSync(outputPath).find(x => re.test(x));
|
|
90
|
+
const maybeMain = fs.readdirSync(outputPath).find((x) => re.test(x));
|
|
89
91
|
if (!maybeMain) {
|
|
90
92
|
throw new Error('Could not find the main bundle.');
|
|
91
93
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
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
|
declare module 'babel-loader' {
|
|
9
10
|
type BabelLoaderCustomizer<T> = (
|
|
10
11
|
babel: typeof import('@babel/core'),
|
|
@@ -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
|
export declare type DiagnosticReporter = (type: 'error' | 'warning' | 'info', message: string) => void;
|
|
2
9
|
export interface ApplicationPresetOptions {
|
|
3
10
|
i18n?: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6
5
|
*
|
|
7
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8
7
|
* found in the LICENSE file at https://angular.io/license
|
|
9
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const fs = require("fs");
|
|
11
11
|
const path = require("path");
|
|
12
12
|
function createI18nDiagnostics(reporter) {
|
|
@@ -91,7 +91,7 @@ function default_1(api, options) {
|
|
|
91
91
|
relative: path.relative,
|
|
92
92
|
readFile: fs.readFileSync,
|
|
93
93
|
// Node.JS types don't overlap the Compiler types.
|
|
94
|
-
//
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
95
95
|
},
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
@@ -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
|
declare const _default: any;
|
|
2
9
|
export default _default;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6
5
|
*
|
|
7
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8
7
|
* found in the LICENSE file at https://angular.io/license
|
|
9
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const linker_1 = require("@angular/compiler-cli/linker");
|
|
11
11
|
const babel_loader_1 = require("babel-loader");
|
|
12
12
|
const typescript_1 = require("typescript");
|
|
@@ -53,7 +53,8 @@ exports.default = babel_loader_1.custom(() => {
|
|
|
53
53
|
customOptions.forceES5 = !/\.tsx?$/.test(this.resourcePath);
|
|
54
54
|
}
|
|
55
55
|
else if (esTarget >= typescript_1.ScriptTarget.ES2017) {
|
|
56
|
-
customOptions.forceAsyncTransformation =
|
|
56
|
+
customOptions.forceAsyncTransformation =
|
|
57
|
+
!/[\\\/][_f]?esm2015[\\\/]/.test(this.resourcePath) && source.includes('async');
|
|
57
58
|
}
|
|
58
59
|
shouldProcess || (shouldProcess = customOptions.forceAsyncTransformation || customOptions.forceES5);
|
|
59
60
|
}
|
|
@@ -87,8 +88,8 @@ exports.default = babel_loader_1.custom(() => {
|
|
|
87
88
|
...configuration.options,
|
|
88
89
|
// Workaround for https://github.com/babel/babel-loader/pull/896 is available
|
|
89
90
|
// Delete once the above PR is released
|
|
90
|
-
//
|
|
91
|
-
inputSourceMap:
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
+
inputSourceMap: configuration.options.inputSourceMap || false,
|
|
92
93
|
presets: [
|
|
93
94
|
...(configuration.options.presets || []),
|
|
94
95
|
[
|
package/src/babel-bazel.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
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
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
9
10
|
// Workaround for https://github.com/bazelbuild/rules_nodejs/issues/1033
|
|
10
11
|
// Alternative approach instead of https://github.com/angular/angular/pull/33226
|
|
11
12
|
declare module '@babel/core' {
|
package/src/browser/index.d.ts
CHANGED
package/src/browser/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildWebpackBrowser = exports.getCompilerConfig = exports.getAnalyticsConfig = 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.buildWebpackBrowser = exports.getCompilerConfig = exports.getAnalyticsConfig = void 0;
|
|
11
11
|
const architect_1 = require("@angular-devkit/architect");
|
|
12
12
|
const build_webpack_1 = require("@angular-devkit/build-webpack");
|
|
13
13
|
const core_1 = require("@angular-devkit/core");
|
|
@@ -49,7 +49,9 @@ function getAnalyticsConfig(wco, context) {
|
|
|
49
49
|
}
|
|
50
50
|
// The category is the builder name if it's an angular builder.
|
|
51
51
|
return {
|
|
52
|
-
plugins: [
|
|
52
|
+
plugins: [
|
|
53
|
+
new analytics_1.NgBuildAnalyticsPlugin(wco.projectRoot, context.analytics, category, !!wco.tsConfig.options.enableIvy),
|
|
54
|
+
],
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
return {};
|
|
@@ -67,7 +69,7 @@ async function initialize(options, context, differentialLoadingNeeded, webpackCo
|
|
|
67
69
|
const originalOutputPath = options.outputPath;
|
|
68
70
|
// Assets are processed directly by the builder except when watching
|
|
69
71
|
const adjustedOptions = options.watch ? options : { ...options, assets: [] };
|
|
70
|
-
const { config, projectRoot, projectSourceRoot, i18n, } = await webpack_browser_config_1.generateI18nBrowserWebpackConfigFromContext(adjustedOptions, context, wco => [
|
|
72
|
+
const { config, projectRoot, projectSourceRoot, i18n, } = await webpack_browser_config_1.generateI18nBrowserWebpackConfigFromContext(adjustedOptions, context, (wco) => [
|
|
71
73
|
configs_1.getCommonConfig(wco),
|
|
72
74
|
configs_1.getBrowserConfig(wco),
|
|
73
75
|
configs_1.getStylesConfig(wco),
|
|
@@ -96,7 +98,7 @@ async function initialize(options, context, differentialLoadingNeeded, webpackCo
|
|
|
96
98
|
/**
|
|
97
99
|
* @experimental Direct usage of this function is considered experimental.
|
|
98
100
|
*/
|
|
99
|
-
//
|
|
101
|
+
// eslint-disable-next-line max-lines-per-function
|
|
100
102
|
function buildWebpackBrowser(options, context, transforms = {}) {
|
|
101
103
|
var _a;
|
|
102
104
|
const root = core_1.normalize(context.workspaceRoot);
|
|
@@ -108,8 +110,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
108
110
|
let outputPaths;
|
|
109
111
|
// Check Angular version.
|
|
110
112
|
version_1.assertCompatibleAngularVersion(context.workspaceRoot, context.logger);
|
|
111
|
-
return rxjs_1.from(context.getProjectMetadata(projectName))
|
|
112
|
-
.pipe(operators_1.switchMap(async (projectMetadata) => {
|
|
113
|
+
return rxjs_1.from(context.getProjectMetadata(projectName)).pipe(operators_1.switchMap(async (projectMetadata) => {
|
|
113
114
|
var _a;
|
|
114
115
|
const sysProjectRoot = core_1.getSystemPath(core_1.resolve(core_1.normalize(context.workspaceRoot), core_1.normalize((_a = projectMetadata.root) !== null && _a !== void 0 ? _a : '')));
|
|
115
116
|
const { options: compilerOptions } = read_tsconfig_1.readTsconfig(options.tsConfig, context.workspaceRoot);
|
|
@@ -123,24 +124,25 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
123
124
|
isDifferentialLoadingNeeded,
|
|
124
125
|
target,
|
|
125
126
|
};
|
|
126
|
-
}),
|
|
127
|
-
//
|
|
128
|
-
|
|
127
|
+
}), operators_1.switchMap(
|
|
128
|
+
// eslint-disable-next-line max-lines-per-function
|
|
129
|
+
({ config, projectRoot, projectSourceRoot, i18n, buildBrowserFeatures, isDifferentialLoadingNeeded, target, }) => {
|
|
129
130
|
const normalizedOptimization = utils_1.normalizeOptimization(options.optimization);
|
|
130
131
|
return build_webpack_1.runWebpack(config, context, {
|
|
131
132
|
webpackFactory: require('webpack'),
|
|
132
|
-
logging: transforms.logging ||
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
logging: transforms.logging ||
|
|
134
|
+
((stats, config) => {
|
|
135
|
+
if (options.verbose) {
|
|
136
|
+
context.logger.info(stats.toString(config.stats));
|
|
137
|
+
}
|
|
138
|
+
}),
|
|
137
139
|
}).pipe(
|
|
138
|
-
//
|
|
140
|
+
// eslint-disable-next-line max-lines-per-function
|
|
139
141
|
operators_1.concatMap(async (buildEvent) => {
|
|
140
142
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
141
143
|
const spinner = new spinner_1.Spinner();
|
|
142
144
|
spinner.enabled = options.progress !== false;
|
|
143
|
-
const { success, emittedFiles = [], outputPath: webpackOutputPath
|
|
145
|
+
const { success, emittedFiles = [], outputPath: webpackOutputPath } = buildEvent;
|
|
144
146
|
const webpackRawStats = buildEvent.webpackStats;
|
|
145
147
|
if (!webpackRawStats) {
|
|
146
148
|
throw new Error('Webpack stats build result is required.');
|
|
@@ -172,10 +174,10 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
172
174
|
let noModuleFiles;
|
|
173
175
|
let moduleFiles;
|
|
174
176
|
let files;
|
|
175
|
-
const scriptsEntryPointName = helpers_1.normalizeExtraEntryPoints(options.scripts || [], 'scripts').map(x => x.bundleName);
|
|
177
|
+
const scriptsEntryPointName = helpers_1.normalizeExtraEntryPoints(options.scripts || [], 'scripts').map((x) => x.bundleName);
|
|
176
178
|
if (isDifferentialLoadingNeeded && options.watch) {
|
|
177
179
|
moduleFiles = emittedFiles;
|
|
178
|
-
files = moduleFiles.filter(x => x.extension === '.css' || (x.name && scriptsEntryPointName.includes(x.name)));
|
|
180
|
+
files = moduleFiles.filter((x) => x.extension === '.css' || (x.name && scriptsEntryPointName.includes(x.name)));
|
|
179
181
|
if (i18n.shouldInline) {
|
|
180
182
|
const success = await i18n_inlining_1.i18nInlineEmittedFiles(context, emittedFiles, i18n, baseOutputPath, Array.from(outputPaths.values()), scriptsEntryPointName, webpackOutputPath, target <= typescript_1.ScriptTarget.ES5, options.i18nMissingTranslation);
|
|
181
183
|
if (!success) {
|
|
@@ -231,7 +233,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
231
233
|
}
|
|
232
234
|
seen.add(file.file);
|
|
233
235
|
if (file.name === 'vendor' || (!mainChunkId && file.name === 'main')) {
|
|
234
|
-
//
|
|
236
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
235
237
|
mainChunkId = file.id.toString();
|
|
236
238
|
}
|
|
237
239
|
// All files at this point except ES5 polyfills are module scripts
|
|
@@ -266,7 +268,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
266
268
|
code,
|
|
267
269
|
map,
|
|
268
270
|
// id is always present for non-assets
|
|
269
|
-
//
|
|
271
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
270
272
|
name: file.id,
|
|
271
273
|
runtime: file.file.startsWith('runtime'),
|
|
272
274
|
ignoreOriginal: es5Polyfills,
|
|
@@ -308,7 +310,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
308
310
|
runtimeData: processResults,
|
|
309
311
|
supportedBrowsers: buildBrowserFeatures.supportedBrowsers,
|
|
310
312
|
};
|
|
311
|
-
processResults.push(await Promise.resolve().then(() => require('../utils/process-bundle')).then(m => m.process(runtimeOptions)));
|
|
313
|
+
processResults.push(await Promise.resolve().then(() => require('../utils/process-bundle')).then((m) => m.process(runtimeOptions)));
|
|
312
314
|
}
|
|
313
315
|
spinner.succeed('ES5 bundle generation complete.');
|
|
314
316
|
if (i18n.shouldInline) {
|
|
@@ -373,7 +375,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
373
375
|
glob: '**/*',
|
|
374
376
|
input: webpackOutputPath,
|
|
375
377
|
output: '',
|
|
376
|
-
ignore: [...processedFiles].map(f => path.relative(webpackOutputPath, f)),
|
|
378
|
+
ignore: [...processedFiles].map((f) => path.relative(webpackOutputPath, f)),
|
|
377
379
|
},
|
|
378
380
|
], Array.from(outputPaths.values()), '');
|
|
379
381
|
}
|
|
@@ -404,16 +406,15 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
404
406
|
bundleInfoStats.push(generateBundleInfoStats(result.downlevel, chunk, 'legacy'));
|
|
405
407
|
}
|
|
406
408
|
}
|
|
407
|
-
const unprocessedChunks = ((_b = webpackStats.chunks) === null || _b === void 0 ? void 0 : _b.filter((chunk) => !processResults
|
|
408
|
-
.find((result) => { var _a; return ((_a = chunk.id) === null || _a === void 0 ? void 0 : _a.toString()) === result.name; }))) || [];
|
|
409
|
+
const unprocessedChunks = ((_b = webpackStats.chunks) === null || _b === void 0 ? void 0 : _b.filter((chunk) => !processResults.find((result) => { var _a; return ((_a = chunk.id) === null || _a === void 0 ? void 0 : _a.toString()) === result.name; }))) || [];
|
|
409
410
|
for (const chunk of unprocessedChunks) {
|
|
410
|
-
const asset = (_c = webpackStats.assets) === null || _c === void 0 ? void 0 : _c.find(a => { var _a; return a.name === ((_a = chunk.files) === null || _a === void 0 ? void 0 : _a[0]); });
|
|
411
|
+
const asset = (_c = webpackStats.assets) === null || _c === void 0 ? void 0 : _c.find((a) => { var _a; return a.name === ((_a = chunk.files) === null || _a === void 0 ? void 0 : _a[0]); });
|
|
411
412
|
bundleInfoStats.push(stats_1.generateBundleStats({ ...chunk, size: asset === null || asset === void 0 ? void 0 : asset.size }));
|
|
412
413
|
}
|
|
413
414
|
}
|
|
414
415
|
else {
|
|
415
|
-
files = emittedFiles.filter(x => x.name !== 'polyfills-es5');
|
|
416
|
-
noModuleFiles = emittedFiles.filter(x => x.name === 'polyfills-es5');
|
|
416
|
+
files = emittedFiles.filter((x) => x.name !== 'polyfills-es5');
|
|
417
|
+
noModuleFiles = emittedFiles.filter((x) => x.name === 'polyfills-es5');
|
|
417
418
|
if (i18n.shouldInline) {
|
|
418
419
|
const success = await i18n_inlining_1.i18nInlineEmittedFiles(context, emittedFiles, i18n, baseOutputPath, Array.from(outputPaths.values()), scriptsEntryPointName, webpackOutputPath, target <= typescript_1.ScriptTarget.ES5, options.i18nMissingTranslation);
|
|
419
420
|
if (!success) {
|
|
@@ -482,8 +483,8 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
482
483
|
});
|
|
483
484
|
if (warnings.length || errors.length) {
|
|
484
485
|
spinner.stop();
|
|
485
|
-
warnings.forEach(m => context.logger.warn(m));
|
|
486
|
-
errors.forEach(m => context.logger.error(m));
|
|
486
|
+
warnings.forEach((m) => context.logger.warn(m));
|
|
487
|
+
errors.forEach((m) => context.logger.error(m));
|
|
487
488
|
spinner.start();
|
|
488
489
|
}
|
|
489
490
|
const indexOutput = path.join(outputPath, webpack_browser_config_1.getIndexOutputFile(options.index));
|
|
@@ -514,11 +515,11 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
514
515
|
stats_1.webpackStatsLogger(context.logger, webpackStats, config, bundleInfoStats);
|
|
515
516
|
return { success: buildSuccess };
|
|
516
517
|
}
|
|
517
|
-
}), operators_1.map(event => ({
|
|
518
|
+
}), operators_1.map((event) => ({
|
|
518
519
|
...event,
|
|
519
520
|
baseOutputPath,
|
|
520
521
|
outputPath: baseOutputPath,
|
|
521
|
-
outputPaths: outputPaths && Array.from(outputPaths.values()) || [baseOutputPath],
|
|
522
|
+
outputPaths: (outputPaths && Array.from(outputPaths.values())) || [baseOutputPath],
|
|
522
523
|
})));
|
|
523
524
|
}));
|
|
524
525
|
function getLocaleBaseHref(i18n, locale) {
|
package/src/browser/schema.d.ts
CHANGED
|
@@ -57,10 +57,6 @@ export interface Schema {
|
|
|
57
57
|
* Replace compilation source files with other compilation source files in the build.
|
|
58
58
|
*/
|
|
59
59
|
fileReplacements?: FileReplacement[];
|
|
60
|
-
/**
|
|
61
|
-
* Run the TypeScript type checker in a forked process.
|
|
62
|
-
*/
|
|
63
|
-
forkTypeChecker?: boolean;
|
|
64
60
|
/**
|
|
65
61
|
* How to handle missing translations for i18n.
|
|
66
62
|
*/
|
|
@@ -138,7 +134,7 @@ export interface Schema {
|
|
|
138
134
|
/**
|
|
139
135
|
* Show circular dependency warnings on builds.
|
|
140
136
|
* @deprecated The recommended method to detect circular dependencies in project code is to
|
|
141
|
-
* use
|
|
137
|
+
* use either a lint rule or other external tooling.
|
|
142
138
|
*/
|
|
143
139
|
showCircularDependencies?: boolean;
|
|
144
140
|
/**
|