@angular-devkit/build-angular 13.0.0 → 13.0.4

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,15 +1,15 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "13.0.0",
3
+ "version": "13.0.4",
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.1300.0",
11
- "@angular-devkit/build-webpack": "0.1300.0",
12
- "@angular-devkit/core": "13.0.0",
10
+ "@angular-devkit/architect": "0.1300.4",
11
+ "@angular-devkit/build-webpack": "0.1300.4",
12
+ "@angular-devkit/core": "13.0.4",
13
13
  "@babel/core": "7.15.8",
14
14
  "@babel/generator": "7.15.8",
15
15
  "@babel/helper-annotate-as-pure": "7.15.4",
@@ -20,7 +20,7 @@
20
20
  "@babel/runtime": "7.15.4",
21
21
  "@babel/template": "7.15.4",
22
22
  "@discoveryjs/json-ext": "0.5.5",
23
- "@ngtools/webpack": "13.0.0",
23
+ "@ngtools/webpack": "13.0.4",
24
24
  "ansi-colors": "4.1.1",
25
25
  "babel-loader": "8.2.3",
26
26
  "babel-plugin-istanbul": "6.1.1",
@@ -39,7 +39,7 @@
39
39
  "karma-source-map-support": "1.4.0",
40
40
  "less": "4.1.2",
41
41
  "less-loader": "10.2.0",
42
- "license-webpack-plugin": "3.0.0",
42
+ "license-webpack-plugin": "4.0.0",
43
43
  "loader-utils": "3.0.0",
44
44
  "mini-css-extract-plugin": "2.4.3",
45
45
  "minimatch": "3.0.4",
@@ -65,7 +65,7 @@
65
65
  "text-table": "0.2.0",
66
66
  "tree-kill": "1.2.2",
67
67
  "tslib": "2.3.1",
68
- "webpack": "5.60.0",
68
+ "webpack": "5.64.1",
69
69
  "webpack-dev-middleware": "5.2.1",
70
70
  "webpack-dev-server": "4.4.0",
71
71
  "webpack-merge": "5.8.0",
@@ -75,11 +75,11 @@
75
75
  "esbuild": "0.13.12"
76
76
  },
77
77
  "peerDependencies": {
78
- "@angular/compiler-cli": "^13.0.0 || ^13.0.0-next",
79
- "@angular/localize": "^13.0.0 || ^13.0.0-next",
80
- "@angular/service-worker": "^13.0.0 || ^13.0.0-next",
78
+ "@angular/compiler-cli": "^13.0.0",
79
+ "@angular/localize": "^13.0.0",
80
+ "@angular/service-worker": "^13.0.0",
81
81
  "karma": "^6.3.0",
82
- "ng-packagr": "^13.0.0 || ^13.0.0-next",
82
+ "ng-packagr": "^13.0.0",
83
83
  "protractor": "^7.0.0",
84
84
  "tailwindcss": "^2.0.0",
85
85
  "typescript": "~4.4.3"
@@ -34,6 +34,7 @@ export interface ApplicationPresetOptions {
34
34
  forceAsyncTransformation?: boolean;
35
35
  instrumentCode?: {
36
36
  includedBasePath: string;
37
+ inputSourceMap: unknown;
37
38
  };
38
39
  optimize?: {
39
40
  looseEnums: boolean;
@@ -101,7 +101,7 @@ function createNgtscLogger(reporter) {
101
101
  };
102
102
  }
103
103
  function default_1(api, options) {
104
- var _a;
104
+ var _a, _b;
105
105
  const presets = [];
106
106
  const plugins = [];
107
107
  let needRuntimeTransform = false;
@@ -160,7 +160,10 @@ function default_1(api, options) {
160
160
  if (options.instrumentCode) {
161
161
  plugins.push([
162
162
  require('babel-plugin-istanbul').default,
163
- { inputSourceMap: false, cwd: options.instrumentCode.includedBasePath },
163
+ {
164
+ inputSourceMap: (_b = options.instrumentCode.inputSourceMap) !== null && _b !== void 0 ? _b : false,
165
+ cwd: options.instrumentCode.includedBasePath,
166
+ },
164
167
  ]);
165
168
  }
166
169
  if (needRuntimeTransform) {
@@ -51,7 +51,7 @@ exports.default = (0, babel_loader_1.custom)(() => {
51
51
  inputSourceMap: false,
52
52
  });
53
53
  return {
54
- async customOptions(options, { source }) {
54
+ async customOptions(options, { source, map }) {
55
55
  var _a, _b;
56
56
  const { i18n, scriptTarget, aot, optimize, instrumentCode, ...rawOptions } = options;
57
57
  // Must process file if plugins are added
@@ -140,6 +140,7 @@ exports.default = (0, babel_loader_1.custom)(() => {
140
140
  // `babel-plugin-istanbul` has it's own includes but we do the below so that we avoid running the the loader.
141
141
  customOptions.instrumentCode = {
142
142
  includedBasePath: instrumentCode.includedBasePath,
143
+ inputSourceMap: map,
143
144
  };
144
145
  shouldProcess = true;
145
146
  }
@@ -198,7 +199,13 @@ exports.default = (0, babel_loader_1.custom)(() => {
198
199
  // `@ampproject/remapping` source map objects but both are compatible with Webpack.
199
200
  // This method for merging is used because it provides more accurate output
200
201
  // and is faster while using less memory.
201
- result.map = (0, remapping_1.default)([result.map, inputSourceMap], () => null);
202
+ result.map = {
203
+ // Convert the SourceMap back to simple plain object.
204
+ // This is needed because otherwise code-coverage will fail with `don't know how to turn this value into a node`
205
+ // Which is thrown by Babel if it is invoked again from `istanbul-lib-instrument`.
206
+ // https://github.com/babel/babel/blob/780aa48d2a34dc55f556843074b6aed45e7eabeb/packages/babel-types/src/converters/valueToNode.ts#L115-L130
207
+ ...(0, remapping_1.default)([result.map, inputSourceMap], () => null),
208
+ };
202
209
  }
203
210
  return result;
204
211
  },
@@ -29,6 +29,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const nodePath = __importStar(require("path"));
30
30
  const load_esm_1 = require("../../utils/load-esm");
31
31
  function localizeExtractLoader(content, map) {
32
+ // This loader is not cacheable due to how message extraction works.
33
+ // Extracted messages are not part of webpack pipeline and hence they cannot be retrieved from cache.
34
+ // TODO: We should investigate in the future on making this deterministic and more cacheable.
35
+ this.cacheable(false);
32
36
  const options = this.getOptions();
33
37
  const callback = this.async();
34
38
  extract(this, content, map, options).then(() => {
@@ -300,6 +300,9 @@ async function getCommonConfig(wco) {
300
300
  /Failed to parse source map from/,
301
301
  // https://github.com/webpack-contrib/postcss-loader/blob/bd261875fdf9c596af4ffb3a1a73fe3c549befda/src/index.js#L153-L158
302
302
  /Add postcss as project dependency/,
303
+ // esbuild will issue a warning, while still hoists the @charset at the very top.
304
+ // This is caused by a bug in css-loader https://github.com/webpack-contrib/css-loader/issues/1212
305
+ /"@charset" must be the first rule in the file/,
303
306
  ],
304
307
  module: {
305
308
  // Show an error for missing exports instead of a warning.
@@ -140,7 +140,6 @@ function restoreFormValues(oldInputs, oldOptions) {
140
140
  case 'date':
141
141
  case 'datetime-local':
142
142
  case 'email':
143
- case 'file':
144
143
  case 'hidden':
145
144
  case 'month':
146
145
  case 'number':
@@ -155,6 +154,10 @@ function restoreFormValues(oldInputs, oldOptions) {
155
154
  case 'week':
156
155
  newElement.value = oldElement.value;
157
156
  break;
157
+ case 'file':
158
+ // Ignored due: Uncaught DOMException: Failed to set the 'value' property on 'HTMLInputElement':
159
+ // This input element accepts a filename, which may only be programmatically set to the empty string.
160
+ break;
158
161
  default:
159
162
  console.warn('[NG HMR] Unknown input type ' + oldElement.type + '.');
160
163
  continue;
@@ -102,7 +102,7 @@ exports.isPolyfillsEntry = isPolyfillsEntry;
102
102
  function getWatchOptions(poll) {
103
103
  return {
104
104
  poll,
105
- ignored: poll === undefined ? '**/$_lazy_route_resources' : 'node_modules/**',
105
+ ignored: poll === undefined ? '**/$_lazy_route_resources' : '**/node_modules/**',
106
106
  };
107
107
  }
108
108
  exports.getWatchOptions = getWatchOptions;