@angular-devkit/build-angular 0.1100.1 → 0.1100.5

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.1",
3
+ "version": "0.1100.5",
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.1",
11
- "@angular-devkit/build-optimizer": "0.1100.1",
12
- "@angular-devkit/build-webpack": "0.1100.1",
13
- "@angular-devkit/core": "11.0.1",
10
+ "@angular-devkit/architect": "0.1100.5",
11
+ "@angular-devkit/build-optimizer": "0.1100.5",
12
+ "@angular-devkit/build-webpack": "0.1100.5",
13
+ "@angular-devkit/core": "11.0.5",
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.1",
21
+ "@ngtools/webpack": "11.0.5",
22
22
  "ansi-colors": "4.1.1",
23
23
  "autoprefixer": "9.8.6",
24
24
  "babel-loader": "8.1.0",
@@ -28,7 +28,7 @@
28
28
  "circular-dependency-plugin": "5.2.0",
29
29
  "copy-webpack-plugin": "6.2.1",
30
30
  "core-js": "3.6.5",
31
- "css-loader": "5.0.0",
31
+ "css-loader": "4.3.0",
32
32
  "cssnano": "4.1.10",
33
33
  "file-loader": "6.1.1",
34
34
  "find-cache-dir": "3.3.1",
@@ -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",
@@ -78,10 +78,10 @@
78
78
  "worker-plugin": "5.0.0"
79
79
  },
80
80
  "peerDependencies": {
81
- "@angular/compiler-cli": "^11.0.0 || ^11.0.0-next",
82
- "@angular/localize": "^11.0.0 || ^11.0.0-next",
81
+ "@angular/compiler-cli": "^11.0.0",
82
+ "@angular/localize": "^11.0.0",
83
83
  "karma": "~5.1.0",
84
- "ng-packagr": "^11.0.0 || ^11.0.0-next",
84
+ "ng-packagr": "^11.0.0",
85
85
  "protractor": "^7.0.0",
86
86
  "tslint": "^6.1.0",
87
87
  "typescript": "~4.0.0"
@@ -103,11 +103,6 @@
103
103
  "optional": true
104
104
  }
105
105
  },
106
- "ng-update": {
107
- "packageGroup": {
108
- "codelyzer": "^6.0.0"
109
- }
110
- },
111
106
  "keywords": [
112
107
  "angular",
113
108
  "Angular CLI",
@@ -129,11 +124,5 @@
129
124
  "bugs": {
130
125
  "url": "https://github.com/angular/angular-cli/issues"
131
126
  },
132
- "homepage": "https://github.com/angular/angular-cli",
133
- "husky": {
134
- "hooks": {
135
- "commit-msg": "yarn -s ng-dev commit-message pre-commit-validate --file-env-variable HUSKY_GIT_PARAMS",
136
- "prepare-commit-msg": "yarn -s ng-dev commit-message restore-commit-message-draft --file-env-variable HUSKY_GIT_PARAMS"
137
- }
138
- }
127
+ "homepage": "https://github.com/angular/angular-cli"
139
128
  }
@@ -9,7 +9,9 @@ export interface Schema {
9
9
  */
10
10
  appModuleBundle?: string;
11
11
  /**
12
- * Target to build.
12
+ * A browser builder target use for rendering the app shell in the format of
13
+ * `project:target[:configuration]`. You can also pass in more than one configuration name
14
+ * as a comma-separated list. Example: `project:target:production,staging`.
13
15
  */
14
16
  browserTarget: string;
15
17
  /**
@@ -26,7 +28,9 @@ export interface Schema {
26
28
  */
27
29
  route?: string;
28
30
  /**
29
- * Server target to use for rendering the app shell.
31
+ * A server builder target use for rendering the app shell in the format of
32
+ * `project:target[:configuration]`. You can also pass in more than one configuration name
33
+ * as a comma-separated list. Example: `project:target:production,staging`.
30
34
  */
31
35
  serverTarget: string;
32
36
  }
@@ -6,12 +6,12 @@
6
6
  "properties": {
7
7
  "browserTarget": {
8
8
  "type": "string",
9
- "description": "Target to build.",
9
+ "description": "A browser builder target use for rendering the app shell in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
10
10
  "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
11
11
  },
12
12
  "serverTarget": {
13
13
  "type": "string",
14
- "description": "Server target to use for rendering the app shell.",
14
+ "description": "A server builder target use for rendering the app shell in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
15
15
  "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
16
16
  },
17
17
  "appModuleBundle": {
@@ -95,6 +95,9 @@ export interface Schema {
95
95
  * 'import()' syntax instead.
96
96
  */
97
97
  lazyModules?: string[];
98
+ /**
99
+ * Translate the bundles in one or more locales.
100
+ */
98
101
  localize?: Localize;
99
102
  /**
100
103
  * The full path for the main entry point to the app, relative to the current workspace.
@@ -109,7 +112,9 @@ export interface Schema {
109
112
  */
110
113
  ngswConfigPath?: string;
111
114
  /**
112
- * Enables optimization of the build output.
115
+ * Enables optimization of the build output. Including minification of scripts and styles,
116
+ * tree-shaking, dead-code elimination and fonts inlining. For more information, see
117
+ * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
113
118
  */
114
119
  optimization?: OptimizationUnion;
115
120
  /**
@@ -156,7 +161,7 @@ export interface Schema {
156
161
  */
157
162
  showCircularDependencies?: boolean;
158
163
  /**
159
- * Output sourcemaps.
164
+ * Output source maps.
160
165
  */
161
166
  sourceMap?: SourceMapUnion;
162
167
  /**
@@ -303,9 +308,14 @@ export interface IndexObject {
303
308
  */
304
309
  output?: string;
305
310
  }
311
+ /**
312
+ * Translate the bundles in one or more locales.
313
+ */
306
314
  export declare type Localize = string[] | boolean;
307
315
  /**
308
- * Enables optimization of the build output.
316
+ * Enables optimization of the build output. Including minification of scripts and styles,
317
+ * tree-shaking, dead-code elimination and fonts inlining. For more information, see
318
+ * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
309
319
  */
310
320
  export declare type OptimizationUnion = boolean | OptimizationClass;
311
321
  export interface OptimizationClass {
@@ -328,8 +338,8 @@ export interface OptimizationClass {
328
338
  export declare type FontsUnion = boolean | FontsClass;
329
339
  export interface FontsClass {
330
340
  /**
331
- * Reduce render blocking requests by inlining external fonts in the application's HTML
332
- * 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.
333
343
  */
334
344
  inline?: boolean;
335
345
  }
@@ -358,24 +368,24 @@ export interface ExtraEntryPointClass {
358
368
  input: string;
359
369
  }
360
370
  /**
361
- * Output sourcemaps.
371
+ * Output source maps.
362
372
  */
363
373
  export declare type SourceMapUnion = boolean | SourceMapClass;
364
374
  export interface SourceMapClass {
365
375
  /**
366
- * Output sourcemaps used for error reporting tools.
376
+ * Output source maps used for error reporting tools.
367
377
  */
368
378
  hidden?: boolean;
369
379
  /**
370
- * Output sourcemaps for all scripts.
380
+ * Output source maps for all scripts.
371
381
  */
372
382
  scripts?: boolean;
373
383
  /**
374
- * Output sourcemaps for all styles.
384
+ * Output source maps for all styles.
375
385
  */
376
386
  styles?: boolean;
377
387
  /**
378
- * Resolve vendor packages sourcemaps.
388
+ * Resolve vendor packages source maps.
379
389
  */
380
390
  vendor?: boolean;
381
391
  }
@@ -57,7 +57,7 @@
57
57
  "additionalProperties": false
58
58
  },
59
59
  "optimization": {
60
- "description": "Enables optimization of the build output.",
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
  },
@@ -210,6 +210,7 @@
210
210
  "default": "warning"
211
211
  },
212
212
  "localize": {
213
+ "description": "Translate the bundles in one or more locales.",
213
214
  "oneOf": [
214
215
  {
215
216
  "type": "boolean",
@@ -429,11 +430,11 @@
429
430
  "properties": {
430
431
  "src": {
431
432
  "type": "string",
432
- "pattern": "\\.([cm]?j|t)sx?$"
433
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
433
434
  },
434
435
  "replaceWith": {
435
436
  "type": "string",
436
- "pattern": "\\.([cm]?j|t)sx?$"
437
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
437
438
  }
438
439
  },
439
440
  "additionalProperties": false,
@@ -447,11 +448,11 @@
447
448
  "properties": {
448
449
  "replace": {
449
450
  "type": "string",
450
- "pattern": "\\.([cm]?j|t)sx?$"
451
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
451
452
  },
452
453
  "with": {
453
454
  "type": "string",
454
- "pattern": "\\.([cm]?j|t)sx?$"
455
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
455
456
  }
456
457
  },
457
458
  "additionalProperties": false,
@@ -19,6 +19,7 @@ const ts = require("typescript");
19
19
  const url = require("url");
20
20
  const webpackDevServer = require("webpack-dev-server");
21
21
  const browser_1 = require("../browser");
22
+ const schema_1 = require("../browser/schema");
22
23
  const utils_1 = require("../utils");
23
24
  const cache_path_1 = require("../utils/cache-path");
24
25
  const check_port_1 = require("../utils/check-port");
@@ -64,7 +65,7 @@ function serveWebpackBrowser(options, context, transforms = {}) {
64
65
  async function setup() {
65
66
  var _a;
66
67
  // Get the browser configuration from the target name.
67
- const rawBrowserOptions = await context.getTargetOptions(browserTarget);
68
+ const rawBrowserOptions = (await context.getTargetOptions(browserTarget));
68
69
  options.port = await check_port_1.checkPort((_a = options.port) !== null && _a !== void 0 ? _a : 4200, options.host || 'localhost');
69
70
  // Override options we need to override, if defined.
70
71
  const overrides = Object.keys(options)
@@ -82,6 +83,12 @@ function serveWebpackBrowser(options, context, transforms = {}) {
82
83
  }), {});
83
84
  // In dev server we should not have budgets because of extra libs such as socks-js
84
85
  overrides.budgets = undefined;
86
+ if (rawBrowserOptions.outputHashing && rawBrowserOptions.outputHashing !== schema_1.OutputHashing.None) {
87
+ // Disable output hashing for dev build as this can cause memory leaks
88
+ // See: https://github.com/webpack/webpack-dev-server/issues/377#issuecomment-241258405
89
+ overrides.outputHashing = schema_1.OutputHashing.None;
90
+ logger.warn(`Warning: 'outputHashing' option is disabled when using the dev-server.`);
91
+ }
85
92
  const browserName = await context.getBuilderNameForTarget(browserTarget);
86
93
  const browserOptions = await context.validateOptions({ ...rawBrowserOptions, ...overrides }, browserName);
87
94
  const { config, projectRoot, i18n } = await webpack_browser_config_1.generateI18nBrowserWebpackConfigFromContext(browserOptions, context, wco => [
@@ -17,7 +17,9 @@ export interface Schema {
17
17
  */
18
18
  baseHref?: string;
19
19
  /**
20
- * Target to serve.
20
+ * A browser builder target to serve in the format of `project:target[:configuration]`. You
21
+ * can also pass in more than one configuration name as a comma-separated list. Example:
22
+ * `project:target:production,staging`.
21
23
  */
22
24
  browserTarget: string;
23
25
  /**
@@ -62,7 +64,10 @@ export interface Schema {
62
64
  */
63
65
  open?: boolean;
64
66
  /**
65
- * Enables optimization of the build output.
67
+ * Enables optimization of the build output. Including minification of scripts and styles,
68
+ * tree-shaking, dead-code elimination, tree-shaking and fonts inlining. For more
69
+ * information, see
70
+ * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
66
71
  * @deprecated Use the "optimization" option in the browser builder instead.
67
72
  */
68
73
  optimization?: OptimizationUnion;
@@ -99,7 +104,7 @@ export interface Schema {
99
104
  */
100
105
  servePathDefaultWarning?: boolean;
101
106
  /**
102
- * Output sourcemaps.
107
+ * Output source maps.
103
108
  * @deprecated Use the "sourceMap" option in the browser builder instead.
104
109
  */
105
110
  sourceMap?: SourceMapUnion;
@@ -130,7 +135,10 @@ export interface Schema {
130
135
  watch?: boolean;
131
136
  }
132
137
  /**
133
- * Enables optimization of the build output.
138
+ * Enables optimization of the build output. Including minification of scripts and styles,
139
+ * tree-shaking, dead-code elimination, tree-shaking and fonts inlining. For more
140
+ * information, see
141
+ * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
134
142
  * @deprecated Use the "optimization" option in the browser builder instead.
135
143
  */
136
144
  export declare type OptimizationUnion = boolean | OptimizationClass;
@@ -145,25 +153,25 @@ export interface OptimizationClass {
145
153
  styles?: boolean;
146
154
  }
147
155
  /**
148
- * Output sourcemaps.
156
+ * Output source maps.
149
157
  * @deprecated Use the "sourceMap" option in the browser builder instead.
150
158
  */
151
159
  export declare type SourceMapUnion = boolean | SourceMapClass;
152
160
  export interface SourceMapClass {
153
161
  /**
154
- * Output sourcemaps used for error reporting tools.
162
+ * Output source maps used for error reporting tools.
155
163
  */
156
164
  hidden?: boolean;
157
165
  /**
158
- * Output sourcemaps for all scripts.
166
+ * Output source maps for all scripts.
159
167
  */
160
168
  scripts?: boolean;
161
169
  /**
162
- * Output sourcemaps for all styles.
170
+ * Output source maps for all styles.
163
171
  */
164
172
  styles?: boolean;
165
173
  /**
166
- * Resolve vendor packages sourcemaps.
174
+ * Resolve vendor packages source maps.
167
175
  */
168
176
  vendor?: boolean;
169
177
  }
@@ -6,7 +6,7 @@
6
6
  "properties": {
7
7
  "browserTarget": {
8
8
  "type": "string",
9
- "description": "Target to serve.",
9
+ "description": "A browser builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
10
10
  "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
11
11
  },
12
12
  "port": {
@@ -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.",
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
  },
@@ -3,7 +3,9 @@
3
3
  */
4
4
  export interface Schema {
5
5
  /**
6
- * Target to extract from.
6
+ * A browser builder target to extract i18n messages in the format of
7
+ * `project:target[:configuration]`. You can also pass in more than one configuration name
8
+ * as a comma-separated list. Example: `project:target:production,staging`.
7
9
  */
8
10
  browserTarget: string;
9
11
  /**
@@ -6,7 +6,7 @@
6
6
  "properties": {
7
7
  "browserTarget": {
8
8
  "type": "string",
9
- "description": "Target to extract from.",
9
+ "description": "A browser builder target to extract i18n messages in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
10
10
  "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
11
11
  },
12
12
  "format": {
@@ -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
  },
@@ -7,7 +7,9 @@ export interface Schema {
7
7
  */
8
8
  baseUrl?: string;
9
9
  /**
10
- * Dev server target to run tests against.
10
+ * A dev-server builder target to run tests against in the format of
11
+ * `project:target[:configuration]`. You can also pass in more than one configuration name
12
+ * as a comma-separated list. Example: `project:target:production,staging`.
11
13
  */
12
14
  devServerTarget?: string;
13
15
  /**
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "devServerTarget": {
12
12
  "type": "string",
13
- "description": "Dev server target to run tests against.",
13
+ "description": "A dev-server builder target to run tests against in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
14
14
  "pattern": "^([^:\\s]+:[^:\\s]+(:[^\\s]+)?)?$"
15
15
  },
16
16
  "grep": {
@@ -55,6 +55,9 @@ export interface Schema {
55
55
  * 'import()' syntax instead.
56
56
  */
57
57
  lazyModules?: string[];
58
+ /**
59
+ * Translate the bundles in one or more locales.
60
+ */
58
61
  localize?: Localize;
59
62
  /**
60
63
  * The name of the main entry-point file.
@@ -65,7 +68,9 @@ export interface Schema {
65
68
  */
66
69
  namedChunks?: boolean;
67
70
  /**
68
- * Enables optimization of the build output.
71
+ * Enables optimization of the build output. Including minification of scripts and styles,
72
+ * tree-shaking and dead-code elimination. For more information, see
73
+ * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
69
74
  */
70
75
  optimization?: OptimizationUnion;
71
76
  /**
@@ -98,7 +103,7 @@ export interface Schema {
98
103
  */
99
104
  showCircularDependencies?: boolean;
100
105
  /**
101
- * Output sourcemaps.
106
+ * Output source maps.
102
107
  */
103
108
  sourceMap?: SourceMapUnion;
104
109
  /**
@@ -146,9 +151,14 @@ export declare enum I18NMissingTranslation {
146
151
  Ignore = "ignore",
147
152
  Warning = "warning"
148
153
  }
154
+ /**
155
+ * Translate the bundles in one or more locales.
156
+ */
149
157
  export declare type Localize = string[] | boolean;
150
158
  /**
151
- * Enables optimization of the build output.
159
+ * Enables optimization of the build output. Including minification of scripts and styles,
160
+ * tree-shaking and dead-code elimination. For more information, see
161
+ * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
152
162
  */
153
163
  export declare type OptimizationUnion = boolean | OptimizationClass;
154
164
  export interface OptimizationClass {
@@ -171,24 +181,24 @@ export declare enum OutputHashing {
171
181
  None = "none"
172
182
  }
173
183
  /**
174
- * Output sourcemaps.
184
+ * Output source maps.
175
185
  */
176
186
  export declare type SourceMapUnion = boolean | SourceMapClass;
177
187
  export interface SourceMapClass {
178
188
  /**
179
- * Output sourcemaps used for error reporting tools.
189
+ * Output source maps used for error reporting tools.
180
190
  */
181
191
  hidden?: boolean;
182
192
  /**
183
- * Output sourcemaps for all scripts.
193
+ * Output source maps for all scripts.
184
194
  */
185
195
  scripts?: boolean;
186
196
  /**
187
- * Output sourcemaps for all styles.
197
+ * Output source maps for all styles.
188
198
  */
189
199
  styles?: boolean;
190
200
  /**
191
- * Resolve vendor packages sourcemaps.
201
+ * Resolve vendor packages source maps.
192
202
  */
193
203
  vendor?: boolean;
194
204
  }
@@ -29,7 +29,7 @@
29
29
  "additionalProperties": false
30
30
  },
31
31
  "optimization": {
32
- "description": "Enables optimization of the build output.",
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
  },
@@ -142,6 +142,7 @@
142
142
  "default": "warning"
143
143
  },
144
144
  "localize": {
145
+ "description": "Translate the bundles in one or more locales.",
145
146
  "oneOf": [
146
147
  {
147
148
  "type": "boolean",
@@ -260,11 +261,11 @@
260
261
  "properties": {
261
262
  "src": {
262
263
  "type": "string",
263
- "pattern": "\\.([cm]?j|t)sx?$"
264
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
264
265
  },
265
266
  "replaceWith": {
266
267
  "type": "string",
267
- "pattern": "\\.([cm]?j|t)sx?$"
268
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
268
269
  }
269
270
  },
270
271
  "additionalProperties": false,
@@ -278,11 +279,11 @@
278
279
  "properties": {
279
280
  "replace": {
280
281
  "type": "string",
281
- "pattern": "\\.([cm]?j|t)sx?$"
282
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
282
283
  },
283
284
  "with": {
284
285
  "type": "string",
285
- "pattern": "\\.([cm]?j|t)sx?$"
286
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
286
287
  }
287
288
  },
288
289
  "additionalProperties": false,
@@ -41,7 +41,7 @@ async function augmentIndexHtml(params) {
41
41
  }
42
42
  }
43
43
  }
44
- const scriptTags = [];
44
+ let scriptTags = [];
45
45
  for (const script of scripts) {
46
46
  const attrs = [`src="${deployUrl}${script}"`];
47
47
  if (crossOrigin !== 'none') {
@@ -75,7 +75,7 @@ async function augmentIndexHtml(params) {
75
75
  }
76
76
  scriptTags.push(`<script ${attrs.join(' ')}></script>`);
77
77
  }
78
- const linkTags = [];
78
+ let linkTags = [];
79
79
  for (const stylesheet of stylesheets) {
80
80
  const attrs = [
81
81
  `rel="stylesheet"`,
@@ -124,17 +124,24 @@ async function augmentIndexHtml(params) {
124
124
  for (const linkTag of linkTags) {
125
125
  rewriter.emitRaw(linkTag);
126
126
  }
127
+ linkTags = [];
127
128
  break;
128
129
  case 'body':
129
130
  // Add script tags
130
131
  for (const scriptTag of scriptTags) {
131
132
  rewriter.emitRaw(scriptTag);
132
133
  }
134
+ scriptTags = [];
133
135
  break;
134
136
  }
135
137
  rewriter.emitEndTag(tag);
136
138
  });
137
- return transformedContent;
139
+ const content = await transformedContent;
140
+ if (linkTags.length || scriptTags.length) {
141
+ // In case no body/head tags are not present (dotnet partial templates)
142
+ return linkTags.join('') + scriptTags.join('') + content;
143
+ }
144
+ return content;
138
145
  }
139
146
  exports.augmentIndexHtml = augmentIndexHtml;
140
147
  function generateSriAttributes(content) {
@@ -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
@@ -30,6 +30,9 @@ function getDevServerConfig(wco) {
30
30
  const parsedHost = url.parse(publicHost);
31
31
  publicHost = parsedHost.host;
32
32
  }
33
+ else {
34
+ publicHost = '0.0.0.0:0';
35
+ }
33
36
  if (!watch) {
34
37
  // There's no option to turn off file watching in webpack-dev-server, but
35
38
  // we can override the file watcher instead.
@@ -118,17 +118,10 @@ function getStylesConfig(wco) {
118
118
  {
119
119
  test: /\.styl$/,
120
120
  use: [
121
- {
122
- loader: require.resolve('resolve-url-loader'),
123
- options: {
124
- sourceMap: cssSourceMap,
125
- },
126
- },
127
121
  {
128
122
  loader: require.resolve('stylus-loader'),
129
123
  options: {
130
124
  sourceMap: cssSourceMap,
131
- webpackImporter: false,
132
125
  stylusOptions: {
133
126
  compress: false,
134
127
  sourceMap: { comment: false },
@@ -198,7 +191,7 @@ function getStylesConfig(wco) {
198
191
  }));
199
192
  // load global css as css files
200
193
  if (globalStylePaths.length > 0) {
201
- const globalSourceMap = !!(cssSourceMap && !buildOptions.extractCss && !buildOptions.sourceMap.hidden);
194
+ const globalSourceMap = !!cssSourceMap && !buildOptions.sourceMap.hidden;
202
195
  rules.push(...baseRules.map(({ test, use }) => {
203
196
  return {
204
197
  include: globalStylePaths,
@@ -34,7 +34,8 @@ function default_1(mod) {
34
34
  if (!appRef) {
35
35
  return;
36
36
  }
37
- const oldInputs = document.querySelectorAll('input, textarea');
37
+ // Inputs that are hidden should be ignored
38
+ const oldInputs = document.querySelectorAll('input:not([type="hidden"]), textarea');
38
39
  const oldOptions = document.querySelectorAll('option');
39
40
  // Create new application
40
41
  appRef.components
@@ -115,8 +116,8 @@ function dispatchEvents(element) {
115
116
  element.dispatchEvent(new KeyboardEvent('keyup', { key: 'Enter' }));
116
117
  }
117
118
  function restoreFormValues(oldInputs, oldOptions) {
118
- // Restore input
119
- const newInputs = document.querySelectorAll('input, textarea');
119
+ // Restore input that are not hidden
120
+ const newInputs = document.querySelectorAll('input:not([type="hidden"]), textarea');
120
121
  if (newInputs.length && newInputs.length === oldInputs.length) {
121
122
  console.log('[NG HMR] Restoring input/textarea values.');
122
123
  for (let index = 0; index < newInputs.length; index++) {
@@ -79,8 +79,8 @@ const init = (config, emitter, customFileHandlers) => {
79
79
  config.plugins = config.plugins || [];
80
80
  config.reporters = config.reporters || [];
81
81
  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);
82
+ const hasCoveragePlugin = plugins.some(isPlugin('karma-coverage', 'reporter:coverage'));
83
+ const hasIstanbulPlugin = plugins.some(isPlugin('karma-coverage-istanbul-reporter', 'reporter:coverage-istanbul'));
84
84
  const hasCoverageReporter = reporters.includes('coverage');
85
85
  const hasIstanbulReporter = reporters.includes('coverage-istanbul');
86
86
  if (hasCoveragePlugin && !hasCoverageReporter) {
@@ -292,6 +292,21 @@ function fallbackMiddleware() {
292
292
  }
293
293
  };
294
294
  }
295
+ /**
296
+ * Returns a function that returns true if the plugin identifier matches the
297
+ * `moduleId` or `pluginName`. A plugin identifier can be either a string or
298
+ * an object according to https://karma-runner.github.io/5.2/config/plugins.html
299
+ * @param moduleId name of the node module (e.g. karma-coverage)
300
+ * @param pluginName name of the karma plugin (e.g. reporter:coverage)
301
+ */
302
+ function isPlugin(moduleId, pluginName) {
303
+ return (plugin) => {
304
+ if (typeof plugin === 'string') {
305
+ return plugin === moduleId;
306
+ }
307
+ return pluginName in plugin;
308
+ };
309
+ }
295
310
  module.exports = {
296
311
  'framework:@angular-devkit/build-angular': ['factory', init],
297
312
  '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);