@angular-devkit/build-angular 13.2.0-next.2 → 13.2.0-rc.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/package.json +14 -14
- package/src/utils/i18n-options.js +6 -4
- package/src/webpack/configs/common.js +8 -8
- package/src/webpack/configs/styles.js +6 -3
- package/src/webpack/plugins/any-component-style-budget-checker.js +4 -0
- package/src/webpack/plugins/javascript-optimizer-plugin.js +3 -3
- package/src/webpack/plugins/javascript-optimizer-worker.d.ts +1 -1
- package/src/webpack/plugins/javascript-optimizer-worker.js +3 -1
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "13.2.0-
|
|
3
|
+
"version": "13.2.0-rc.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
9
|
"@ampproject/remapping": "1.0.2",
|
|
10
|
-
"@angular-devkit/architect": "0.1302.0-
|
|
11
|
-
"@angular-devkit/build-webpack": "0.1302.0-
|
|
12
|
-
"@angular-devkit/core": "13.2.0-
|
|
10
|
+
"@angular-devkit/architect": "0.1302.0-rc.0",
|
|
11
|
+
"@angular-devkit/build-webpack": "0.1302.0-rc.0",
|
|
12
|
+
"@angular-devkit/core": "13.2.0-rc.0",
|
|
13
13
|
"@babel/core": "7.16.7",
|
|
14
14
|
"@babel/generator": "7.16.8",
|
|
15
15
|
"@babel/helper-annotate-as-pure": "7.16.7",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@babel/runtime": "7.16.7",
|
|
21
21
|
"@babel/template": "7.16.7",
|
|
22
22
|
"@discoveryjs/json-ext": "0.5.6",
|
|
23
|
-
"@ngtools/webpack": "13.2.0-
|
|
23
|
+
"@ngtools/webpack": "13.2.0-rc.0",
|
|
24
24
|
"ansi-colors": "4.1.1",
|
|
25
25
|
"babel-loader": "8.2.3",
|
|
26
26
|
"babel-plugin-istanbul": "6.1.1",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"cacache": "15.3.0",
|
|
29
29
|
"circular-dependency-plugin": "5.2.2",
|
|
30
30
|
"copy-webpack-plugin": "10.2.0",
|
|
31
|
-
"core-js": "3.20.
|
|
31
|
+
"core-js": "3.20.3",
|
|
32
32
|
"critters": "0.0.16",
|
|
33
33
|
"css-loader": "6.5.1",
|
|
34
34
|
"esbuild-wasm": "0.14.11",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"less-loader": "10.2.0",
|
|
42
42
|
"license-webpack-plugin": "4.0.0",
|
|
43
43
|
"loader-utils": "3.2.0",
|
|
44
|
-
"mini-css-extract-plugin": "2.
|
|
44
|
+
"mini-css-extract-plugin": "2.5.2",
|
|
45
45
|
"minimatch": "3.0.4",
|
|
46
46
|
"open": "8.4.0",
|
|
47
47
|
"ora": "5.4.1",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"postcss-loader": "6.2.1",
|
|
53
53
|
"postcss-preset-env": "7.2.3",
|
|
54
54
|
"regenerator-runtime": "0.13.9",
|
|
55
|
-
"resolve-url-loader": "
|
|
55
|
+
"resolve-url-loader": "5.0.0",
|
|
56
56
|
"rxjs": "6.6.7",
|
|
57
|
-
"sass": "1.
|
|
57
|
+
"sass": "1.49.0",
|
|
58
58
|
"sass-loader": "12.4.0",
|
|
59
59
|
"semver": "7.3.5",
|
|
60
60
|
"source-map-loader": "3.0.1",
|
|
@@ -69,17 +69,17 @@
|
|
|
69
69
|
"webpack-dev-middleware": "5.3.0",
|
|
70
70
|
"webpack-dev-server": "4.7.3",
|
|
71
71
|
"webpack-merge": "5.8.0",
|
|
72
|
-
"webpack-subresource-integrity": "5.
|
|
72
|
+
"webpack-subresource-integrity": "5.1.0"
|
|
73
73
|
},
|
|
74
74
|
"optionalDependencies": {
|
|
75
75
|
"esbuild": "0.14.11"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@angular/compiler-cli": "^13.0.0 || ^13.
|
|
79
|
-
"@angular/localize": "^13.0.0 || ^13.
|
|
80
|
-
"@angular/service-worker": "^13.0.0 || ^13.
|
|
78
|
+
"@angular/compiler-cli": "^13.0.0 || ^13.2.0-next",
|
|
79
|
+
"@angular/localize": "^13.0.0 || ^13.2.0-next",
|
|
80
|
+
"@angular/service-worker": "^13.0.0 || ^13.2.0-next",
|
|
81
81
|
"karma": "^6.3.0",
|
|
82
|
-
"ng-packagr": "^13.0.0 || ^13.
|
|
82
|
+
"ng-packagr": "^13.0.0 || ^13.2.0-next",
|
|
83
83
|
"protractor": "^7.0.0",
|
|
84
84
|
"tailwindcss": "^2.0.0 || ^3.0.0",
|
|
85
85
|
"typescript": ">=4.4.3 <4.6"
|
|
@@ -216,6 +216,7 @@ function deleteTempDirectory(tempPath) {
|
|
|
216
216
|
catch { }
|
|
217
217
|
}
|
|
218
218
|
function loadTranslations(locale, desc, workspaceRoot, loader, logger, usedFormats, duplicateTranslation) {
|
|
219
|
+
let translations = undefined;
|
|
219
220
|
for (const file of desc.files) {
|
|
220
221
|
const loadResult = loader(path_1.default.join(workspaceRoot, file.path));
|
|
221
222
|
for (const diagnostics of loadResult.diagnostics.messages) {
|
|
@@ -232,10 +233,10 @@ function loadTranslations(locale, desc, workspaceRoot, loader, logger, usedForma
|
|
|
232
233
|
usedFormats === null || usedFormats === void 0 ? void 0 : usedFormats.add(loadResult.format);
|
|
233
234
|
file.format = loadResult.format;
|
|
234
235
|
file.integrity = loadResult.integrity;
|
|
235
|
-
if (
|
|
236
|
+
if (translations) {
|
|
236
237
|
// Merge translations
|
|
237
238
|
for (const [id, message] of Object.entries(loadResult.translations)) {
|
|
238
|
-
if (
|
|
239
|
+
if (translations[id] !== undefined) {
|
|
239
240
|
const duplicateTranslationMessage = `[${file.path}]: Duplicate translations for message '${id}' when merging.`;
|
|
240
241
|
switch (duplicateTranslation) {
|
|
241
242
|
case schema_1.I18NTranslation.Ignore:
|
|
@@ -249,13 +250,14 @@ function loadTranslations(locale, desc, workspaceRoot, loader, logger, usedForma
|
|
|
249
250
|
break;
|
|
250
251
|
}
|
|
251
252
|
}
|
|
252
|
-
|
|
253
|
+
translations[id] = message;
|
|
253
254
|
}
|
|
254
255
|
}
|
|
255
256
|
else {
|
|
256
257
|
// First or only translation file
|
|
257
|
-
|
|
258
|
+
translations = loadResult.translations;
|
|
258
259
|
}
|
|
259
260
|
}
|
|
261
|
+
desc.translation = translations;
|
|
260
262
|
}
|
|
261
263
|
exports.loadTranslations = loadTranslations;
|
|
@@ -272,14 +272,14 @@ async function getCommonConfig(wco) {
|
|
|
272
272
|
module: {
|
|
273
273
|
// Show an error for missing exports instead of a warning.
|
|
274
274
|
strictExportPresence: true,
|
|
275
|
-
parser:
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
|
|
275
|
+
parser: {
|
|
276
|
+
javascript: {
|
|
277
|
+
// Disable auto URL asset module creation. This doesn't effect `new Worker(new URL(...))`
|
|
278
|
+
// https://webpack.js.org/guides/asset-modules/#url-assets
|
|
279
|
+
url: false,
|
|
280
|
+
worker: !!webWorkerTsConfig,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
283
|
rules: [
|
|
284
284
|
{
|
|
285
285
|
test: /\.?(svg|html)$/,
|
|
@@ -25,9 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
__setModuleDefault(result, mod);
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
28
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
32
|
exports.getStylesConfig = void 0;
|
|
30
33
|
const fs = __importStar(require("fs"));
|
|
34
|
+
const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
|
|
31
35
|
const path = __importStar(require("path"));
|
|
32
36
|
const sass_service_1 = require("../../sass/sass-service");
|
|
33
37
|
const plugins_1 = require("../plugins");
|
|
@@ -70,7 +74,6 @@ function resolveGlobalStyles(styleEntrypoints, root, preserveSymlinks) {
|
|
|
70
74
|
// eslint-disable-next-line max-lines-per-function
|
|
71
75
|
function getStylesConfig(wco) {
|
|
72
76
|
var _a, _b, _c;
|
|
73
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
74
77
|
const postcssImports = require('postcss-import');
|
|
75
78
|
const postcssPresetEnv = require('postcss-preset-env');
|
|
76
79
|
const { root, buildOptions } = wco;
|
|
@@ -188,7 +191,7 @@ function getStylesConfig(wco) {
|
|
|
188
191
|
// for component css.
|
|
189
192
|
!buildOptions.sourceMap.hidden);
|
|
190
193
|
// extract global css from js files into own css file.
|
|
191
|
-
extraPlugins.push(new
|
|
194
|
+
extraPlugins.push(new mini_css_extract_plugin_1.default({ filename: `[name]${hashFormat.extract}.css` }));
|
|
192
195
|
if (!buildOptions.hmr) {
|
|
193
196
|
// don't remove `.js` files for `.css` when we are using HMR these contain HMR accept codes.
|
|
194
197
|
// suppress empty .js files in css only entry points.
|
|
@@ -207,7 +210,7 @@ function getStylesConfig(wco) {
|
|
|
207
210
|
];
|
|
208
211
|
const globalStyleLoaders = [
|
|
209
212
|
{
|
|
210
|
-
loader:
|
|
213
|
+
loader: mini_css_extract_plugin_1.default.loader,
|
|
211
214
|
},
|
|
212
215
|
{
|
|
213
216
|
loader: require.resolve('css-loader'),
|
|
@@ -47,6 +47,10 @@ class AnyComponentStyleBudgetChecker {
|
|
|
47
47
|
name: PLUGIN_NAME,
|
|
48
48
|
stage: webpack_1.Compilation.PROCESS_ASSETS_STAGE_ANALYSE,
|
|
49
49
|
}, () => {
|
|
50
|
+
// No budgets.
|
|
51
|
+
if (this.budgets.length === 0) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
50
54
|
// In AOT compilations component styles get processed in child compilations.
|
|
51
55
|
if (!compilation.compiler.parentCompilation) {
|
|
52
56
|
return;
|
|
@@ -91,11 +91,11 @@ class JavaScriptOptimizerPlugin {
|
|
|
91
91
|
if (this.options.target <= typescript_1.ScriptTarget.ES5) {
|
|
92
92
|
target = 5;
|
|
93
93
|
}
|
|
94
|
-
else if (this.options.target
|
|
95
|
-
target =
|
|
94
|
+
else if (this.options.target === typescript_1.ScriptTarget.ESNext) {
|
|
95
|
+
target = 'next';
|
|
96
96
|
}
|
|
97
97
|
else {
|
|
98
|
-
target =
|
|
98
|
+
target = Number(typescript_1.ScriptTarget[this.options.target].slice(2));
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
// Setup the options used by all worker tasks
|
|
@@ -41,7 +41,7 @@ export interface OptimizeRequestOptions {
|
|
|
41
41
|
/**
|
|
42
42
|
* Specifies the target ECMAScript version for the output code.
|
|
43
43
|
*/
|
|
44
|
-
target: 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020;
|
|
44
|
+
target: 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 'next';
|
|
45
45
|
/**
|
|
46
46
|
* Controls whether esbuild should only use the WASM-variant instead of trying to
|
|
47
47
|
* use the native variant. Some platforms may not support the native-variant and
|
|
@@ -26,7 +26,9 @@ async function default_1({ asset, options }) {
|
|
|
26
26
|
// esbuild is used as a first pass
|
|
27
27
|
const esbuildResult = await optimizeWithEsbuild(asset.code, asset.name, options);
|
|
28
28
|
// terser is used as a second pass
|
|
29
|
-
const terserResult = await optimizeWithTerser(asset.name, esbuildResult.code, options.sourcemap,
|
|
29
|
+
const terserResult = await optimizeWithTerser(asset.name, esbuildResult.code, options.sourcemap,
|
|
30
|
+
// Terser only supports up to ES2020.
|
|
31
|
+
options.target === 'next' ? 2020 : options.target, options.advanced);
|
|
30
32
|
// Merge intermediate sourcemaps with input sourcemap if enabled
|
|
31
33
|
let fullSourcemap;
|
|
32
34
|
if (options.sourcemap) {
|