@angular-devkit/build-angular 0.1100.3 → 0.1100.7

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": "0.1100.3",
3
+ "version": "0.1100.7",
4
4
  "description": "Angular Webpack Build Facade",
5
5
  "experimental": true,
6
6
  "main": "src/index.js",
7
7
  "typings": "src/index.d.ts",
8
8
  "builders": "builders.json",
9
9
  "dependencies": {
10
- "@angular-devkit/architect": "0.1100.3",
11
- "@angular-devkit/build-optimizer": "0.1100.3",
12
- "@angular-devkit/build-webpack": "0.1100.3",
13
- "@angular-devkit/core": "11.0.3",
10
+ "@angular-devkit/architect": "0.1100.7",
11
+ "@angular-devkit/build-optimizer": "0.1100.7",
12
+ "@angular-devkit/build-webpack": "0.1100.7",
13
+ "@angular-devkit/core": "11.0.7",
14
14
  "@babel/core": "7.12.3",
15
15
  "@babel/generator": "7.12.1",
16
16
  "@babel/plugin-transform-runtime": "7.12.1",
@@ -18,7 +18,7 @@
18
18
  "@babel/runtime": "7.12.1",
19
19
  "@babel/template": "7.10.4",
20
20
  "@jsdevtools/coverage-istanbul-loader": "3.0.5",
21
- "@ngtools/webpack": "11.0.3",
21
+ "@ngtools/webpack": "11.0.7",
22
22
  "ansi-colors": "4.1.1",
23
23
  "autoprefixer": "9.8.6",
24
24
  "babel-loader": "8.1.0",
@@ -64,7 +64,7 @@
64
64
  "speed-measure-webpack-plugin": "1.3.3",
65
65
  "style-loader": "2.0.0",
66
66
  "stylus": "0.54.8",
67
- "stylus-loader": "4.1.1",
67
+ "stylus-loader": "4.3.1",
68
68
  "terser": "5.3.7",
69
69
  "terser-webpack-plugin": "4.2.3",
70
70
  "text-table": "0.2.0",
@@ -113,7 +113,7 @@ export interface Schema {
113
113
  ngswConfigPath?: string;
114
114
  /**
115
115
  * Enables optimization of the build output. Including minification of scripts and styles,
116
- * tree-shaking, dead-code eliminiation and fonts inlining. For more information, see
116
+ * tree-shaking, dead-code elimination and fonts inlining. For more information, see
117
117
  * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
118
118
  */
119
119
  optimization?: OptimizationUnion;
@@ -161,7 +161,7 @@ export interface Schema {
161
161
  */
162
162
  showCircularDependencies?: boolean;
163
163
  /**
164
- * Output sourcemaps.
164
+ * Output source maps.
165
165
  */
166
166
  sourceMap?: SourceMapUnion;
167
167
  /**
@@ -314,7 +314,7 @@ export interface IndexObject {
314
314
  export declare type Localize = string[] | boolean;
315
315
  /**
316
316
  * Enables optimization of the build output. Including minification of scripts and styles,
317
- * tree-shaking, dead-code eliminiation and fonts inlining. For more information, see
317
+ * tree-shaking, dead-code elimination and fonts inlining. For more information, see
318
318
  * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
319
319
  */
320
320
  export declare type OptimizationUnion = boolean | OptimizationClass;
@@ -338,8 +338,8 @@ export interface OptimizationClass {
338
338
  export declare type FontsUnion = boolean | FontsClass;
339
339
  export interface FontsClass {
340
340
  /**
341
- * Reduce render blocking requests by inlining external fonts in the application's HTML
342
- * index file. This requires internet access.
341
+ * Reduce render blocking requests by inlining external Google fonts and icons CSS
342
+ * definitions in the application's HTML index file. This requires internet access.
343
343
  */
344
344
  inline?: boolean;
345
345
  }
@@ -368,24 +368,24 @@ export interface ExtraEntryPointClass {
368
368
  input: string;
369
369
  }
370
370
  /**
371
- * Output sourcemaps.
371
+ * Output source maps.
372
372
  */
373
373
  export declare type SourceMapUnion = boolean | SourceMapClass;
374
374
  export interface SourceMapClass {
375
375
  /**
376
- * Output sourcemaps used for error reporting tools.
376
+ * Output source maps used for error reporting tools.
377
377
  */
378
378
  hidden?: boolean;
379
379
  /**
380
- * Output sourcemaps for all scripts.
380
+ * Output source maps for all scripts.
381
381
  */
382
382
  scripts?: boolean;
383
383
  /**
384
- * Output sourcemaps for all styles.
384
+ * Output source maps for all styles.
385
385
  */
386
386
  styles?: boolean;
387
387
  /**
388
- * Resolve vendor packages sourcemaps.
388
+ * Resolve vendor packages source maps.
389
389
  */
390
390
  vendor?: boolean;
391
391
  }
@@ -57,7 +57,7 @@
57
57
  "additionalProperties": false
58
58
  },
59
59
  "optimization": {
60
- "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code eliminiation and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.",
60
+ "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.",
61
61
  "x-user-analytics": 16,
62
62
  "default": false,
63
63
  "oneOf": [
@@ -83,7 +83,7 @@
83
83
  "properties": {
84
84
  "inline": {
85
85
  "type": "boolean",
86
- "description": "Reduce render blocking requests by inlining external fonts in the application's HTML index file. This requires internet access.",
86
+ "description": "Reduce render blocking requests by inlining external Google fonts and icons CSS definitions in the application's HTML index file. This requires internet access.",
87
87
  "default": true
88
88
  }
89
89
  },
@@ -126,7 +126,7 @@
126
126
  "default": false
127
127
  },
128
128
  "sourceMap": {
129
- "description": "Output sourcemaps.",
129
+ "description": "Output source maps.",
130
130
  "default": true,
131
131
  "oneOf": [
132
132
  {
@@ -134,22 +134,22 @@
134
134
  "properties": {
135
135
  "scripts": {
136
136
  "type": "boolean",
137
- "description": "Output sourcemaps for all scripts.",
137
+ "description": "Output source maps for all scripts.",
138
138
  "default": true
139
139
  },
140
140
  "styles": {
141
141
  "type": "boolean",
142
- "description": "Output sourcemaps for all styles.",
142
+ "description": "Output source maps for all styles.",
143
143
  "default": true
144
144
  },
145
145
  "hidden": {
146
146
  "type": "boolean",
147
- "description": "Output sourcemaps used for error reporting tools.",
147
+ "description": "Output source maps used for error reporting tools.",
148
148
  "default": false
149
149
  },
150
150
  "vendor": {
151
151
  "type": "boolean",
152
- "description": "Resolve vendor packages sourcemaps.",
152
+ "description": "Resolve vendor packages source maps.",
153
153
  "default": false
154
154
  }
155
155
  },
@@ -65,7 +65,7 @@ export interface Schema {
65
65
  open?: boolean;
66
66
  /**
67
67
  * Enables optimization of the build output. Including minification of scripts and styles,
68
- * tree-shaking, dead-code eliminiation, tree-shaking and fonts inlining. For more
68
+ * tree-shaking, dead-code elimination, tree-shaking and fonts inlining. For more
69
69
  * information, see
70
70
  * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
71
71
  * @deprecated Use the "optimization" option in the browser builder instead.
@@ -104,7 +104,7 @@ export interface Schema {
104
104
  */
105
105
  servePathDefaultWarning?: boolean;
106
106
  /**
107
- * Output sourcemaps.
107
+ * Output source maps.
108
108
  * @deprecated Use the "sourceMap" option in the browser builder instead.
109
109
  */
110
110
  sourceMap?: SourceMapUnion;
@@ -136,7 +136,7 @@ export interface Schema {
136
136
  }
137
137
  /**
138
138
  * Enables optimization of the build output. Including minification of scripts and styles,
139
- * tree-shaking, dead-code eliminiation, tree-shaking and fonts inlining. For more
139
+ * tree-shaking, dead-code elimination, tree-shaking and fonts inlining. For more
140
140
  * information, see
141
141
  * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
142
142
  * @deprecated Use the "optimization" option in the browser builder instead.
@@ -153,25 +153,25 @@ export interface OptimizationClass {
153
153
  styles?: boolean;
154
154
  }
155
155
  /**
156
- * Output sourcemaps.
156
+ * Output source maps.
157
157
  * @deprecated Use the "sourceMap" option in the browser builder instead.
158
158
  */
159
159
  export declare type SourceMapUnion = boolean | SourceMapClass;
160
160
  export interface SourceMapClass {
161
161
  /**
162
- * Output sourcemaps used for error reporting tools.
162
+ * Output source maps used for error reporting tools.
163
163
  */
164
164
  hidden?: boolean;
165
165
  /**
166
- * Output sourcemaps for all scripts.
166
+ * Output source maps for all scripts.
167
167
  */
168
168
  scripts?: boolean;
169
169
  /**
170
- * Output sourcemaps for all styles.
170
+ * Output source maps for all styles.
171
171
  */
172
172
  styles?: boolean;
173
173
  /**
174
- * Resolve vendor packages sourcemaps.
174
+ * Resolve vendor packages source maps.
175
175
  */
176
176
  vendor?: boolean;
177
177
  }
@@ -105,7 +105,7 @@
105
105
  "x-deprecated": "No longer has an effect."
106
106
  },
107
107
  "optimization": {
108
- "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code eliminiation, tree-shaking and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.",
108
+ "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, tree-shaking and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.",
109
109
  "x-user-analytics": 16,
110
110
  "oneOf": [
111
111
  {
@@ -137,29 +137,29 @@
137
137
  "x-deprecated": "Use the \"aot\" option in the browser builder instead."
138
138
  },
139
139
  "sourceMap": {
140
- "description": "Output sourcemaps.",
140
+ "description": "Output source maps.",
141
141
  "oneOf": [
142
142
  {
143
143
  "type": "object",
144
144
  "properties": {
145
145
  "scripts": {
146
146
  "type": "boolean",
147
- "description": "Output sourcemaps for all scripts.",
147
+ "description": "Output source maps for all scripts.",
148
148
  "default": true
149
149
  },
150
150
  "styles": {
151
151
  "type": "boolean",
152
- "description": "Output sourcemaps for all styles.",
152
+ "description": "Output source maps for all styles.",
153
153
  "default": true
154
154
  },
155
155
  "hidden": {
156
156
  "type": "boolean",
157
- "description": "Output sourcemaps used for error reporting tools.",
157
+ "description": "Output source maps used for error reporting tools.",
158
158
  "default": false
159
159
  },
160
160
  "vendor": {
161
161
  "type": "boolean",
162
- "description": "Resolve vendor packages sourcemaps.",
162
+ "description": "Resolve vendor packages source maps.",
163
163
  "default": false
164
164
  }
165
165
  },
@@ -65,7 +65,7 @@ export interface Schema {
65
65
  */
66
66
  scripts?: ExtraEntryPoint[];
67
67
  /**
68
- * Output sourcemaps.
68
+ * Output source maps.
69
69
  */
70
70
  sourceMap?: SourceMapUnion;
71
71
  /**
@@ -130,20 +130,20 @@ export interface ExtraEntryPointClass {
130
130
  input: string;
131
131
  }
132
132
  /**
133
- * Output sourcemaps.
133
+ * Output source maps.
134
134
  */
135
135
  export declare type SourceMapUnion = boolean | SourceMapClass;
136
136
  export interface SourceMapClass {
137
137
  /**
138
- * Output sourcemaps for all scripts.
138
+ * Output source maps for all scripts.
139
139
  */
140
140
  scripts?: boolean;
141
141
  /**
142
- * Output sourcemaps for all styles.
142
+ * Output source maps for all styles.
143
143
  */
144
144
  styles?: boolean;
145
145
  /**
146
- * Resolve vendor packages sourcemaps.
146
+ * Resolve vendor packages source maps.
147
147
  */
148
148
  vendor?: boolean;
149
149
  }
@@ -67,7 +67,7 @@
67
67
  "description": "Globs of files to include, relative to workspace or project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead"
68
68
  },
69
69
  "sourceMap": {
70
- "description": "Output sourcemaps.",
70
+ "description": "Output source maps.",
71
71
  "default": true,
72
72
  "oneOf": [
73
73
  {
@@ -75,17 +75,17 @@
75
75
  "properties": {
76
76
  "scripts": {
77
77
  "type": "boolean",
78
- "description": "Output sourcemaps for all scripts.",
78
+ "description": "Output source maps for all scripts.",
79
79
  "default": true
80
80
  },
81
81
  "styles": {
82
82
  "type": "boolean",
83
- "description": "Output sourcemaps for all styles.",
83
+ "description": "Output source maps for all styles.",
84
84
  "default": true
85
85
  },
86
86
  "vendor": {
87
87
  "type": "boolean",
88
- "description": "Resolve vendor packages sourcemaps.",
88
+ "description": "Resolve vendor packages source maps.",
89
89
  "default": false
90
90
  }
91
91
  },
@@ -44,7 +44,7 @@ function execute(options, context, transforms = {}) {
44
44
  context.logger.warn(core_1.tags.stripIndent `
45
45
  Warning: Turning off 'bundleDependencies' with Ivy may result in undefined behaviour
46
46
  unless 'node_modules' are transformed using the standalone Angular compatibility compiler (NGCC).
47
- See: http://v9.angular.io/guide/ivy#ivy-and-universal-app-shell
47
+ See: https://angular.io/guide/ivy#ivy-and-universal-app-shell
48
48
  `);
49
49
  }
50
50
  }
@@ -69,7 +69,7 @@ export interface Schema {
69
69
  namedChunks?: boolean;
70
70
  /**
71
71
  * Enables optimization of the build output. Including minification of scripts and styles,
72
- * tree-shaking and dead-code eliminiation. For more information, see
72
+ * tree-shaking and dead-code elimination. For more information, see
73
73
  * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
74
74
  */
75
75
  optimization?: OptimizationUnion;
@@ -103,7 +103,7 @@ export interface Schema {
103
103
  */
104
104
  showCircularDependencies?: boolean;
105
105
  /**
106
- * Output sourcemaps.
106
+ * Output source maps.
107
107
  */
108
108
  sourceMap?: SourceMapUnion;
109
109
  /**
@@ -157,7 +157,7 @@ export declare enum I18NMissingTranslation {
157
157
  export declare type Localize = string[] | boolean;
158
158
  /**
159
159
  * Enables optimization of the build output. Including minification of scripts and styles,
160
- * tree-shaking and dead-code eliminiation. For more information, see
160
+ * tree-shaking and dead-code elimination. For more information, see
161
161
  * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
162
162
  */
163
163
  export declare type OptimizationUnion = boolean | OptimizationClass;
@@ -181,24 +181,24 @@ export declare enum OutputHashing {
181
181
  None = "none"
182
182
  }
183
183
  /**
184
- * Output sourcemaps.
184
+ * Output source maps.
185
185
  */
186
186
  export declare type SourceMapUnion = boolean | SourceMapClass;
187
187
  export interface SourceMapClass {
188
188
  /**
189
- * Output sourcemaps used for error reporting tools.
189
+ * Output source maps used for error reporting tools.
190
190
  */
191
191
  hidden?: boolean;
192
192
  /**
193
- * Output sourcemaps for all scripts.
193
+ * Output source maps for all scripts.
194
194
  */
195
195
  scripts?: boolean;
196
196
  /**
197
- * Output sourcemaps for all styles.
197
+ * Output source maps for all styles.
198
198
  */
199
199
  styles?: boolean;
200
200
  /**
201
- * Resolve vendor packages sourcemaps.
201
+ * Resolve vendor packages source maps.
202
202
  */
203
203
  vendor?: boolean;
204
204
  }
@@ -29,7 +29,7 @@
29
29
  "additionalProperties": false
30
30
  },
31
31
  "optimization": {
32
- "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code eliminiation. For more information, see https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.",
32
+ "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code elimination. For more information, see https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.",
33
33
  "x-user-analytics": 16,
34
34
  "default": false,
35
35
  "oneOf": [
@@ -72,7 +72,7 @@
72
72
  "default": ""
73
73
  },
74
74
  "sourceMap": {
75
- "description": "Output sourcemaps.",
75
+ "description": "Output source maps.",
76
76
  "default": true,
77
77
  "oneOf": [
78
78
  {
@@ -80,22 +80,22 @@
80
80
  "properties": {
81
81
  "scripts": {
82
82
  "type": "boolean",
83
- "description": "Output sourcemaps for all scripts.",
83
+ "description": "Output source maps for all scripts.",
84
84
  "default": true
85
85
  },
86
86
  "styles": {
87
87
  "type": "boolean",
88
- "description": "Output sourcemaps for all styles.",
88
+ "description": "Output source maps for all styles.",
89
89
  "default": true
90
90
  },
91
91
  "hidden": {
92
92
  "type": "boolean",
93
- "description": "Output sourcemaps used for error reporting tools.",
93
+ "description": "Output source maps used for error reporting tools.",
94
94
  "default": false
95
95
  },
96
96
  "vendor": {
97
97
  "type": "boolean",
98
- "description": "Resolve vendor packages sourcemaps.",
98
+ "description": "Resolve vendor packages source maps.",
99
99
  "default": false
100
100
  }
101
101
  },
@@ -14,7 +14,13 @@ class Spinner {
14
14
  constructor(text) {
15
15
  /** When false, only fail messages will be displayed. */
16
16
  this.enabled = true;
17
- this.spinner = ora(text);
17
+ this.spinner = ora({
18
+ text,
19
+ // The below 2 options are needed because otherwise CTRL+C will be delayed
20
+ // when the underlying process is sync.
21
+ hideCursor: false,
22
+ discardStdin: false,
23
+ });
18
24
  }
19
25
  set text(text) {
20
26
  this.spinner.text = text;
@@ -333,6 +333,7 @@ function getCommonConfig(wco) {
333
333
  // See https://github.com/webpack/webpack/issues/2899#issuecomment-317425926.
334
334
  passes: buildOptions.buildOptimizer ? 3 : 1,
335
335
  global_defs: angularGlobalDefinitions,
336
+ pure_funcs: ['forwardRef'],
336
337
  }),
337
338
  // We also want to avoid mangling on server.
338
339
  // Name mangling is handled within the browser builder
@@ -432,7 +433,7 @@ function getCommonConfig(wco) {
432
433
  },
433
434
  {
434
435
  test: /\.m?js$/,
435
- exclude: [/[\/\\](?:core-js|\@babel|tslib)[\/\\]/, /(ngfactory|ngstyle)\.js$/],
436
+ exclude: [/[\/\\](?:core-js|\@babel|tslib|web-animations-js)[\/\\]/, /(ngfactory|ngstyle)\.js$/],
436
437
  use: [
437
438
  ...(wco.supportES2015
438
439
  ? []
@@ -40,6 +40,9 @@ function getStylesConfig(wco) {
40
40
  }
41
41
  catch (_a) { }
42
42
  }
43
+ if (!buildOptions.preserveSymlinks) {
44
+ resolvedPath = fs.realpathSync(resolvedPath);
45
+ }
43
46
  // Add style entry points.
44
47
  if (entryPoints[style.bundleName]) {
45
48
  entryPoints[style.bundleName].push(resolvedPath);
@@ -118,17 +121,10 @@ function getStylesConfig(wco) {
118
121
  {
119
122
  test: /\.styl$/,
120
123
  use: [
121
- {
122
- loader: require.resolve('resolve-url-loader'),
123
- options: {
124
- sourceMap: cssSourceMap,
125
- },
126
- },
127
124
  {
128
125
  loader: require.resolve('stylus-loader'),
129
126
  options: {
130
127
  sourceMap: cssSourceMap,
131
- webpackImporter: false,
132
128
  stylusOptions: {
133
129
  compress: false,
134
130
  sourceMap: { comment: false },
@@ -1,8 +1 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. 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
- */
8
1
  export {};
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * @license
4
- * Copyright Google Inc. 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
- */
9
- // tslint:disable
10
- // TODO: cleanup this file, it's copied as is from Angular CLI.
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  const path = require("path");
13
4
  const glob = require("glob");
@@ -25,6 +16,7 @@ const index_1 = require("../../utils/index");
25
16
  * require('source-map-support')
26
17
  * require('karma-source-map-support')
27
18
  */
19
+ const KARMA_APPLICATION_PATH = '_karma_webpack_';
28
20
  let blocked = [];
29
21
  let isBlocked = false;
30
22
  let webpackMiddleware;
@@ -79,8 +71,8 @@ const init = (config, emitter, customFileHandlers) => {
79
71
  config.plugins = config.plugins || [];
80
72
  config.reporters = config.reporters || [];
81
73
  const { plugins, reporters } = config;
82
- const hasCoveragePlugin = plugins.some((p) => 'reporter:coverage' in p);
83
- const hasIstanbulPlugin = plugins.some((p) => 'reporter:coverage-istanbul' in p);
74
+ const hasCoveragePlugin = plugins.some(isPlugin('karma-coverage', 'reporter:coverage'));
75
+ const hasIstanbulPlugin = plugins.some(isPlugin('karma-coverage-istanbul-reporter', 'reporter:coverage-istanbul'));
84
76
  const hasCoverageReporter = reporters.includes('coverage');
85
77
  const hasIstanbulReporter = reporters.includes('coverage-istanbul');
86
78
  if (hasCoveragePlugin && !hasCoverageReporter) {
@@ -106,7 +98,7 @@ const init = (config, emitter, customFileHandlers) => {
106
98
  // Hide webpack output because its noisy.
107
99
  logLevel: 'error',
108
100
  stats: false,
109
- publicPath: '/_karma_webpack_/',
101
+ publicPath: `/${KARMA_APPLICATION_PATH}/`,
110
102
  };
111
103
  const compilationErrorCb = (error, errors) => {
112
104
  // Notify potential listeners of the compile error
@@ -143,8 +135,8 @@ const init = (config, emitter, customFileHandlers) => {
143
135
  });
144
136
  }
145
137
  // Files need to be served from a custom path for Karma.
146
- webpackConfig.output.path = '/_karma_webpack_/';
147
- webpackConfig.output.publicPath = '/_karma_webpack_/';
138
+ webpackConfig.output.path = `/${KARMA_APPLICATION_PATH}/`;
139
+ webpackConfig.output.publicPath = `/${KARMA_APPLICATION_PATH}/`;
148
140
  let compiler;
149
141
  try {
150
142
  compiler = webpack(webpackConfig);
@@ -191,18 +183,18 @@ const init = (config, emitter, customFileHandlers) => {
191
183
  webpackMiddleware = new webpackDevMiddleware(compiler, webpackMiddlewareConfig);
192
184
  // Forward requests to webpack server.
193
185
  customFileHandlers.push({
194
- urlRegex: /^\/_karma_webpack_\/.*/,
186
+ urlRegex: new RegExp(`\\/${KARMA_APPLICATION_PATH}\\/.*`),
195
187
  handler: function handler(req, res) {
196
188
  webpackMiddleware(req, res, function () {
197
189
  // Ensure script and style bundles are served.
198
190
  // They are mentioned in the custom karma context page and we don't want them to 404.
199
191
  const alwaysServe = [
200
- '/_karma_webpack_/runtime.js',
201
- '/_karma_webpack_/polyfills.js',
202
- '/_karma_webpack_/polyfills-es5.js',
203
- '/_karma_webpack_/scripts.js',
204
- '/_karma_webpack_/styles.js',
205
- '/_karma_webpack_/vendor.js',
192
+ `/${KARMA_APPLICATION_PATH}/runtime.js`,
193
+ `/${KARMA_APPLICATION_PATH}/polyfills.js`,
194
+ `/${KARMA_APPLICATION_PATH}/polyfills-es5.js`,
195
+ `/${KARMA_APPLICATION_PATH}/scripts.js`,
196
+ `/${KARMA_APPLICATION_PATH}/styles.js`,
197
+ `/${KARMA_APPLICATION_PATH}/vendor.js`,
206
198
  ];
207
199
  if (alwaysServe.indexOf(req.url) != -1) {
208
200
  res.statusCode = 200;
@@ -281,17 +273,31 @@ const sourceMapReporter = function (baseReporterDecorator, config) {
281
273
  sourceMapReporter.$inject = ['baseReporterDecorator', 'config'];
282
274
  // When a request is not found in the karma server, try looking for it from the webpack server root.
283
275
  function fallbackMiddleware() {
284
- return function (req, res, next) {
276
+ return function (request, response, next) {
285
277
  if (webpackMiddleware) {
286
- const webpackUrl = '/_karma_webpack_' + req.url;
287
- const webpackReq = { ...req, url: webpackUrl };
288
- webpackMiddleware(webpackReq, res, next);
278
+ request.url = '/' + KARMA_APPLICATION_PATH + request.url;
279
+ webpackMiddleware(request, response, next);
289
280
  }
290
281
  else {
291
282
  next();
292
283
  }
293
284
  };
294
285
  }
286
+ /**
287
+ * Returns a function that returns true if the plugin identifier matches the
288
+ * `moduleId` or `pluginName`. A plugin identifier can be either a string or
289
+ * an object according to https://karma-runner.github.io/5.2/config/plugins.html
290
+ * @param moduleId name of the node module (e.g. karma-coverage)
291
+ * @param pluginName name of the karma plugin (e.g. reporter:coverage)
292
+ */
293
+ function isPlugin(moduleId, pluginName) {
294
+ return (plugin) => {
295
+ if (typeof plugin === 'string') {
296
+ return plugin === moduleId;
297
+ }
298
+ return pluginName in plugin;
299
+ };
300
+ }
295
301
  module.exports = {
296
302
  'framework:@angular-devkit/build-angular': ['factory', init],
297
303
  'reporter:@angular-devkit/build-angular--sourcemap-reporter': ['type', sourceMapReporter],
@@ -95,7 +95,7 @@ class OptimizeCssWebpackPlugin {
95
95
  // tslint:disable-next-line: no-any
96
96
  cssNano.process(content, postCssOptions, cssNanoOptions)
97
97
  .then(resolve)
98
- .catch(reject);
98
+ .catch((err) => reject(new Error(`${file} ${err.message}`)));
99
99
  });
100
100
  for (const { text } of output.warnings()) {
101
101
  webpack_diagnostics_1.addWarning(compilation, text);