@angular-devkit/build-angular 0.1100.2 → 0.1100.3

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.2",
3
+ "version": "0.1100.3",
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.2",
11
- "@angular-devkit/build-optimizer": "0.1100.2",
12
- "@angular-devkit/build-webpack": "0.1100.2",
13
- "@angular-devkit/core": "11.0.2",
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",
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.2",
21
+ "@ngtools/webpack": "11.0.3",
22
22
  "ansi-colors": "4.1.1",
23
23
  "autoprefixer": "9.8.6",
24
24
  "babel-loader": "8.1.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"
@@ -124,11 +124,5 @@
124
124
  "bugs": {
125
125
  "url": "https://github.com/angular/angular-cli/issues"
126
126
  },
127
- "homepage": "https://github.com/angular/angular-cli",
128
- "husky": {
129
- "hooks": {
130
- "commit-msg": "yarn -s ng-dev commit-message pre-commit-validate --file-env-variable HUSKY_GIT_PARAMS",
131
- "prepare-commit-msg": "yarn -s ng-dev commit-message restore-commit-message-draft --file-env-variable HUSKY_GIT_PARAMS"
132
- }
133
- }
127
+ "homepage": "https://github.com/angular/angular-cli"
134
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 eliminiation 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
  /**
@@ -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 eliminiation 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 {
@@ -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 eliminiation 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": [
@@ -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",
@@ -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 eliminiation, 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;
@@ -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 eliminiation, 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;
@@ -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 eliminiation, 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
  {
@@ -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": {
@@ -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 eliminiation. For more information, see
73
+ * https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.
69
74
  */
70
75
  optimization?: OptimizationUnion;
71
76
  /**
@@ -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 eliminiation. 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 {
@@ -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 eliminiation. 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": [
@@ -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",
@@ -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) {
@@ -198,7 +198,7 @@ function getStylesConfig(wco) {
198
198
  }));
199
199
  // load global css as css files
200
200
  if (globalStylePaths.length > 0) {
201
- const globalSourceMap = !!(cssSourceMap && !buildOptions.extractCss && !buildOptions.sourceMap.hidden);
201
+ const globalSourceMap = !!cssSourceMap && !buildOptions.sourceMap.hidden;
202
202
  rules.push(...baseRules.map(({ test, use }) => {
203
203
  return {
204
204
  include: globalStylePaths,