@angular-devkit/build-angular 12.1.0-next.3 → 12.1.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 (95) hide show
  1. package/package.json +40 -39
  2. package/src/app-shell/index.js +28 -8
  3. package/src/babel/plugins/adjust-static-class-members.d.ts +25 -0
  4. package/src/babel/plugins/adjust-static-class-members.js +251 -0
  5. package/src/babel/plugins/adjust-typescript-enums.d.ts +21 -0
  6. package/src/babel/plugins/adjust-typescript-enums.js +123 -0
  7. package/src/babel/plugins/elide-angular-metadata.d.ts +21 -0
  8. package/src/babel/plugins/elide-angular-metadata.js +68 -0
  9. package/src/babel/plugins/pure-toplevel-functions.d.ts +14 -0
  10. package/src/babel/plugins/pure-toplevel-functions.js +86 -0
  11. package/src/babel/presets/application.d.ts +1 -0
  12. package/src/babel/presets/application.js +23 -3
  13. package/src/babel/webpack-loader.js +39 -1
  14. package/src/browser/index.d.ts +1 -4
  15. package/src/browser/index.js +26 -36
  16. package/src/browser/schema.d.ts +1 -1
  17. package/src/browser/schema.json +1 -1
  18. package/src/dev-server/index.d.ts +1 -1
  19. package/src/dev-server/index.js +68 -47
  20. package/src/dev-server/tests/execute-fetch.js +4 -1
  21. package/src/extract-i18n/empty-loader.d.ts +8 -0
  22. package/src/extract-i18n/empty-loader.js +13 -0
  23. package/src/extract-i18n/index.d.ts +1 -1
  24. package/src/extract-i18n/index.js +46 -18
  25. package/src/extract-i18n/ivy-extract-loader.js +20 -1
  26. package/src/karma/find-tests.js +20 -1
  27. package/src/karma/index.js +21 -1
  28. package/src/karma/schema.d.ts +1 -1
  29. package/src/karma/schema.json +1 -1
  30. package/src/karma/tests/setup.d.ts +18 -0
  31. package/src/karma/tests/setup.js +29 -0
  32. package/src/ng-packagr/index.js +21 -2
  33. package/src/protractor/index.js +21 -2
  34. package/src/sass/sass-service.d.ts +0 -3
  35. package/src/sass/sass-service.js +8 -9
  36. package/src/sass/worker.js +4 -2
  37. package/src/server/index.d.ts +1 -1
  38. package/src/server/index.js +20 -1
  39. package/src/server/schema.d.ts +1 -1
  40. package/src/server/schema.json +1 -1
  41. package/src/tslint/index.js +22 -3
  42. package/src/typings.d.ts +6 -0
  43. package/src/utils/action-cache.js +21 -2
  44. package/src/utils/action-executor.js +21 -2
  45. package/src/utils/build-browser-features.js +25 -3
  46. package/src/utils/cache-path.js +5 -2
  47. package/src/utils/check-port.js +20 -1
  48. package/src/utils/color.js +20 -1
  49. package/src/utils/copy-assets.js +26 -4
  50. package/src/utils/copy-file.js +20 -1
  51. package/src/utils/delete-output-dir.js +2 -2
  52. package/src/utils/environment-options.d.ts +1 -0
  53. package/src/utils/environment-options.js +26 -2
  54. package/src/utils/find-up.js +20 -1
  55. package/src/utils/i18n-inlining.js +21 -2
  56. package/src/utils/i18n-options.js +23 -5
  57. package/src/utils/index-file/html-rewriting-stream.js +20 -1
  58. package/src/utils/index-file/index-html-generator.js +20 -1
  59. package/src/utils/index-file/inline-critical-css.js +20 -1
  60. package/src/utils/index-file/inline-fonts.js +27 -5
  61. package/src/utils/is-directory.js +20 -1
  62. package/src/utils/load-translations.js +26 -7
  63. package/src/utils/process-bundle.js +34 -12
  64. package/src/utils/read-tsconfig.js +20 -1
  65. package/src/utils/service-worker.js +21 -2
  66. package/src/utils/spinner.d.ts +2 -0
  67. package/src/utils/spinner.js +18 -2
  68. package/src/utils/webpack-browser-config.js +21 -2
  69. package/src/webpack/configs/analytics.d.ts +11 -0
  70. package/src/webpack/configs/analytics.js +29 -0
  71. package/src/webpack/configs/common.js +96 -45
  72. package/src/webpack/configs/dev-server.js +20 -1
  73. package/src/webpack/configs/index.d.ts +1 -0
  74. package/src/webpack/configs/index.js +1 -0
  75. package/src/webpack/configs/server.js +8 -0
  76. package/src/webpack/configs/stats.d.ts +6 -14
  77. package/src/webpack/configs/stats.js +5 -8
  78. package/src/webpack/configs/styles.js +28 -2
  79. package/src/webpack/configs/test.js +32 -3
  80. package/src/webpack/configs/typescript.d.ts +2 -9
  81. package/src/webpack/configs/typescript.js +16 -14
  82. package/src/webpack/plugins/any-component-style-budget-checker.js +20 -1
  83. package/src/webpack/plugins/builder-watch-plugin.d.ts +0 -2
  84. package/src/webpack/plugins/builder-watch-plugin.js +2 -7
  85. package/src/webpack/plugins/index.js +4 -1
  86. package/src/webpack/plugins/karma/karma-context.html +1 -1
  87. package/src/webpack/plugins/karma/karma-debug.html +1 -1
  88. package/src/webpack/plugins/karma/karma.js +27 -5
  89. package/src/webpack/plugins/postcss-cli-resources.js +21 -2
  90. package/src/webpack/plugins/scripts-webpack-plugin.js +20 -1
  91. package/src/webpack/utils/async-chunks.js +9 -5
  92. package/src/webpack/utils/helpers.js +20 -1
  93. package/src/webpack/utils/stats.d.ts +2 -3
  94. package/src/webpack/utils/stats.js +50 -15
  95. package/src/extract-i18n/empty-export-default.js +0 -1
@@ -13,16 +13,12 @@ export declare function getWebpackStatsConfig(verbose?: boolean): {
13
13
  timings: boolean;
14
14
  chunks: boolean;
15
15
  builtAt: boolean;
16
- chunkModules: boolean;
17
- children: boolean;
18
- modules: boolean;
19
- reasons: boolean;
20
16
  warnings: boolean;
21
17
  errors: boolean;
22
18
  assets: boolean;
23
- version: boolean;
24
- errorDetails: boolean;
25
- moduleTrace: boolean;
19
+ cachedAssets: boolean;
20
+ ids: boolean;
21
+ entrypoints: boolean;
26
22
  };
27
23
  export declare function getStatsConfig(wco: WebpackConfigOptions): {
28
24
  stats: {
@@ -32,15 +28,11 @@ export declare function getStatsConfig(wco: WebpackConfigOptions): {
32
28
  timings: boolean;
33
29
  chunks: boolean;
34
30
  builtAt: boolean;
35
- chunkModules: boolean;
36
- children: boolean;
37
- modules: boolean;
38
- reasons: boolean;
39
31
  warnings: boolean;
40
32
  errors: boolean;
41
33
  assets: boolean;
42
- version: boolean;
43
- errorDetails: boolean;
44
- moduleTrace: boolean;
34
+ cachedAssets: boolean;
35
+ ids: boolean;
36
+ entrypoints: boolean;
45
37
  };
46
38
  };
@@ -15,16 +15,13 @@ const webpackOutputOptions = {
15
15
  timings: true,
16
16
  chunks: true,
17
17
  builtAt: true,
18
- chunkModules: false,
19
- children: false,
20
- modules: false,
21
- reasons: false,
22
18
  warnings: true,
23
19
  errors: true,
24
20
  assets: true,
25
- version: false,
26
- errorDetails: false,
27
- moduleTrace: false,
21
+ cachedAssets: true,
22
+ // Needed for markAsyncChunksNonInitial.
23
+ ids: true,
24
+ entrypoints: true,
28
25
  };
29
26
  const verboseWebpackOutputOptions = {
30
27
  // The verbose output will most likely be piped to a file, so colors just mess it up.
@@ -39,8 +36,8 @@ const verboseWebpackOutputOptions = {
39
36
  errorDetails: true,
40
37
  moduleTrace: true,
41
38
  logging: 'verbose',
39
+ modulesSpace: Infinity,
42
40
  };
43
- verboseWebpackOutputOptions['modulesSpace'] = Infinity;
44
41
  function getWebpackStatsConfig(verbose = false) {
45
42
  return verbose
46
43
  ? { ...webpackOutputOptions, ...verboseWebpackOutputOptions }
@@ -6,10 +6,29 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.getStylesConfig = void 0;
11
- const fs = require("fs");
12
- const path = require("path");
30
+ const fs = __importStar(require("fs"));
31
+ const path = __importStar(require("path"));
13
32
  const sass_service_1 = require("../../sass/sass-service");
14
33
  const build_browser_features_1 = require("../../utils/build-browser-features");
15
34
  const environment_options_1 = require("../../utils/environment-options");
@@ -81,6 +100,13 @@ function getStylesConfig(wco) {
81
100
  }
82
101
  catch {
83
102
  sassImplementation = new sass_service_1.SassWorkerImplementation();
103
+ extraPlugins.push({
104
+ apply(compiler) {
105
+ compiler.hooks.shutdown.tap('sass-worker', () => {
106
+ sassImplementation === null || sassImplementation === void 0 ? void 0 : sassImplementation.close();
107
+ });
108
+ },
109
+ });
84
110
  }
85
111
  const assetNameTemplate = helpers_1.assetNameTemplateFactory(hashFormat);
86
112
  const extraPostcssPlugins = [];
@@ -6,13 +6,33 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.getTestConfig = void 0;
11
- const glob = require("glob");
12
- const path = require("path");
30
+ const glob = __importStar(require("glob"));
31
+ const path = __importStar(require("path"));
32
+ const typescript_1 = require("typescript");
13
33
  const helpers_1 = require("../utils/helpers");
14
34
  function getTestConfig(wco) {
15
- const { buildOptions: { codeCoverage, codeCoverageExclude, main, sourceMap }, root, sourceRoot, } = wco;
35
+ const { buildOptions: { codeCoverage, codeCoverageExclude, main, sourceMap, webWorkerTsConfig }, root, sourceRoot, } = wco;
16
36
  const extraRules = [];
17
37
  const extraPlugins = [];
18
38
  if (codeCoverage) {
@@ -38,6 +58,7 @@ function getTestConfig(wco) {
38
58
  }
39
59
  return {
40
60
  mode: 'development',
61
+ target: wco.tsConfig.options.target === typescript_1.ScriptTarget.ES5 ? ['web', 'es5'] : 'web',
41
62
  resolve: {
42
63
  mainFields: ['es2015', 'browser', 'module', 'main'],
43
64
  },
@@ -47,6 +68,14 @@ function getTestConfig(wco) {
47
68
  },
48
69
  module: {
49
70
  rules: extraRules,
71
+ parser: webWorkerTsConfig === undefined
72
+ ? {
73
+ javascript: {
74
+ worker: false,
75
+ url: false,
76
+ },
77
+ }
78
+ : undefined,
50
79
  },
51
80
  plugins: extraPlugins,
52
81
  optimization: {
@@ -6,14 +6,7 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { AngularWebpackPlugin } from '@ngtools/webpack';
9
+ import { Configuration } from 'webpack';
9
10
  import { WebpackConfigOptions } from '../../utils/build-options';
10
- export declare function getTypeScriptConfig(wco: WebpackConfigOptions): {
11
- module: {
12
- rules: {
13
- test: RegExp;
14
- loader: string;
15
- }[];
16
- };
17
- plugins: AngularWebpackPlugin[];
18
- };
11
+ export declare function getTypeScriptConfig(wco: WebpackConfigOptions): Configuration;
19
12
  export declare function getTypescriptWorkerPlugin(wco: WebpackConfigOptions, workerTsConfigPath: string): AngularWebpackPlugin;
@@ -63,20 +63,22 @@ function createIvyPlugin(wco, aot, tsconfig) {
63
63
  });
64
64
  }
65
65
  function getTypeScriptConfig(wco) {
66
- const { buildOptions, tsConfigPath } = wco;
67
- const aot = !!buildOptions.aot;
68
- ensureIvy(wco);
69
- return {
70
- module: {
71
- rules: [
72
- {
73
- test: /\.[jt]sx?$/,
74
- loader: webpack_1.AngularWebpackLoaderPath,
75
- },
76
- ],
77
- },
78
- plugins: [createIvyPlugin(wco, aot, tsConfigPath)],
79
- };
66
+ const { buildOptions: { aot = false, main, polyfills }, tsConfigPath, } = wco;
67
+ if (main || polyfills) {
68
+ ensureIvy(wco);
69
+ return {
70
+ module: {
71
+ rules: [
72
+ {
73
+ test: /\.[jt]sx?$/,
74
+ loader: webpack_1.AngularWebpackLoaderPath,
75
+ },
76
+ ],
77
+ },
78
+ plugins: [createIvyPlugin(wco, aot, tsConfigPath)],
79
+ };
80
+ }
81
+ return {};
80
82
  }
81
83
  exports.getTypeScriptConfig = getTypeScriptConfig;
82
84
  function getTypescriptWorkerPlugin(wco, workerTsConfigPath) {
@@ -6,9 +6,28 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.AnyComponentStyleBudgetChecker = void 0;
11
- const path = require("path");
30
+ const path = __importStar(require("path"));
12
31
  const webpack_1 = require("webpack");
13
32
  const schema_1 = require("../../browser/schema");
14
33
  const bundle_calculator_1 = require("../../utils/bundle-calculator");
@@ -19,8 +19,6 @@ export interface BuilderWatcherFactory {
19
19
  export interface WebpackWatcher {
20
20
  close(): void;
21
21
  pause(): void;
22
- getFileTimestamps(): Map<string, number>;
23
- getContextTimestamps(): Map<string, number>;
24
22
  getFileTimeInfoEntries(): Map<string, {
25
23
  safeTime: number;
26
24
  timestamp: number;
@@ -68,7 +68,8 @@ class BuilderWatchFileSystem {
68
68
  }
69
69
  }
70
70
  }
71
- callback(undefined, new Map(timeInfo), new Map(timeInfo), new Set([...fileChanges, ...directoryChanges, ...missingChanges]), removals);
71
+ const timeInfoMap = new Map(timeInfo);
72
+ callback(undefined, timeInfoMap, timeInfoMap, new Set([...fileChanges, ...directoryChanges, ...missingChanges]), removals);
72
73
  });
73
74
  });
74
75
  return {
@@ -76,12 +77,6 @@ class BuilderWatchFileSystem {
76
77
  watcher.close();
77
78
  },
78
79
  pause() { },
79
- getFileTimestamps() {
80
- return timeInfo.toTimestamps();
81
- },
82
- getContextTimestamps() {
83
- return timeInfo.toTimestamps();
84
- },
85
80
  getFileTimeInfoEntries() {
86
81
  return new Map(timeInfo);
87
82
  },
@@ -6,6 +6,9 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
9
12
  Object.defineProperty(exports, "__esModule", { value: true });
10
13
  exports.PostcssCliResources = exports.CommonJsUsageWarnPlugin = exports.DedupeModuleResolvePlugin = exports.RemoveHashPlugin = exports.SuppressExtractedTextChunksWebpackPlugin = exports.ScriptsWebpackPlugin = exports.AnyComponentStyleBudgetChecker = void 0;
11
14
  // Exports the webpack plugins we use internally.
@@ -22,4 +25,4 @@ Object.defineProperty(exports, "DedupeModuleResolvePlugin", { enumerable: true,
22
25
  var common_js_usage_warn_plugin_1 = require("./common-js-usage-warn-plugin");
23
26
  Object.defineProperty(exports, "CommonJsUsageWarnPlugin", { enumerable: true, get: function () { return common_js_usage_warn_plugin_1.CommonJsUsageWarnPlugin; } });
24
27
  var postcss_cli_resources_1 = require("./postcss-cli-resources");
25
- Object.defineProperty(exports, "PostcssCliResources", { enumerable: true, get: function () { return postcss_cli_resources_1.default; } });
28
+ Object.defineProperty(exports, "PostcssCliResources", { enumerable: true, get: function () { return __importDefault(postcss_cli_resources_1).default; } });
@@ -9,6 +9,7 @@ Reloaded before every execution run.
9
9
  <title></title>
10
10
  <base href="/" />
11
11
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
12
+ <link rel="stylesheet" href="_karma_webpack_/styles.css" crossorigin="anonymous" />
12
13
  <meta
13
14
  name="viewport"
14
15
  content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
@@ -34,7 +35,6 @@ Reloaded before every execution run.
34
35
  <script src="_karma_webpack_/polyfills.js" crossorigin="anonymous"></script>
35
36
  <!-- Dynamically replaced with <script> tags -->
36
37
  %SCRIPTS%
37
- <script src="_karma_webpack_/styles.js" crossorigin="anonymous"></script>
38
38
  <script src="_karma_webpack_/scripts.js" crossorigin="anonymous"></script>
39
39
  <script src="_karma_webpack_/vendor.js" crossorigin="anonymous"></script>
40
40
  <script src="_karma_webpack_/main.js" crossorigin="anonymous"></script>
@@ -10,6 +10,7 @@ just for immediate execution, without reporting to Karma server.
10
10
  <title>Karma DEBUG RUNNER</title>
11
11
  <base href="/" />
12
12
  <link href="favicon.ico" rel="icon" type="image/x-icon" />
13
+ <link rel="stylesheet" href="_karma_webpack_/styles.css" crossorigin="anonymous" />
13
14
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
14
15
  <meta
15
16
  name="viewport"
@@ -36,7 +37,6 @@ just for immediate execution, without reporting to Karma server.
36
37
  <script src="_karma_webpack_/polyfills.js" crossorigin="anonymous"></script>
37
38
  <!-- Dynamically replaced with <script> tags -->
38
39
  %SCRIPTS%
39
- <script src="_karma_webpack_/styles.js" crossorigin="anonymous"></script>
40
40
  <script src="_karma_webpack_/scripts.js" crossorigin="anonymous"></script>
41
41
  <script src="_karma_webpack_/vendor.js" crossorigin="anonymous"></script>
42
42
  <script src="_karma_webpack_/main.js" crossorigin="anonymous"></script>
@@ -6,10 +6,32 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
9
31
  Object.defineProperty(exports, "__esModule", { value: true });
10
- const path = require("path");
11
- const glob = require("glob");
12
- const webpack = require("webpack");
32
+ const path = __importStar(require("path"));
33
+ const glob = __importStar(require("glob"));
34
+ const webpack_1 = __importDefault(require("webpack"));
13
35
  const webpackDevMiddleware = require('webpack-dev-middleware');
14
36
  const stats_1 = require("../../utils/stats");
15
37
  const node_1 = require("@angular-devkit/core/node");
@@ -122,7 +144,7 @@ const init = (config, emitter) => {
122
144
  // Files need to be served from a custom path for Karma.
123
145
  webpackConfig.output.path = `/${KARMA_APPLICATION_PATH}/`;
124
146
  webpackConfig.output.publicPath = `/${KARMA_APPLICATION_PATH}/`;
125
- const compiler = webpack(webpackConfig, (error, stats) => {
147
+ const compiler = webpack_1.default(webpackConfig, (error, stats) => {
126
148
  var _a;
127
149
  if (error) {
128
150
  throw error;
@@ -248,7 +270,7 @@ function fallbackMiddleware() {
248
270
  `/${KARMA_APPLICATION_PATH}/polyfills.js`,
249
271
  `/${KARMA_APPLICATION_PATH}/polyfills-es5.js`,
250
272
  `/${KARMA_APPLICATION_PATH}/scripts.js`,
251
- `/${KARMA_APPLICATION_PATH}/styles.js`,
273
+ `/${KARMA_APPLICATION_PATH}/styles.css`,
252
274
  `/${KARMA_APPLICATION_PATH}/vendor.js`,
253
275
  ];
254
276
  if (request.url && alwaysServe.includes(request.url)) {
@@ -6,11 +6,30 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.postcss = void 0;
11
30
  const loader_utils_1 = require("loader-utils");
12
- const path = require("path");
13
- const url = require("url");
31
+ const path = __importStar(require("path"));
32
+ const url = __importStar(require("url"));
14
33
  function wrapUrl(url) {
15
34
  let wrappedUrl;
16
35
  const hasSingleQuotes = url.indexOf("'") >= 0;
@@ -6,10 +6,29 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.ScriptsWebpackPlugin = void 0;
11
30
  const loader_utils_1 = require("loader-utils");
12
- const path = require("path");
31
+ const path = __importStar(require("path"));
13
32
  const webpack_1 = require("webpack");
14
33
  const Entrypoint = require('webpack/lib/Entrypoint');
15
34
  function addDependencies(compilation, scripts) {
@@ -22,7 +22,7 @@ function markAsyncChunksNonInitial(webpackStats, extraEntryPoints) {
22
22
  // **cannot** be loaded in main bundle.
23
23
  const asyncChunkIds = extraEntryPoints
24
24
  .filter((entryPoint) => !entryPoint.inject)
25
- .flatMap((entryPoint) => entryPoints[entryPoint.bundleName].chunks);
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) => {
28
28
  const chunk = chunks.find((chunk) => chunk.id === chunkId);
@@ -33,9 +33,13 @@ function markAsyncChunksNonInitial(webpackStats, extraEntryPoints) {
33
33
  });
34
34
  // A chunk is considered `initial` only if Webpack already belives it to be initial
35
35
  // and the application developer did not mark it async via an extra entry point.
36
- return chunks.map((chunk) => ({
37
- ...chunk,
38
- initial: chunk.initial && !asyncChunks.find((asyncChunk) => asyncChunk === chunk),
39
- }));
36
+ return chunks.map((chunk) => {
37
+ return asyncChunks.find((asyncChunk) => asyncChunk === chunk)
38
+ ? {
39
+ ...chunk,
40
+ initial: false,
41
+ }
42
+ : chunk;
43
+ });
40
44
  }
41
45
  exports.markAsyncChunksNonInitial = markAsyncChunksNonInitial;
@@ -6,10 +6,29 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.assetNameTemplateFactory = exports.getWatchOptions = exports.isPolyfillsEntry = exports.getEsVersionForFileName = exports.getSourceMapDevTool = exports.normalizeExtraEntryPoints = exports.getOutputHashFormat = void 0;
11
30
  const core_1 = require("@angular-devkit/core");
12
- const path = require("path");
31
+ const path = __importStar(require("path"));
13
32
  const typescript_1 = require("typescript");
14
33
  const webpack_1 = require("webpack");
15
34
  function getOutputHashFormat(option, length = 20) {
@@ -8,6 +8,7 @@
8
8
  import { WebpackLoggingCallback } from '@angular-devkit/build-webpack';
9
9
  import { logging } from '@angular-devkit/core';
10
10
  import { Configuration, StatsCompilation } from 'webpack';
11
+ import { Schema as BrowserBuilderOptions } from '../../browser/schema';
11
12
  export declare function formatSize(size: number): string;
12
13
  export declare type BundleStatsData = [files: string, names: string, size: number | string];
13
14
  export declare type ChunkType = 'modern' | 'legacy' | 'unknown';
@@ -20,15 +21,13 @@ export declare function generateBundleStats(info: {
20
21
  size?: number;
21
22
  files?: string[];
22
23
  names?: string[];
23
- entry?: boolean;
24
24
  initial?: boolean;
25
25
  rendered?: boolean;
26
26
  chunkType?: ChunkType;
27
27
  }): BundleStats;
28
- export declare const IGNORE_WARNINGS: RegExp[];
29
28
  export declare function statsWarningsToString(json: StatsCompilation, statsConfig: any): string;
30
29
  export declare function statsErrorsToString(json: StatsCompilation, statsConfig: any): string;
31
30
  export declare function statsHasErrors(json: StatsCompilation): boolean;
32
31
  export declare function statsHasWarnings(json: StatsCompilation): boolean;
33
- export declare function createWebpackLoggingCallback(verbose: boolean, logger: logging.LoggerApi): WebpackLoggingCallback;
32
+ export declare function createWebpackLoggingCallback(options: BrowserBuilderOptions, logger: logging.LoggerApi): WebpackLoggingCallback;
34
33
  export declare function webpackStatsLogger(logger: logging.LoggerApi, json: StatsCompilation, config: Configuration, bundleStats?: BundleStats[]): void;