@angular-devkit/build-angular 12.2.10 → 12.2.11
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 +11 -11
- package/src/babel/webpack-loader.js +7 -1
- package/src/browser/index.js +91 -87
- package/src/dev-server/index.js +3 -0
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "12.2.
|
|
3
|
+
"version": "12.2.11",
|
|
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.1",
|
|
10
|
-
"@angular-devkit/architect": "0.1202.
|
|
11
|
-
"@angular-devkit/build-optimizer": "0.1202.
|
|
12
|
-
"@angular-devkit/build-webpack": "0.1202.
|
|
13
|
-
"@angular-devkit/core": "12.2.
|
|
10
|
+
"@angular-devkit/architect": "0.1202.11",
|
|
11
|
+
"@angular-devkit/build-optimizer": "0.1202.11",
|
|
12
|
+
"@angular-devkit/build-webpack": "0.1202.11",
|
|
13
|
+
"@angular-devkit/core": "12.2.11",
|
|
14
14
|
"@babel/core": "7.14.8",
|
|
15
15
|
"@babel/generator": "7.14.8",
|
|
16
16
|
"@babel/helper-annotate-as-pure": "7.14.5",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@babel/template": "7.14.5",
|
|
23
23
|
"@discoveryjs/json-ext": "0.5.3",
|
|
24
24
|
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
|
|
25
|
-
"@ngtools/webpack": "12.2.
|
|
25
|
+
"@ngtools/webpack": "12.2.11",
|
|
26
26
|
"ansi-colors": "4.1.1",
|
|
27
27
|
"babel-loader": "8.2.2",
|
|
28
28
|
"browserslist": "^4.9.1",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"circular-dependency-plugin": "5.2.2",
|
|
32
32
|
"copy-webpack-plugin": "9.0.1",
|
|
33
33
|
"core-js": "3.16.0",
|
|
34
|
-
"critters": "0.0.
|
|
34
|
+
"critters": "0.0.11",
|
|
35
35
|
"css-loader": "6.2.0",
|
|
36
36
|
"css-minimizer-webpack-plugin": "3.0.2",
|
|
37
|
-
"esbuild-wasm": "0.13.
|
|
37
|
+
"esbuild-wasm": "0.13.8",
|
|
38
38
|
"find-cache-dir": "3.3.1",
|
|
39
39
|
"glob": "7.1.7",
|
|
40
40
|
"https-proxy-agent": "5.0.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"less-loader": "10.0.1",
|
|
45
45
|
"license-webpack-plugin": "2.3.20",
|
|
46
46
|
"loader-utils": "2.0.0",
|
|
47
|
-
"mini-css-extract-plugin": "2.2
|
|
47
|
+
"mini-css-extract-plugin": "2.4.2",
|
|
48
48
|
"minimatch": "3.0.4",
|
|
49
49
|
"open": "8.2.1",
|
|
50
50
|
"ora": "5.4.1",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"webpack-subresource-integrity": "1.5.2"
|
|
78
78
|
},
|
|
79
79
|
"optionalDependencies": {
|
|
80
|
-
"esbuild": "0.13.
|
|
80
|
+
"esbuild": "0.13.8"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@angular/compiler-cli": "^12.0.0",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
},
|
|
127
127
|
"engines": {
|
|
128
128
|
"node": "^12.14.1 || >=14.0.0",
|
|
129
|
-
"npm": "^6.11.0 || ^7.5.6",
|
|
129
|
+
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
130
130
|
"yarn": ">= 1.13.0"
|
|
131
131
|
},
|
|
132
132
|
"author": "Angular Authors",
|
|
@@ -157,7 +157,13 @@ exports.default = babel_loader_1.custom(() => {
|
|
|
157
157
|
// `@ampproject/remapping` source map objects but both are compatible with Webpack.
|
|
158
158
|
// This method for merging is used because it provides more accurate output
|
|
159
159
|
// and is faster while using less memory.
|
|
160
|
-
result.map =
|
|
160
|
+
result.map = {
|
|
161
|
+
// Convert the SourceMap back to simple plain object.
|
|
162
|
+
// This is needed because otherwise code-coverage will fail with `don't know how to turn this value into a node`
|
|
163
|
+
// Which is throw by Babel when it is invoked again from `istanbul-lib-instrument`.
|
|
164
|
+
// https://github.com/babel/babel/blob/780aa48d2a34dc55f556843074b6aed45e7eabeb/packages/babel-types/src/converters/valueToNode.ts#L115-L130
|
|
165
|
+
...remapping_1.default([result.map, inputSourceMap], () => null),
|
|
166
|
+
};
|
|
161
167
|
}
|
|
162
168
|
return result;
|
|
163
169
|
},
|
package/src/browser/index.js
CHANGED
|
@@ -288,106 +288,110 @@ function buildWebpackBrowser(options, context, transforms = {}) {
|
|
|
288
288
|
processActions.push({ replacements: workerReplacements, ...action });
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
const
|
|
291
|
+
const differentialLoadingExecutor = new action_executor_1.BundleActionExecutor({ cachePath: cacheDownlevelPath, i18n }, options.subresourceIntegrity ? 'sha384' : undefined);
|
|
292
292
|
// Execute the bundle processing actions
|
|
293
293
|
try {
|
|
294
294
|
spinner.start('Generating ES5 bundles for differential loading...');
|
|
295
|
-
for await (const result of
|
|
295
|
+
for await (const result of differentialLoadingExecutor.processAll(processActions)) {
|
|
296
296
|
processResults.push(result);
|
|
297
297
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
298
|
+
}
|
|
299
|
+
finally {
|
|
300
|
+
differentialLoadingExecutor.stop();
|
|
301
|
+
}
|
|
302
|
+
// Runtime must be processed after all other files
|
|
303
|
+
if (processRuntimeAction) {
|
|
304
|
+
const runtimeOptions = {
|
|
305
|
+
...processRuntimeAction,
|
|
306
|
+
runtimeData: processResults,
|
|
307
|
+
supportedBrowsers: buildBrowserFeatures.supportedBrowsers,
|
|
308
|
+
};
|
|
309
|
+
processResults.push(await Promise.resolve().then(() => __importStar(require('../utils/process-bundle'))).then((m) => m.process(runtimeOptions)));
|
|
310
|
+
}
|
|
311
|
+
spinner.succeed('ES5 bundle generation complete.');
|
|
312
|
+
if (i18n.shouldInline) {
|
|
313
|
+
spinner.start('Generating localized bundles...');
|
|
314
|
+
const inlineActions = [];
|
|
315
|
+
const processedFiles = new Set();
|
|
316
|
+
for (const result of processResults) {
|
|
317
|
+
if (result.original) {
|
|
318
|
+
inlineActions.push({
|
|
319
|
+
filename: path.basename(result.original.filename),
|
|
320
|
+
code: fs.readFileSync(result.original.filename, 'utf8'),
|
|
321
|
+
map: result.original.map &&
|
|
322
|
+
fs.readFileSync(result.original.map.filename, 'utf8'),
|
|
323
|
+
outputPath: baseOutputPath,
|
|
324
|
+
es5: false,
|
|
325
|
+
missingTranslation: options.i18nMissingTranslation,
|
|
326
|
+
setLocale: result.name === mainChunkId,
|
|
327
|
+
});
|
|
328
|
+
processedFiles.add(result.original.filename);
|
|
329
|
+
if (result.original.map) {
|
|
330
|
+
processedFiles.add(result.original.map.filename);
|
|
328
331
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
332
|
+
}
|
|
333
|
+
if (result.downlevel) {
|
|
334
|
+
inlineActions.push({
|
|
335
|
+
filename: path.basename(result.downlevel.filename),
|
|
336
|
+
code: fs.readFileSync(result.downlevel.filename, 'utf8'),
|
|
337
|
+
map: result.downlevel.map &&
|
|
338
|
+
fs.readFileSync(result.downlevel.map.filename, 'utf8'),
|
|
339
|
+
outputPath: baseOutputPath,
|
|
340
|
+
es5: true,
|
|
341
|
+
missingTranslation: options.i18nMissingTranslation,
|
|
342
|
+
setLocale: result.name === mainChunkId,
|
|
343
|
+
});
|
|
344
|
+
processedFiles.add(result.downlevel.filename);
|
|
345
|
+
if (result.downlevel.map) {
|
|
346
|
+
processedFiles.add(result.downlevel.map.filename);
|
|
344
347
|
}
|
|
345
348
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
}
|
|
350
|
+
let hasErrors = false;
|
|
351
|
+
const i18nExecutor = new action_executor_1.BundleActionExecutor({ i18n }, options.subresourceIntegrity ? 'sha384' : undefined);
|
|
352
|
+
try {
|
|
353
|
+
for await (const result of i18nExecutor.inlineAll(inlineActions)) {
|
|
354
|
+
if (options.verbose) {
|
|
355
|
+
context.logger.info(`Localized "${result.file}" [${result.count} translation(s)].`);
|
|
356
|
+
}
|
|
357
|
+
for (const diagnostic of result.diagnostics) {
|
|
358
|
+
spinner.stop();
|
|
359
|
+
if (diagnostic.type === 'error') {
|
|
360
|
+
hasErrors = true;
|
|
361
|
+
context.logger.error(diagnostic.message);
|
|
351
362
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
if (diagnostic.type === 'error') {
|
|
355
|
-
hasErrors = true;
|
|
356
|
-
context.logger.error(diagnostic.message);
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
context.logger.warn(diagnostic.message);
|
|
360
|
-
}
|
|
361
|
-
spinner.start();
|
|
363
|
+
else {
|
|
364
|
+
context.logger.warn(diagnostic.message);
|
|
362
365
|
}
|
|
366
|
+
spinner.start();
|
|
363
367
|
}
|
|
364
|
-
// Copy any non-processed files into the output locations
|
|
365
|
-
await copy_assets_1.copyAssets([
|
|
366
|
-
{
|
|
367
|
-
glob: '**/*',
|
|
368
|
-
input: webpackOutputPath,
|
|
369
|
-
output: '',
|
|
370
|
-
ignore: [...processedFiles].map((f) => path.relative(webpackOutputPath, f)),
|
|
371
|
-
},
|
|
372
|
-
], Array.from(outputPaths.values()), '');
|
|
373
|
-
}
|
|
374
|
-
catch (err) {
|
|
375
|
-
spinner.fail('Localized bundle generation failed.');
|
|
376
|
-
return { success: false, error: mapErrorToMessage(err) };
|
|
377
|
-
}
|
|
378
|
-
if (hasErrors) {
|
|
379
|
-
spinner.fail('Localized bundle generation failed.');
|
|
380
|
-
}
|
|
381
|
-
else {
|
|
382
|
-
spinner.succeed('Localized bundle generation complete.');
|
|
383
|
-
}
|
|
384
|
-
if (hasErrors) {
|
|
385
|
-
return { success: false };
|
|
386
368
|
}
|
|
369
|
+
// Copy any non-processed files into the output locations
|
|
370
|
+
await copy_assets_1.copyAssets([
|
|
371
|
+
{
|
|
372
|
+
glob: '**/*',
|
|
373
|
+
input: webpackOutputPath,
|
|
374
|
+
output: '',
|
|
375
|
+
ignore: [...processedFiles].map((f) => path.relative(webpackOutputPath, f)),
|
|
376
|
+
},
|
|
377
|
+
], Array.from(outputPaths.values()), '');
|
|
378
|
+
}
|
|
379
|
+
catch (err) {
|
|
380
|
+
spinner.fail('Localized bundle generation failed.');
|
|
381
|
+
return { success: false, error: mapErrorToMessage(err) };
|
|
382
|
+
}
|
|
383
|
+
finally {
|
|
384
|
+
i18nExecutor.stop();
|
|
385
|
+
}
|
|
386
|
+
if (hasErrors) {
|
|
387
|
+
spinner.fail('Localized bundle generation failed.');
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
spinner.succeed('Localized bundle generation complete.');
|
|
391
|
+
}
|
|
392
|
+
if (hasErrors) {
|
|
393
|
+
return { success: false };
|
|
387
394
|
}
|
|
388
|
-
}
|
|
389
|
-
finally {
|
|
390
|
-
executor.stop();
|
|
391
395
|
}
|
|
392
396
|
for (const result of processResults) {
|
|
393
397
|
const chunk = (_a = webpackStats.chunks) === null || _a === void 0 ? void 0 : _a.find((chunk) => { var _a; return ((_a = chunk.id) === null || _a === void 0 ? void 0 : _a.toString()) === result.name; });
|
package/src/dev-server/index.js
CHANGED
|
@@ -274,6 +274,9 @@ function serveWebpackBrowser(options, context, transforms = {}) {
|
|
|
274
274
|
if (buildEvent.success) {
|
|
275
275
|
logger.info(`\n${color_1.colors.greenBright(color_1.colors.symbols.check)} Compiled successfully.`);
|
|
276
276
|
}
|
|
277
|
+
else {
|
|
278
|
+
logger.info(`\n${color_1.colors.redBright(color_1.colors.symbols.cross)} Failed to compile.`);
|
|
279
|
+
}
|
|
277
280
|
return { ...buildEvent, baseUrl: serverAddress };
|
|
278
281
|
}));
|
|
279
282
|
}));
|