@angular-devkit/build-angular 12.0.0-rc.0 → 12.0.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.
Files changed (216) hide show
  1. package/README.md +14 -13
  2. package/package.json +24 -24
  3. package/plugins/karma.d.ts +1 -1
  4. package/plugins/karma.js +1 -1
  5. package/src/app-shell/index.d.ts +7 -0
  6. package/src/app-shell/index.js +9 -7
  7. package/src/app-shell/schema.json +1 -4
  8. package/src/babel/babel-loader.d.ts +2 -1
  9. package/src/babel/presets/application.d.ts +7 -0
  10. package/src/babel/presets/application.js +3 -3
  11. package/src/babel/webpack-loader.d.ts +7 -0
  12. package/src/babel/webpack-loader.js +6 -5
  13. package/src/babel-bazel.d.ts +2 -1
  14. package/src/browser/index.d.ts +1 -1
  15. package/src/browser/index.js +34 -33
  16. package/src/browser/schema.d.ts +1 -5
  17. package/src/browser/schema.json +11 -57
  18. package/src/browser/tests/setup.d.ts +1 -1
  19. package/src/browser/tests/setup.js +7 -0
  20. package/src/dev-server/index.d.ts +1 -1
  21. package/src/dev-server/index.js +22 -15
  22. package/src/dev-server/schema.json +1 -3
  23. package/src/dev-server/tests/execute-fetch.d.ts +1 -1
  24. package/src/dev-server/tests/execute-fetch.js +4 -4
  25. package/src/dev-server/tests/setup.d.ts +7 -0
  26. package/src/dev-server/tests/setup.js +7 -0
  27. package/src/extract-i18n/index.d.ts +1 -1
  28. package/src/extract-i18n/index.js +10 -12
  29. package/src/extract-i18n/ivy-extract-loader.d.ts +7 -0
  30. package/src/extract-i18n/ivy-extract-loader.js +7 -6
  31. package/src/extract-i18n/schema.json +2 -14
  32. package/src/index.d.ts +6 -6
  33. package/src/index.js +1 -1
  34. package/src/karma/find-tests.d.ts +7 -0
  35. package/src/karma/find-tests.js +4 -4
  36. package/src/karma/index.d.ts +1 -1
  37. package/src/karma/index.js +21 -13
  38. package/src/karma/schema.json +7 -28
  39. package/src/ng-packagr/index.d.ts +1 -1
  40. package/src/ng-packagr/index.js +4 -4
  41. package/src/ng-packagr/schema.json +1 -3
  42. package/src/protractor/index.d.ts +1 -1
  43. package/src/protractor/index.js +8 -8
  44. package/src/protractor/schema.json +1 -3
  45. package/src/server/index.d.ts +1 -1
  46. package/src/server/index.js +6 -6
  47. package/src/server/schema.d.ts +1 -5
  48. package/src/server/schema.json +7 -35
  49. package/src/test-utils.d.ts +1 -1
  50. package/src/test-utils.js +4 -4
  51. package/src/testing/builder-harness.d.ts +2 -2
  52. package/src/testing/builder-harness.js +10 -8
  53. package/src/testing/file-watching.d.ts +1 -1
  54. package/src/testing/file-watching.js +7 -0
  55. package/src/testing/index.d.ts +1 -1
  56. package/src/testing/index.js +7 -0
  57. package/src/testing/jasmine-helpers.d.ts +2 -2
  58. package/src/testing/jasmine-helpers.js +7 -0
  59. package/src/transforms.d.ts +1 -1
  60. package/src/transforms.js +7 -0
  61. package/src/tslint/index.d.ts +7 -0
  62. package/src/tslint/index.js +10 -12
  63. package/src/tslint/schema.json +1 -1
  64. package/src/typings.d.ts +2 -1
  65. package/src/utils/action-cache.d.ts +7 -0
  66. package/src/utils/action-cache.js +6 -8
  67. package/src/utils/action-executor.d.ts +7 -0
  68. package/src/utils/action-executor.js +13 -28
  69. package/src/utils/build-browser-features.d.ts +1 -1
  70. package/src/utils/build-browser-features.js +3 -7
  71. package/src/utils/build-options.d.ts +1 -2
  72. package/src/utils/build-options.js +1 -1
  73. package/src/utils/bundle-calculator.d.ts +7 -0
  74. package/src/utils/bundle-calculator.js +32 -31
  75. package/src/utils/cache-path.d.ts +7 -0
  76. package/src/utils/cache-path.js +3 -3
  77. package/src/utils/check-port.d.ts +7 -0
  78. package/src/utils/check-port.js +4 -4
  79. package/src/utils/color.d.ts +1 -1
  80. package/src/utils/color.js +3 -3
  81. package/src/utils/copy-assets.d.ts +7 -0
  82. package/src/utils/copy-assets.js +3 -3
  83. package/src/utils/copy-file.d.ts +2 -2
  84. package/src/utils/copy-file.js +4 -4
  85. package/src/utils/default-progress.d.ts +1 -1
  86. package/src/utils/default-progress.js +1 -1
  87. package/src/utils/delete-output-dir.d.ts +7 -0
  88. package/src/utils/delete-output-dir.js +3 -3
  89. package/src/utils/empty.js +0 -1
  90. package/src/utils/environment-options.d.ts +7 -0
  91. package/src/utils/environment-options.js +3 -3
  92. package/src/utils/find-up.d.ts +7 -0
  93. package/src/utils/find-up.js +3 -3
  94. package/src/utils/i18n-inlining.d.ts +1 -1
  95. package/src/utils/i18n-inlining.js +8 -1
  96. package/src/utils/i18n-options.d.ts +1 -1
  97. package/src/utils/i18n-options.js +11 -3
  98. package/src/utils/index-file/augment-index-html.d.ts +1 -1
  99. package/src/utils/index-file/augment-index-html.js +6 -11
  100. package/src/utils/index-file/html-rewriting-stream.d.ts +1 -1
  101. package/src/utils/index-file/html-rewriting-stream.js +2 -2
  102. package/src/utils/index-file/index-html-generator.d.ts +1 -1
  103. package/src/utils/index-file/index-html-generator.js +7 -11
  104. package/src/utils/index-file/inline-critical-css.d.ts +1 -1
  105. package/src/utils/index-file/inline-critical-css.js +1 -1
  106. package/src/utils/index-file/inline-fonts.d.ts +1 -1
  107. package/src/utils/index-file/inline-fonts.js +18 -19
  108. package/src/utils/index.d.ts +1 -1
  109. package/src/utils/index.js +1 -1
  110. package/src/utils/is-directory.d.ts +1 -1
  111. package/src/utils/is-directory.js +2 -3
  112. package/src/utils/load-translations.d.ts +7 -0
  113. package/src/utils/load-translations.js +9 -19
  114. package/src/utils/normalize-asset-patterns.d.ts +1 -1
  115. package/src/utils/normalize-asset-patterns.js +6 -7
  116. package/src/utils/normalize-builder-schema.d.ts +1 -1
  117. package/src/utils/normalize-builder-schema.js +5 -6
  118. package/src/utils/normalize-file-replacements.d.ts +1 -1
  119. package/src/utils/normalize-file-replacements.js +2 -3
  120. package/src/utils/normalize-optimization.d.ts +1 -1
  121. package/src/utils/normalize-optimization.js +12 -8
  122. package/src/utils/normalize-source-maps.d.ts +1 -1
  123. package/src/utils/normalize-source-maps.js +3 -3
  124. package/src/utils/output-paths.d.ts +7 -0
  125. package/src/utils/output-paths.js +7 -4
  126. package/src/utils/package-chunk-sort.d.ts +1 -1
  127. package/src/utils/package-chunk-sort.js +10 -3
  128. package/src/utils/process-bundle-bootstrap.js +3 -2
  129. package/src/utils/process-bundle.d.ts +2 -2
  130. package/src/utils/process-bundle.js +31 -40
  131. package/src/utils/read-tsconfig.d.ts +1 -1
  132. package/src/utils/read-tsconfig.js +2 -4
  133. package/src/utils/run-module-as-observable-fork.d.ts +1 -1
  134. package/src/utils/run-module-as-observable-fork.js +9 -2
  135. package/src/utils/run-module-worker.js +1 -3
  136. package/src/utils/service-worker.d.ts +1 -1
  137. package/src/utils/service-worker.js +3 -3
  138. package/src/utils/spinner.d.ts +1 -1
  139. package/src/utils/spinner.js +1 -1
  140. package/src/utils/strip-bom.d.ts +1 -1
  141. package/src/utils/strip-bom.js +2 -3
  142. package/src/utils/tty.d.ts +1 -1
  143. package/src/utils/tty.js +1 -1
  144. package/src/utils/url.d.ts +1 -1
  145. package/src/utils/url.js +1 -1
  146. package/src/utils/version.d.ts +1 -1
  147. package/src/utils/version.js +3 -3
  148. package/src/utils/webpack-browser-config.d.ts +1 -1
  149. package/src/utils/webpack-browser-config.js +9 -2
  150. package/src/utils/webpack-diagnostics.d.ts +2 -2
  151. package/src/utils/webpack-diagnostics.js +4 -4
  152. package/src/utils/workers.d.ts +1 -1
  153. package/src/utils/workers.js +1 -1
  154. package/src/webpack/configs/browser.d.ts +7 -0
  155. package/src/webpack/configs/browser.js +3 -3
  156. package/src/webpack/configs/common.d.ts +7 -0
  157. package/src/webpack/configs/common.js +16 -19
  158. package/src/webpack/configs/dev-server.d.ts +1 -1
  159. package/src/webpack/configs/dev-server.js +7 -6
  160. package/src/webpack/configs/index.d.ts +1 -1
  161. package/src/webpack/configs/index.js +7 -7
  162. package/src/webpack/configs/server.d.ts +7 -0
  163. package/src/webpack/configs/server.js +4 -4
  164. package/src/webpack/configs/stats.d.ts +1 -1
  165. package/src/webpack/configs/stats.js +1 -1
  166. package/src/webpack/configs/styles.d.ts +7 -0
  167. package/src/webpack/configs/styles.js +6 -10
  168. package/src/webpack/configs/test.d.ts +1 -1
  169. package/src/webpack/configs/test.js +2 -5
  170. package/src/webpack/configs/typescript.d.ts +7 -0
  171. package/src/webpack/configs/typescript.js +4 -6
  172. package/src/webpack/configs/worker.d.ts +7 -0
  173. package/src/webpack/configs/worker.js +3 -3
  174. package/src/webpack/es5-jit-polyfills.js +2 -1
  175. package/src/webpack/es5-polyfills.js +2 -3
  176. package/src/webpack/jit-polyfills.js +2 -1
  177. package/src/webpack/plugins/analytics.d.ts +2 -2
  178. package/src/webpack/plugins/analytics.js +9 -9
  179. package/src/webpack/plugins/any-component-style-budget-checker.d.ts +1 -1
  180. package/src/webpack/plugins/any-component-style-budget-checker.js +3 -9
  181. package/src/webpack/plugins/builder-watch-plugin.d.ts +1 -1
  182. package/src/webpack/plugins/builder-watch-plugin.js +7 -0
  183. package/src/webpack/plugins/common-js-usage-warn-plugin.d.ts +1 -1
  184. package/src/webpack/plugins/common-js-usage-warn-plugin.js +10 -10
  185. package/src/webpack/plugins/dedupe-module-resolve-plugin.d.ts +1 -1
  186. package/src/webpack/plugins/dedupe-module-resolve-plugin.js +9 -2
  187. package/src/webpack/plugins/hmr/hmr-accept.d.ts +1 -1
  188. package/src/webpack/plugins/hmr/hmr-accept.js +6 -9
  189. package/src/webpack/plugins/hmr/hmr-loader.d.ts +1 -1
  190. package/src/webpack/plugins/hmr/hmr-loader.js +2 -2
  191. package/src/webpack/plugins/index-html-webpack-plugin.d.ts +7 -0
  192. package/src/webpack/plugins/index-html-webpack-plugin.js +6 -6
  193. package/src/webpack/plugins/index.d.ts +2 -2
  194. package/src/webpack/plugins/index.js +1 -1
  195. package/src/webpack/plugins/karma/karma-context.html +31 -30
  196. package/src/webpack/plugins/karma/karma-debug.html +34 -33
  197. package/src/webpack/plugins/karma/karma.d.ts +7 -0
  198. package/src/webpack/plugins/karma/karma.js +13 -11
  199. package/src/webpack/plugins/optimize-css-webpack-plugin.d.ts +7 -0
  200. package/src/webpack/plugins/optimize-css-webpack-plugin.js +18 -11
  201. package/src/webpack/plugins/postcss-cli-resources.d.ts +7 -0
  202. package/src/webpack/plugins/postcss-cli-resources.js +11 -9
  203. package/src/webpack/plugins/remove-hash-plugin.d.ts +1 -1
  204. package/src/webpack/plugins/remove-hash-plugin.js +9 -4
  205. package/src/webpack/plugins/scripts-webpack-plugin.d.ts +1 -1
  206. package/src/webpack/plugins/scripts-webpack-plugin.js +11 -10
  207. package/src/webpack/plugins/single-test-transform.d.ts +1 -1
  208. package/src/webpack/plugins/single-test-transform.js +5 -5
  209. package/src/webpack/plugins/suppress-entry-chunks-webpack-plugin.d.ts +1 -1
  210. package/src/webpack/plugins/suppress-entry-chunks-webpack-plugin.js +1 -1
  211. package/src/webpack/utils/async-chunks.d.ts +1 -1
  212. package/src/webpack/utils/async-chunks.js +9 -1
  213. package/src/webpack/utils/helpers.d.ts +1 -1
  214. package/src/webpack/utils/helpers.js +2 -2
  215. package/src/webpack/utils/stats.d.ts +1 -1
  216. package/src/webpack/utils/stats.js +39 -33
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
1
8
  import { Configuration } from 'webpack';
2
9
  import { WebpackConfigOptions } from '../../utils/build-options';
3
10
  export declare function getWorkerConfig(wco: WebpackConfigOptions): Configuration;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getWorkerConfig = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getWorkerConfig = void 0;
11
11
  const path_1 = require("path");
12
12
  const typescript_1 = require("./typescript");
13
13
  function getWorkerConfig(wco) {
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
+
8
9
  import 'core-js/es/reflect';
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
-
9
8
  // ES2015 symbol capabilities
10
9
  import 'core-js/es/symbol';
11
10
 
@@ -114,4 +113,4 @@ import 'core-js/modules/es.json.to-string-tag';
114
113
  import 'regenerator-runtime/runtime';
115
114
 
116
115
  // Zone.js
117
- import 'zone.js/plugins/zone-legacy';
116
+ import 'zone.js/plugins/zone-legacy';
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
+
8
9
  import 'core-js/proposals/reflect-metadata';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -52,7 +52,7 @@ export declare class NgBuildAnalyticsPlugin {
52
52
  protected _checkTsNormalModule(module: NormalModule): void;
53
53
  protected _collectErrors(stats: Stats): void;
54
54
  protected _collectBundleStats(compilation: Compilation): void;
55
- /************************************************************************************************
55
+ /** **********************************************************************************************
56
56
  * The next section is all the different Webpack hooks for this plugin.
57
57
  */
58
58
  /**
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NgBuildAnalyticsPlugin = exports.countOccurrences = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.NgBuildAnalyticsPlugin = exports.countOccurrences = void 0;
11
11
  const core_1 = require("@angular-devkit/core");
12
12
  const webpack_1 = require("webpack");
13
13
  const webpackAllErrorMessageRe = /^([^(]+)\(\d+,\d\): (.*)$/gm;
@@ -88,7 +88,7 @@ class NgBuildAnalyticsPlugin {
88
88
  const startTime = +(stats.startTime || 0);
89
89
  const endTime = +(stats.endTime || 0);
90
90
  const metrics = [];
91
- metrics[core_1.analytics.NgCliAnalyticsMetrics.BuildTime] = (endTime - startTime);
91
+ metrics[core_1.analytics.NgCliAnalyticsMetrics.BuildTime] = endTime - startTime;
92
92
  metrics[core_1.analytics.NgCliAnalyticsMetrics.NgOnInitCount] = this._stats.numberOfNgOnInit;
93
93
  metrics[core_1.analytics.NgCliAnalyticsMetrics.NgComponentCount] = this._stats.numberOfComponents;
94
94
  metrics[core_1.analytics.NgCliAnalyticsMetrics.InitialChunkSize] = this._stats.initialChunkSize;
@@ -144,7 +144,7 @@ class NgBuildAnalyticsPlugin {
144
144
  for (const errObject of stats.compilation.errors) {
145
145
  if (errObject instanceof Error) {
146
146
  const allErrors = errObject.message.match(webpackAllErrorMessageRe);
147
- for (const err of [...allErrors || []].slice(1)) {
147
+ for (const err of [...(allErrors || [])].slice(1)) {
148
148
  const message = (err.match(webpackTsErrorMessageRe) || [])[1];
149
149
  if (message) {
150
150
  // At this point this should be a TS1234.
@@ -190,7 +190,7 @@ class NgBuildAnalyticsPlugin {
190
190
  }
191
191
  }
192
192
  }
193
- /************************************************************************************************
193
+ /** **********************************************************************************************
194
194
  * The next section is all the different Webpack hooks for this plugin.
195
195
  */
196
196
  /**
@@ -205,9 +205,9 @@ class NgBuildAnalyticsPlugin {
205
205
  // Only reports modules that are part of the user's project. We also don't do node_modules.
206
206
  // There is a chance that someone name a file path `hello_node_modules` or something and we
207
207
  // will ignore that file for the purpose of gathering, but we're willing to take the risk.
208
- if (!module.resource
209
- || !module.resource.startsWith(this._projectRoot)
210
- || module.resource.indexOf('node_modules') >= 0) {
208
+ if (!module.resource ||
209
+ !module.resource.startsWith(this._projectRoot) ||
210
+ module.resource.indexOf('node_modules') >= 0) {
211
211
  return;
212
212
  }
213
213
  // Check that it's a source file from the project.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
@@ -32,20 +32,14 @@ class AnyComponentStyleBudgetChecker {
32
32
  if (!compilation.compiler.parentCompilation) {
33
33
  return;
34
34
  }
35
- const cssExtensions = [
36
- '.css',
37
- '.scss',
38
- '.less',
39
- '.styl',
40
- '.sass',
41
- ];
35
+ const cssExtensions = ['.css', '.scss', '.less', '.styl', '.sass'];
42
36
  const componentStyles = Object.keys(compilation.assets)
43
37
  .filter((name) => cssExtensions.includes(path.extname(name)))
44
38
  .map((name) => ({
45
39
  size: compilation.assets[name].size(),
46
40
  label: name,
47
41
  }));
48
- const thresholds = this.budgets.flatMap(budget => [...bundle_calculator_1.calculateThresholds(budget)]);
42
+ const thresholds = this.budgets.flatMap((budget) => [...bundle_calculator_1.calculateThresholds(budget)]);
49
43
  for (const { size, label } of componentStyles) {
50
44
  for (const { severity, message } of bundle_calculator_1.checkThresholds(thresholds[Symbol.iterator](), size, label)) {
51
45
  switch (severity) {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.BuilderWatchPlugin = void 0;
4
11
  class TimeInfoMap extends Map {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
@@ -11,8 +11,8 @@ exports.CommonJsUsageWarnPlugin = void 0;
11
11
  const path_1 = require("path");
12
12
  const webpack_diagnostics_1 = require("../../utils/webpack-diagnostics");
13
13
  // Webpack doesn't export these so the deep imports can potentially break.
14
- const CommonJsRequireDependency = require('webpack/lib/dependencies/CommonJsRequireDependency');
15
14
  const AMDDefineDependency = require('webpack/lib/dependencies/AMDDefineDependency');
15
+ const CommonJsRequireDependency = require('webpack/lib/dependencies/CommonJsRequireDependency');
16
16
  class CommonJsUsageWarnPlugin {
17
17
  constructor(options = {}) {
18
18
  this.options = options;
@@ -20,8 +20,8 @@ class CommonJsUsageWarnPlugin {
20
20
  this.allowedDependencies = new Set(this.options.allowedDependencies);
21
21
  }
22
22
  apply(compiler) {
23
- compiler.hooks.compilation.tap('CommonJsUsageWarnPlugin', compilation => {
24
- compilation.hooks.finishModules.tap('CommonJsUsageWarnPlugin', modules => {
23
+ compiler.hooks.compilation.tap('CommonJsUsageWarnPlugin', (compilation) => {
24
+ compilation.hooks.finishModules.tap('CommonJsUsageWarnPlugin', (modules) => {
25
25
  var _a, _b;
26
26
  const mainEntry = compilation.entries.get('main');
27
27
  if (!mainEntry) {
@@ -50,7 +50,8 @@ class CommonJsUsageWarnPlugin {
50
50
  // Check if it's parent issuer is also a CommonJS dependency.
51
51
  // In case it is skip as an warning will be show for the parent CommonJS dependency.
52
52
  const parentDependencies = (_a = getIssuer(compilation, issuer)) === null || _a === void 0 ? void 0 : _a.dependencies;
53
- if (parentDependencies && this.hasCommonJsDependencies(compilation, parentDependencies, true)) {
53
+ if (parentDependencies &&
54
+ this.hasCommonJsDependencies(compilation, parentDependencies, true)) {
54
55
  continue;
55
56
  }
56
57
  // Find the main issuer (entry-point).
@@ -63,7 +64,6 @@ class CommonJsUsageWarnPlugin {
63
64
  // Only show warnings for modules from main entrypoint.
64
65
  // And if the issuer request is not from 'webpack-dev-server', as 'webpack-dev-server'
65
66
  // will require CommonJS libraries for live reloading such as 'sockjs-node'.
66
- // tslint:disable-next-line: no-any
67
67
  if (mainIssuer && mainModules.has(mainIssuer)) {
68
68
  const warning = `${(_b = issuer) === null || _b === void 0 ? void 0 : _b.userRequest} depends on '${rawRequest}'. ` +
69
69
  'CommonJS or AMD dependencies can cause optimization bailouts.\n' +
@@ -95,10 +95,10 @@ class CommonJsUsageWarnPlugin {
95
95
  }
96
96
  rawRequestToPackageName(rawRequest) {
97
97
  return rawRequest.startsWith('@')
98
- // Scoped request ex: @angular/common/locale/en -> @angular/common
99
- ? rawRequest.split('/', 2).join('/')
100
- // Non-scoped request ex: lodash/isEmpty -> lodash
101
- : rawRequest.split('/', 1)[0];
98
+ ? // Scoped request ex: @angular/common/locale/en -> @angular/common
99
+ rawRequest.split('/', 2).join('/')
100
+ : // Non-scoped request ex: lodash/isEmpty -> lodash
101
+ rawRequest.split('/', 1)[0];
102
102
  }
103
103
  }
104
104
  exports.CommonJsUsageWarnPlugin = CommonJsUsageWarnPlugin;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,10 +1,17 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.DedupeModuleResolvePlugin = void 0;
4
11
  const webpack_diagnostics_1 = require("../../utils/webpack-diagnostics");
5
- // tslint:disable-next-line: no-any
12
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
13
  function getResourceData(resolveData) {
7
- const { descriptionFileData, relativePath, } = resolveData.createData.resourceResolveData;
14
+ const { descriptionFileData, relativePath } = resolveData.createData.resourceResolveData;
8
15
  return {
9
16
  packageName: descriptionFileData === null || descriptionFileData === void 0 ? void 0 : descriptionFileData.name,
10
17
  packageVersion: descriptionFileData === null || descriptionFileData === void 0 ? void 0 : descriptionFileData.version,
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- // tslint:disable-next-line: no-implicit-dependencies
11
10
  const core_1 = require("@angular/core");
12
11
  const operators_1 = require("rxjs/operators");
13
12
  function default_1(mod) {
@@ -42,8 +41,7 @@ function default_1(mod) {
42
41
  const oldInputs = document.querySelectorAll('input:not([type="hidden"]), textarea');
43
42
  const oldOptions = document.querySelectorAll('option');
44
43
  // Create new application
45
- appRef.components
46
- .forEach(cp => {
44
+ appRef.components.forEach((cp) => {
47
45
  const element = cp.location.nativeElement;
48
46
  const parentNode = element.parentNode;
49
47
  parentNode.insertBefore(document.createElement(element.tagName), element);
@@ -56,7 +54,7 @@ function default_1(mod) {
56
54
  }
57
55
  // Restore all inputs and options
58
56
  const bodyElement = document.body;
59
- if ((oldInputs.length + oldOptions.length) === 0 || !bodyElement) {
57
+ if (oldInputs.length + oldOptions.length === 0 || !bodyElement) {
60
58
  return;
61
59
  }
62
60
  // Use a `MutationObserver` to wait until the app-root element has been bootstrapped.
@@ -73,10 +71,9 @@ function default_1(mod) {
73
71
  }
74
72
  // Wait until the application isStable to restore the form values
75
73
  newAppRef.isStable
76
- .pipe(operators_1.filter(isStable => !!isStable), operators_1.take(1))
74
+ .pipe(operators_1.filter((isStable) => !!isStable), operators_1.take(1))
77
75
  .subscribe(() => restoreFormValues(oldInputs, oldOptions));
78
- })
79
- .observe(bodyElement, {
76
+ }).observe(bodyElement, {
80
77
  attributes: true,
81
78
  subtree: true,
82
79
  attributeFilter: ['ng-version'],
@@ -93,7 +90,7 @@ function getAppRoot() {
93
90
  return appRoot;
94
91
  }
95
92
  function getToken(appRoot, token) {
96
- return typeof ng === 'object' && ng.getInjector(appRoot).get(token) || undefined;
93
+ return (typeof ng === 'object' && ng.getInjector(appRoot).get(token)) || undefined;
97
94
  }
98
95
  function getApplicationRef(appRoot) {
99
96
  const appRef = getToken(appRoot, core_1.ApplicationRef);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
@@ -13,7 +13,7 @@ exports.HmrLoader = __filename;
13
13
  const hmrAcceptPath = path_1.join(__dirname, './hmr-accept.js').replace(/\\/g, '/');
14
14
  function default_1(content,
15
15
  // Source map types are broken in the webpack type definitions
16
- // tslint:disable-next-line: no-any
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
17
  map) {
18
18
  const source = `${content}
19
19
 
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
1
8
  import { Compilation, Compiler } from 'webpack';
2
9
  import { IndexHtmlGenerator, IndexHtmlGeneratorOptions, IndexHtmlGeneratorProcessOptions } from '../../utils/index-file/index-html-generator';
3
10
  export interface IndexHtmlWebpackPluginOptions extends IndexHtmlGeneratorOptions, Omit<IndexHtmlGeneratorProcessOptions, 'files' | 'noModuleFiles' | 'moduleFiles'> {
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IndexHtmlWebpackPlugin = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.IndexHtmlWebpackPlugin = void 0;
11
11
  const path_1 = require("path");
12
12
  const webpack_1 = require("webpack");
13
13
  const index_html_generator_1 = require("../../utils/index-file/index-html-generator");
@@ -25,7 +25,7 @@ class IndexHtmlWebpackPlugin extends index_html_generator_1.IndexHtmlGenerator {
25
25
  throw new Error('compilation is undefined.');
26
26
  }
27
27
  apply(compiler) {
28
- compiler.hooks.thisCompilation.tap(PLUGIN_NAME, compilation => {
28
+ compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
29
29
  this._compilation = compilation;
30
30
  compilation.hooks.processAssets.tapPromise({
31
31
  name: PLUGIN_NAME,
@@ -67,8 +67,8 @@ class IndexHtmlWebpackPlugin extends index_html_generator_1.IndexHtmlGenerator {
67
67
  lang: this.options.lang,
68
68
  });
69
69
  assets[this.options.outputPath] = new webpack_1.sources.RawSource(content);
70
- warnings.forEach(msg => webpack_diagnostics_1.addWarning(this.compilation, msg));
71
- errors.forEach(msg => webpack_diagnostics_1.addError(this.compilation, msg));
70
+ warnings.forEach((msg) => webpack_diagnostics_1.addWarning(this.compilation, msg));
71
+ errors.forEach((msg) => webpack_diagnostics_1.addError(this.compilation, msg));
72
72
  }
73
73
  catch (error) {
74
74
  webpack_diagnostics_1.addError(this.compilation, error.message);
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  export { AnyComponentStyleBudgetChecker } from './any-component-style-budget-checker';
9
- export { OptimizeCssWebpackPlugin, OptimizeCssWebpackPluginOptions } from './optimize-css-webpack-plugin';
9
+ export { OptimizeCssWebpackPlugin, OptimizeCssWebpackPluginOptions, } from './optimize-css-webpack-plugin';
10
10
  export { ScriptsWebpackPlugin, ScriptsWebpackPluginOptions } from './scripts-webpack-plugin';
11
11
  export { SuppressExtractedTextChunksWebpackPlugin } from './suppress-entry-chunks-webpack-plugin';
12
12
  export { RemoveHashPlugin, RemoveHashPluginOptions } from './remove-hash-plugin';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
@@ -5,40 +5,41 @@ Loaded within the iframe.
5
5
  Reloaded before every execution run.
6
6
  -->
7
7
  <html>
8
+ <head>
9
+ <title></title>
10
+ <base href="/" />
11
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
12
+ <meta
13
+ name="viewport"
14
+ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
15
+ />
16
+ </head>
8
17
 
9
- <head>
10
- <title></title>
11
- <base href="/">
12
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
13
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
14
- </head>
15
-
16
- <body>
17
- <!-- The scripts need to be in the body DOM element, as some test running frameworks need the body
18
+ <body>
19
+ <!-- The scripts need to be in the body DOM element, as some test running frameworks need the body
18
20
  to have already been created so they can insert their magic into it. For example, if loaded
19
21
  before body, Angular Scenario test framework fails to find the body and crashes and burns in
20
22
  an epic manner. -->
21
- <script src="context.js"></script>
22
- <script type="text/javascript">
23
- // Configure our Karma and set up bindings
24
- %CLIENT_CONFIG%
25
- window.__karma__.setupContext(window);
23
+ <script src="context.js"></script>
24
+ <script type="text/javascript">
25
+ // Configure our Karma and set up bindings
26
+ %CLIENT_CONFIG%
27
+ window.__karma__.setupContext(window);
26
28
 
27
- // All served files with the latest timestamps
28
- %MAPPINGS%
29
- </script>
30
- <script src="_karma_webpack_/runtime.js" crossorigin="anonymous"></script>
31
- <script src="_karma_webpack_/polyfills-es5.js" crossorigin="anonymous" nomodule></script>
32
- <script src="_karma_webpack_/polyfills.js" crossorigin="anonymous"></script>
33
- <!-- Dynamically replaced with <script> tags -->
34
- %SCRIPTS%
35
- <script src="_karma_webpack_/styles.js" crossorigin="anonymous"></script>
36
- <script src="_karma_webpack_/scripts.js" crossorigin="anonymous"></script>
37
- <script src="_karma_webpack_/vendor.js" crossorigin="anonymous"></script>
38
- <script src="_karma_webpack_/main.js" crossorigin="anonymous"></script>
39
- <script type="text/javascript">
29
+ // All served files with the latest timestamps
30
+ %MAPPINGS%
31
+ </script>
32
+ <script src="_karma_webpack_/runtime.js" crossorigin="anonymous"></script>
33
+ <script src="_karma_webpack_/polyfills-es5.js" crossorigin="anonymous" nomodule></script>
34
+ <script src="_karma_webpack_/polyfills.js" crossorigin="anonymous"></script>
35
+ <!-- Dynamically replaced with <script> tags -->
36
+ %SCRIPTS%
37
+ <script src="_karma_webpack_/styles.js" crossorigin="anonymous"></script>
38
+ <script src="_karma_webpack_/scripts.js" crossorigin="anonymous"></script>
39
+ <script src="_karma_webpack_/vendor.js" crossorigin="anonymous"></script>
40
+ <script src="_karma_webpack_/main.js" crossorigin="anonymous"></script>
41
+ <script type="text/javascript">
40
42
  window.__karma__.loaded();
41
- </script>
42
- </body>
43
-
43
+ </script>
44
+ </body>
44
45
  </html>
@@ -1,46 +1,47 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <!--
3
3
  This file is almost the same as context.html - loads all source files,
4
4
  but its purpose is to be loaded in the main frame (not within an iframe),
5
5
  just for immediate execution, without reporting to Karma server.
6
6
  -->
7
7
  <html>
8
+ <head>
9
+ %X_UA_COMPATIBLE%
10
+ <title>Karma DEBUG RUNNER</title>
11
+ <base href="/" />
12
+ <link href="favicon.ico" rel="icon" type="image/x-icon" />
13
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
14
+ <meta
15
+ name="viewport"
16
+ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
17
+ />
18
+ </head>
8
19
 
9
- <head>
10
- %X_UA_COMPATIBLE%
11
- <title>Karma DEBUG RUNNER</title>
12
- <base href="/">
13
- <link href="favicon.ico" rel="icon" type="image/x-icon" />
14
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
15
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
16
- </head>
17
-
18
- <body>
19
- <!-- The scripts need to be at the end of body, so that some test running frameworks
20
+ <body>
21
+ <!-- The scripts need to be at the end of body, so that some test running frameworks
20
22
  (Angular Scenario, for example) need the body to be loaded so that it can insert its magic
21
23
  into it. If it is before body, then it fails to find the body and crashes and burns in an epic
22
24
  manner. -->
23
- <script src="context.js"></script>
24
- <script src="debug.js"></script>
25
- <script type="text/javascript">
26
- // Configure our Karma
27
- %CLIENT_CONFIG%
25
+ <script src="context.js"></script>
26
+ <script src="debug.js"></script>
27
+ <script type="text/javascript">
28
+ // Configure our Karma
29
+ %CLIENT_CONFIG%
28
30
 
29
- // All served files with the latest timestamps
30
- %MAPPINGS%
31
- </script>
32
- <script src="_karma_webpack_/runtime.js" crossorigin="anonymous"></script>
33
- <script src="_karma_webpack_/polyfills-es5.js" crossorigin="anonymous" nomodule></script>
34
- <script src="_karma_webpack_/polyfills.js" crossorigin="anonymous"></script>
35
- <!-- Dynamically replaced with <script> tags -->
36
- %SCRIPTS%
37
- <script src="_karma_webpack_/styles.js" crossorigin="anonymous"></script>
38
- <script src="_karma_webpack_/scripts.js" crossorigin="anonymous"></script>
39
- <script src="_karma_webpack_/vendor.js" crossorigin="anonymous"></script>
40
- <script src="_karma_webpack_/main.js" crossorigin="anonymous"></script>
41
- <script type="text/javascript">
31
+ // All served files with the latest timestamps
32
+ %MAPPINGS%
33
+ </script>
34
+ <script src="_karma_webpack_/runtime.js" crossorigin="anonymous"></script>
35
+ <script src="_karma_webpack_/polyfills-es5.js" crossorigin="anonymous" nomodule></script>
36
+ <script src="_karma_webpack_/polyfills.js" crossorigin="anonymous"></script>
37
+ <!-- Dynamically replaced with <script> tags -->
38
+ %SCRIPTS%
39
+ <script src="_karma_webpack_/styles.js" crossorigin="anonymous"></script>
40
+ <script src="_karma_webpack_/scripts.js" crossorigin="anonymous"></script>
41
+ <script src="_karma_webpack_/vendor.js" crossorigin="anonymous"></script>
42
+ <script src="_karma_webpack_/main.js" crossorigin="anonymous"></script>
43
+ <script type="text/javascript">
42
44
  window.__karma__.loaded();
43
- </script>
44
- </body>
45
-
45
+ </script>
46
+ </body>
46
47
  </html>