@angular-devkit/build-angular 13.0.0-rc.2 → 13.0.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,15 +1,15 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "13.0.0-rc.2",
3
+ "version": "13.0.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.1300.0-rc.2",
11
- "@angular-devkit/build-webpack": "0.1300.0-rc.2",
12
- "@angular-devkit/core": "13.0.0-rc.2",
10
+ "@angular-devkit/architect": "0.1300.2",
11
+ "@angular-devkit/build-webpack": "0.1300.2",
12
+ "@angular-devkit/core": "13.0.2",
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-rc.2",
23
+ "@ngtools/webpack": "13.0.2",
24
24
  "ansi-colors": "4.1.1",
25
25
  "babel-loader": "8.2.3",
26
26
  "babel-plugin-istanbul": "6.1.1",
@@ -32,7 +32,7 @@
32
32
  "core-js": "3.19.0",
33
33
  "critters": "0.0.14",
34
34
  "css-loader": "6.5.0",
35
- "esbuild-wasm": "0.13.9",
35
+ "esbuild-wasm": "0.13.12",
36
36
  "glob": "7.2.0",
37
37
  "https-proxy-agent": "5.0.0",
38
38
  "inquirer": "8.2.0",
@@ -55,7 +55,7 @@
55
55
  "resolve-url-loader": "4.0.0",
56
56
  "rxjs": "6.6.7",
57
57
  "sass": "1.43.4",
58
- "sass-loader": "12.2.0",
58
+ "sass-loader": "12.3.0",
59
59
  "semver": "7.3.5",
60
60
  "source-map-loader": "3.0.0",
61
61
  "source-map-support": "0.5.20",
@@ -67,19 +67,19 @@
67
67
  "tslib": "2.3.1",
68
68
  "webpack": "5.60.0",
69
69
  "webpack-dev-middleware": "5.2.1",
70
- "webpack-dev-server": "4.3.1",
70
+ "webpack-dev-server": "4.4.0",
71
71
  "webpack-merge": "5.8.0",
72
72
  "webpack-subresource-integrity": "5.0.0"
73
73
  },
74
74
  "optionalDependencies": {
75
- "esbuild": "0.13.9"
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
  }
@@ -132,6 +132,16 @@ async function execute(options, context, transforms) {
132
132
  if (!context.target || !context.target.project) {
133
133
  throw new Error('The builder requires a target.');
134
134
  }
135
+ try {
136
+ require.resolve('@angular/localize');
137
+ }
138
+ catch {
139
+ return {
140
+ success: false,
141
+ error: `i18n extraction requires the '@angular/localize' package.`,
142
+ outputPath: outFile,
143
+ };
144
+ }
135
145
  const metadata = await context.getProjectMetadata(context.target);
136
146
  const i18n = (0, i18n_options_1.createI18nOptions)(metadata);
137
147
  let useLegacyIds = true;
@@ -196,16 +206,6 @@ async function execute(options, context, transforms) {
196
206
  });
197
207
  return partials;
198
208
  });
199
- try {
200
- require.resolve('@angular/localize');
201
- }
202
- catch {
203
- return {
204
- success: false,
205
- error: `Ivy extraction requires the '@angular/localize' package.`,
206
- outputPath: outFile,
207
- };
208
- }
209
209
  // All the localize usages are setup to first try the ESM entry point then fallback to the deep imports.
210
210
  // This provides interim compatibility while the framework is transitioned to bundled ESM packages.
211
211
  const localizeToolsModule = await (0, load_esm_1.loadEsmModule)('@angular/localize/tools');
@@ -48,9 +48,9 @@ class SassWorkerImplementation {
48
48
  * @param callback The function to execute when the rendering is complete.
49
49
  */
50
50
  render(options, callback) {
51
- // The `functions` and `importer` options are JavaScript functions that cannot be transferred.
51
+ // The `functions`, `logger` and `importer` options are JavaScript functions that cannot be transferred.
52
52
  // If any additional function options are added in the future, they must be excluded as well.
53
- const { functions, importer, ...serializableOptions } = options;
53
+ const { functions, importer, logger, ...serializableOptions } = options;
54
54
  // The CLI's configuration does not use or expose the ability to defined custom Sass functions
55
55
  if (functions && Object.keys(functions).length > 0) {
56
56
  throw new Error('Sass custom functions are not supported.');
@@ -25,7 +25,6 @@ worker_threads_1.parentPort.on('message', ({ id, hasImporter, options }) => {
25
25
  options.importer = function (url, prev) {
26
26
  var _a;
27
27
  Atomics.store(importerSignal, 0, 0);
28
- // `this.fromImport` was added in dart-sass in 1.33.0, `@types/sass` doesn't include it yet.
29
28
  const { fromImport } = this;
30
29
  workerImporterPort.postMessage({ id, url, prev, fromImport });
31
30
  Atomics.wait(importerSignal, 0, 0);
@@ -40,13 +40,12 @@ class BundleActionExecutor {
40
40
  const executions = new Map();
41
41
  for (const action of actions) {
42
42
  const execution = executor(action);
43
- executions.set(execution, execution.then((result) => {
44
- executions.delete(execution);
45
- return result;
46
- }));
43
+ executions.set(execution, execution.then((result) => [execution, result]));
47
44
  }
48
45
  while (executions.size > 0) {
49
- yield Promise.race(executions.values());
46
+ const [execution, result] = await Promise.race(executions.values());
47
+ executions.delete(execution);
48
+ yield result;
50
49
  }
51
50
  }
52
51
  stop() {
@@ -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.
@@ -28,7 +28,8 @@ function getServerConfig(wco) {
28
28
  }
29
29
  return {
30
30
  resolve: {
31
- mainFields: ['es2020', 'es2015', 'main', 'module'],
31
+ mainFields: ['es2015', 'main', 'module'],
32
+ conditionNames: ['es2015', '...'],
32
33
  },
33
34
  output: {
34
35
  libraryTarget: 'commonjs',
@@ -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;