@angular-devkit/build-angular 12.2.1 → 12.2.2

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 CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "12.2.1",
3
+ "version": "12.2.2",
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.1",
11
- "@angular-devkit/build-optimizer": "0.1202.1",
12
- "@angular-devkit/build-webpack": "0.1202.1",
13
- "@angular-devkit/core": "12.2.1",
10
+ "@angular-devkit/architect": "0.1202.2",
11
+ "@angular-devkit/build-optimizer": "0.1202.2",
12
+ "@angular-devkit/build-webpack": "0.1202.2",
13
+ "@angular-devkit/core": "12.2.2",
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.1",
25
+ "@ngtools/webpack": "12.2.2",
26
26
  "ansi-colors": "4.1.1",
27
27
  "babel-loader": "8.2.2",
28
28
  "browserslist": "^4.9.1",
@@ -77,11 +77,11 @@
77
77
  "webpack-subresource-integrity": "1.5.2"
78
78
  },
79
79
  "peerDependencies": {
80
- "@angular/compiler-cli": "^12.0.0 || ^12.2.0-next",
81
- "@angular/localize": "^12.0.0 || ^12.2.0-next",
82
- "@angular/service-worker": "^12.0.0 || ^12.2.0-next",
80
+ "@angular/compiler-cli": "^12.0.0",
81
+ "@angular/localize": "^12.0.0",
82
+ "@angular/service-worker": "^12.0.0",
83
83
  "karma": "^6.3.0",
84
- "ng-packagr": "^12.0.0 || ^12.1.0-next",
84
+ "ng-packagr": "^12.0.0",
85
85
  "protractor": "^7.0.0",
86
86
  "tailwindcss": "^2.0.0",
87
87
  "tslint": "^6.1.0",
@@ -261,6 +261,7 @@ function getStylesConfig(wco) {
261
261
  ],
262
262
  };
263
263
  const globalBundlesRegExp = new RegExp(`^(${Object.keys(entryPoints).join('|')})(\.[0-9a-f]{20})?.css$`);
264
+ const target = transformSupportedBrowsersToTargets(supportedBrowsers);
264
265
  extraMinimizers.push(
265
266
  // Component styles use esbuild which is faster and generates smaller files on average.
266
267
  // esbuild does not yet support style sourcemaps but component style sourcemaps are not
@@ -276,6 +277,7 @@ function getStylesConfig(wco) {
276
277
  loader: 'css',
277
278
  minify: true,
278
279
  sourcefile,
280
+ target,
279
281
  });
280
282
  return {
281
283
  code,
@@ -432,3 +434,15 @@ function getStylesConfig(wco) {
432
434
  };
433
435
  }
434
436
  exports.getStylesConfig = getStylesConfig;
437
+ function transformSupportedBrowsersToTargets(supportedBrowsers) {
438
+ const transformed = [];
439
+ // https://esbuild.github.io/api/#target
440
+ const esBuildSupportedBrowsers = new Set(['safari', 'firefox', 'edge', 'chrome', 'ios']);
441
+ for (const browser of supportedBrowsers) {
442
+ const [browserName, version] = browser.split(' ');
443
+ if (esBuildSupportedBrowsers.has(browserName)) {
444
+ transformed.push(browserName + version);
445
+ }
446
+ }
447
+ return transformed.length ? transformed : undefined;
448
+ }
@@ -21,7 +21,7 @@ function markAsyncChunksNonInitial(webpackStats, extraEntryPoints) {
21
21
  // depended upon in Webpack, thus any extra entry point with `inject: false`,
22
22
  // **cannot** be loaded in main bundle.
23
23
  const asyncChunkIds = extraEntryPoints
24
- .filter((entryPoint) => !entryPoint.inject)
24
+ .filter((entryPoint) => !entryPoint.inject && entryPoints[entryPoint.bundleName])
25
25
  .flatMap((entryPoint) => { var _a; return (_a = entryPoints[entryPoint.bundleName].chunks) === null || _a === void 0 ? void 0 : _a.filter((n) => n !== 'runtime'); });
26
26
  // Find chunks for each ID.
27
27
  const asyncChunks = asyncChunkIds.map((chunkId) => {