@angular-devkit/build-angular 14.0.0-next.1 → 14.0.0-next.12

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/README.md +10 -10
  2. package/builders.json +5 -0
  3. package/package.json +33 -34
  4. package/src/babel/plugins/pure-toplevel-functions.js +5 -1
  5. package/src/babel/presets/application.js +5 -1
  6. package/src/babel/webpack-loader.d.ts +1 -0
  7. package/src/babel/webpack-loader.js +2 -0
  8. package/src/builders/app-shell/index.js +8 -4
  9. package/src/builders/app-shell/schema.d.ts +2 -2
  10. package/src/builders/app-shell/schema.json +2 -2
  11. package/src/builders/browser/index.d.ts +2 -3
  12. package/src/builders/browser/index.js +13 -10
  13. package/src/builders/browser/schema.d.ts +0 -1
  14. package/src/builders/browser/schema.json +2 -3
  15. package/src/builders/browser-esbuild/compiler-plugin.d.ts +14 -0
  16. package/src/builders/browser-esbuild/compiler-plugin.js +338 -0
  17. package/src/builders/browser-esbuild/esbuild.d.ts +34 -0
  18. package/src/builders/browser-esbuild/esbuild.js +59 -0
  19. package/src/builders/browser-esbuild/experimental-warnings.d.ts +10 -0
  20. package/src/builders/browser-esbuild/experimental-warnings.js +65 -0
  21. package/src/builders/browser-esbuild/index.d.ts +19 -0
  22. package/src/builders/browser-esbuild/index.js +258 -0
  23. package/src/builders/browser-esbuild/options.d.ts +34 -0
  24. package/src/builders/browser-esbuild/options.js +87 -0
  25. package/src/builders/browser-esbuild/stylesheets.d.ts +52 -0
  26. package/src/builders/browser-esbuild/stylesheets.js +118 -0
  27. package/src/builders/dev-server/index.d.ts +1 -1
  28. package/src/builders/dev-server/index.js +5 -1
  29. package/src/builders/dev-server/schema.d.ts +1 -1
  30. package/src/builders/dev-server/schema.json +1 -1
  31. package/src/builders/extract-i18n/index.d.ts +1 -1
  32. package/src/builders/extract-i18n/index.js +5 -1
  33. package/src/builders/extract-i18n/ivy-extract-loader.js +5 -1
  34. package/src/builders/karma/find-tests.js +5 -1
  35. package/src/builders/karma/index.d.ts +1 -1
  36. package/src/builders/karma/index.js +10 -6
  37. package/src/builders/ng-packagr/index.js +5 -1
  38. package/src/builders/protractor/index.d.ts +2 -1
  39. package/src/builders/protractor/index.js +5 -1
  40. package/src/builders/server/index.d.ts +2 -3
  41. package/src/builders/server/index.js +5 -1
  42. package/src/builders/server/schema.json +1 -2
  43. package/src/index.js +5 -1
  44. package/src/typings.d.ts +0 -4
  45. package/src/utils/check-port.js +8 -4
  46. package/src/utils/color.js +5 -1
  47. package/src/utils/copy-assets.js +5 -1
  48. package/src/utils/delete-output-dir.js +6 -9
  49. package/src/utils/environment-options.d.ts +0 -1
  50. package/src/utils/environment-options.js +1 -13
  51. package/src/utils/i18n-inlining.js +5 -1
  52. package/src/utils/i18n-options.js +1 -8
  53. package/src/utils/index-file/html-rewriting-stream.js +5 -1
  54. package/src/utils/index-file/index-html-generator.js +5 -1
  55. package/src/utils/index-file/inline-critical-css.js +5 -1
  56. package/src/utils/index-file/inline-fonts.js +5 -1
  57. package/src/utils/index.js +5 -1
  58. package/src/utils/load-translations.js +5 -1
  59. package/src/utils/normalize-asset-patterns.d.ts +2 -2
  60. package/src/utils/normalize-asset-patterns.js +34 -10
  61. package/src/utils/normalize-builder-schema.d.ts +2 -2
  62. package/src/utils/normalize-builder-schema.js +5 -6
  63. package/src/utils/normalize-cache.js +0 -4
  64. package/src/utils/normalize-file-replacements.d.ts +4 -4
  65. package/src/utils/normalize-file-replacements.js +38 -18
  66. package/src/utils/process-bundle.js +6 -2
  67. package/src/utils/purge-cache.js +3 -8
  68. package/src/utils/read-tsconfig.js +5 -1
  69. package/src/utils/service-worker.d.ts +1 -2
  70. package/src/utils/service-worker.js +14 -12
  71. package/src/utils/webpack-browser-config.js +14 -12
  72. package/src/webpack/configs/analytics.js +1 -4
  73. package/src/webpack/configs/common.js +10 -12
  74. package/src/webpack/configs/dev-server.js +6 -2
  75. package/src/webpack/configs/index.js +5 -1
  76. package/src/webpack/configs/styles.d.ts +6 -0
  77. package/src/webpack/configs/styles.js +16 -22
  78. package/src/webpack/plugins/analytics.d.ts +1 -2
  79. package/src/webpack/plugins/analytics.js +1 -3
  80. package/src/webpack/plugins/any-component-style-budget-checker.js +5 -1
  81. package/src/webpack/plugins/common-js-usage-warn-plugin.js +2 -2
  82. package/src/webpack/plugins/css-optimizer-plugin.js +7 -3
  83. package/src/webpack/plugins/esbuild-executor.d.ts +2 -2
  84. package/src/webpack/plugins/esbuild-executor.js +11 -17
  85. package/src/webpack/plugins/javascript-optimizer-plugin.js +8 -4
  86. package/src/webpack/plugins/json-stats-plugin.js +5 -1
  87. package/src/webpack/plugins/karma/karma.js +11 -27
  88. package/src/webpack/plugins/named-chunks-plugin.js +9 -0
  89. package/src/webpack/plugins/postcss-cli-resources.js +7 -3
  90. package/src/webpack/plugins/scripts-webpack-plugin.js +5 -1
  91. package/src/webpack/plugins/transfer-size-plugin.js +3 -2
  92. package/src/webpack/plugins/typescript.js +1 -2
  93. package/src/webpack/utils/helpers.js +5 -1
  94. package/src/webpack/utils/stats.js +5 -1
  95. package/esbuild-check.js +0 -16
package/README.md CHANGED
@@ -4,16 +4,16 @@ This package contains [Architect builders](/packages/angular_devkit/architect/RE
4
4
 
5
5
  ## Builders
6
6
 
7
- | Name | Description |
8
- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
9
- | app-shell | Build an Angular [App shell](https://angular.io/guide/app-shell). |
10
- | browser | Build an Angular application targeting a browser environment. |
11
- | dev-server | A development server that provides live reloading. |
12
- | extract-i18n | Extract i18n messages from an Angular application. |
13
- | karma | Execute unit tests using [Karma](https://github.com/karma-runner/karma) test runner. |
14
- | ng-packagr | Build and package an Angular library in [Angular Package Format (APF)](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview) format using [ng-packagr](https://github.com/ng-packagr/ng-packagr). |
15
- | server | Build an Angular application targeting a [Node.js](https://nodejs.org) environment. |
16
- | protractor | **Deprecated** - Run end-to-end tests using [Protractor](https://www.protractortest.org/) framework. |
7
+ | Name | Description |
8
+ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9
+ | app-shell | Build an Angular [App shell](https://angular.io/guide/app-shell). |
10
+ | browser | Build an Angular application targeting a browser environment. |
11
+ | dev-server | A development server that provides live reloading. |
12
+ | extract-i18n | Extract i18n messages from an Angular application. |
13
+ | karma | Execute unit tests using [Karma](https://github.com/karma-runner/karma) test runner. |
14
+ | ng-packagr | Build and package an Angular library in [Angular Package Format (APF)](https://angular.io/guide/angular-package-format) format using [ng-packagr](https://github.com/ng-packagr/ng-packagr). |
15
+ | server | Build an Angular application targeting a [Node.js](https://nodejs.org) environment. |
16
+ | protractor | **Deprecated** - Run end-to-end tests using [Protractor](https://www.protractortest.org/) framework. |
17
17
 
18
18
  ## Disclaimer
19
19
 
package/builders.json CHANGED
@@ -11,6 +11,11 @@
11
11
  "schema": "./src/builders/browser/schema.json",
12
12
  "description": "Build a browser application."
13
13
  },
14
+ "browser-esbuild": {
15
+ "implementation": "./src/builders/browser-esbuild",
16
+ "schema": "./src/builders/browser/schema.json",
17
+ "description": "Build a browser application."
18
+ },
14
19
  "dev-server": {
15
20
  "implementation": "./src/builders/dev-server",
16
21
  "schema": "./src/builders/dev-server/schema.json",
package/package.json CHANGED
@@ -1,77 +1,76 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "14.0.0-next.1",
3
+ "version": "14.0.0-next.12",
4
4
  "description": "Angular Webpack Build Facade",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
7
7
  "builders": "builders.json",
8
8
  "dependencies": {
9
- "@ampproject/remapping": "2.1.0",
10
- "@angular-devkit/architect": "0.1400.0-next.1",
11
- "@angular-devkit/build-webpack": "0.1400.0-next.1",
12
- "@angular-devkit/core": "14.0.0-next.1",
13
- "@babel/core": "7.17.0",
14
- "@babel/generator": "7.17.0",
9
+ "@ampproject/remapping": "2.1.2",
10
+ "@angular-devkit/architect": "0.1400.0-next.12",
11
+ "@angular-devkit/build-webpack": "0.1400.0-next.12",
12
+ "@angular-devkit/core": "14.0.0-next.12",
13
+ "@babel/core": "7.17.9",
14
+ "@babel/generator": "7.17.9",
15
15
  "@babel/helper-annotate-as-pure": "7.16.7",
16
16
  "@babel/plugin-proposal-async-generator-functions": "7.16.8",
17
17
  "@babel/plugin-transform-async-to-generator": "7.16.8",
18
18
  "@babel/plugin-transform-runtime": "7.17.0",
19
19
  "@babel/preset-env": "7.16.11",
20
- "@babel/runtime": "7.17.0",
20
+ "@babel/runtime": "7.17.9",
21
21
  "@babel/template": "7.16.7",
22
- "@discoveryjs/json-ext": "0.5.6",
23
- "@ngtools/webpack": "14.0.0-next.1",
22
+ "@discoveryjs/json-ext": "0.5.7",
23
+ "@ngtools/webpack": "14.0.0-next.12",
24
24
  "ansi-colors": "4.1.1",
25
- "babel-loader": "8.2.3",
25
+ "babel-loader": "8.2.4",
26
26
  "babel-plugin-istanbul": "6.1.1",
27
27
  "browserslist": "^4.9.1",
28
- "cacache": "15.3.0",
28
+ "cacache": "16.0.4",
29
29
  "copy-webpack-plugin": "10.2.4",
30
- "core-js": "3.21.0",
31
30
  "critters": "0.0.16",
32
- "css-loader": "6.6.0",
33
- "esbuild-wasm": "0.14.20",
34
- "glob": "7.2.0",
35
- "https-proxy-agent": "5.0.0",
36
- "inquirer": "8.2.0",
31
+ "css-loader": "6.7.1",
32
+ "esbuild-wasm": "0.14.36",
33
+ "glob": "8.0.1",
34
+ "https-proxy-agent": "5.0.1",
35
+ "inquirer": "8.2.2",
37
36
  "jsonc-parser": "3.0.0",
38
37
  "karma-source-map-support": "1.4.0",
39
38
  "less": "4.1.2",
40
39
  "less-loader": "10.2.0",
41
- "license-webpack-plugin": "4.0.1",
40
+ "license-webpack-plugin": "4.0.2",
42
41
  "loader-utils": "3.2.0",
43
- "mini-css-extract-plugin": "2.5.3",
44
- "minimatch": "3.0.5",
42
+ "mini-css-extract-plugin": "2.6.0",
43
+ "minimatch": "5.0.1",
45
44
  "open": "8.4.0",
46
45
  "ora": "5.4.1",
47
46
  "parse5-html-rewriting-stream": "6.0.1",
48
47
  "piscina": "3.2.0",
49
- "postcss": "8.4.6",
50
- "postcss-import": "14.0.2",
48
+ "postcss": "8.4.12",
49
+ "postcss-import": "14.1.0",
51
50
  "postcss-loader": "6.2.1",
52
- "postcss-preset-env": "7.3.1",
51
+ "postcss-preset-env": "7.4.3",
53
52
  "regenerator-runtime": "0.13.9",
54
53
  "resolve-url-loader": "5.0.0",
55
54
  "rxjs": "6.6.7",
56
- "sass": "1.49.7",
57
- "sass-loader": "12.4.0",
58
- "semver": "7.3.5",
55
+ "sass": "1.50.1",
56
+ "sass-loader": "12.6.0",
57
+ "semver": "7.3.7",
59
58
  "source-map-loader": "3.0.1",
60
59
  "source-map-support": "0.5.21",
61
- "stylus": "0.56.0",
60
+ "stylus": "0.57.0",
62
61
  "stylus-loader": "6.2.0",
63
- "terser": "5.10.0",
62
+ "terser": "5.12.1",
64
63
  "text-table": "0.2.0",
65
64
  "tree-kill": "1.2.2",
66
65
  "tslib": "2.3.1",
67
- "webpack": "5.68.0",
66
+ "webpack": "5.72.0",
68
67
  "webpack-dev-middleware": "5.3.1",
69
- "webpack-dev-server": "4.7.4",
68
+ "webpack-dev-server": "4.8.1",
70
69
  "webpack-merge": "5.8.0",
71
70
  "webpack-subresource-integrity": "5.1.0"
72
71
  },
73
72
  "optionalDependencies": {
74
- "esbuild": "0.14.20"
73
+ "esbuild": "0.14.36"
75
74
  },
76
75
  "peerDependencies": {
77
76
  "@angular/compiler-cli": "^14.0.0 || ^14.0.0-next",
@@ -81,7 +80,7 @@
81
80
  "ng-packagr": "^14.0.0 || ^14.0.0-next",
82
81
  "protractor": "^7.0.0",
83
82
  "tailwindcss": "^2.0.0 || ^3.0.0",
84
- "typescript": ">=4.4.3 <4.6"
83
+ "typescript": "~4.6.2"
85
84
  },
86
85
  "peerDependenciesMeta": {
87
86
  "@angular/localize": {
@@ -115,7 +114,7 @@
115
114
  "url": "https://github.com/angular/angular-cli.git"
116
115
  },
117
116
  "engines": {
118
- "node": "^12.20.0 || ^14.15.0 || >=16.10.0",
117
+ "node": "^14.15.0 || >=16.10.0",
119
118
  "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
120
119
  "yarn": ">= 1.13.0"
121
120
  },
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -14,5 +14,6 @@ interface AngularCustomOptions extends Omit<ApplicationPresetOptions, 'instrumen
14
14
  };
15
15
  }
16
16
  export declare type AngularBabelLoaderOptions = AngularCustomOptions & Record<string, unknown>;
17
+ export declare function requiresLinking(path: string, source: string): Promise<boolean>;
17
18
  declare const _default: any;
18
19
  export default _default;
@@ -7,6 +7,7 @@
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.requiresLinking = void 0;
10
11
  const babel_loader_1 = require("babel-loader");
11
12
  const typescript_1 = require("typescript");
12
13
  const load_esm_1 = require("../utils/load-esm");
@@ -38,6 +39,7 @@ async function requiresLinking(path, source) {
38
39
  }
39
40
  return needsLinking(path, source);
40
41
  }
42
+ exports.requiresLinking = requiresLinking;
41
43
  // eslint-disable-next-line max-lines-per-function
42
44
  exports.default = (0, babel_loader_1.custom)(() => {
43
45
  const baseOptions = Object.freeze({
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -27,7 +31,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
31
  };
28
32
  Object.defineProperty(exports, "__esModule", { value: true });
29
33
  const architect_1 = require("@angular-devkit/architect");
30
- const core_1 = require("@angular-devkit/core");
31
34
  const fs = __importStar(require("fs"));
32
35
  const path = __importStar(require("path"));
33
36
  const utils_1 = require("../../utils");
@@ -35,6 +38,7 @@ const inline_critical_css_1 = require("../../utils/index-file/inline-critical-cs
35
38
  const service_worker_1 = require("../../utils/service-worker");
36
39
  const spinner_1 = require("../../utils/spinner");
37
40
  async function _renderUniversal(options, context, browserResult, serverResult, spinner) {
41
+ var _a;
38
42
  // Get browser target options.
39
43
  const browserTarget = (0, architect_1.targetFromTargetString)(options.browserTarget);
40
44
  const rawBrowserOptions = (await context.getTargetOptions(browserTarget));
@@ -49,7 +53,7 @@ async function _renderUniversal(options, context, browserResult, serverResult, s
49
53
  throw new Error('The builder requires a target.');
50
54
  }
51
55
  const projectMetadata = await context.getProjectMetadata(projectName);
52
- const projectRoot = (0, core_1.resolve)((0, core_1.normalize)(root), (0, core_1.normalize)(projectMetadata.root || ''));
56
+ const projectRoot = path.join(root, (_a = projectMetadata.root) !== null && _a !== void 0 ? _a : '');
53
57
  const { styles } = (0, utils_1.normalizeOptimization)(browserOptions.optimization);
54
58
  const inlineCriticalCssProcessor = styles.inlineCritical
55
59
  ? new inline_critical_css_1.InlineCriticalCssProcessor({
@@ -91,7 +95,7 @@ async function _renderUniversal(options, context, browserResult, serverResult, s
91
95
  }
92
96
  await fs.promises.writeFile(outputIndexPath, html);
93
97
  if (browserOptions.serviceWorker) {
94
- await (0, service_worker_1.augmentAppWithServiceWorker)(projectRoot, (0, core_1.normalize)(outputPath), browserOptions.baseHref || '/', browserOptions.ngswConfigPath);
98
+ await (0, service_worker_1.augmentAppWithServiceWorker)(projectRoot, root, outputPath, browserOptions.baseHref || '/', browserOptions.ngswConfigPath);
95
99
  }
96
100
  }
97
101
  return browserResult;
@@ -9,7 +9,7 @@ export interface Schema {
9
9
  */
10
10
  appModuleBundle?: string;
11
11
  /**
12
- * A browser builder target use for rendering the app shell in the format of
12
+ * A browser builder target use for rendering the application shell in the format of
13
13
  * `project:target[:configuration]`. You can also pass in more than one configuration name
14
14
  * as a comma-separated list. Example: `project:target:production,staging`.
15
15
  */
@@ -28,7 +28,7 @@ export interface Schema {
28
28
  */
29
29
  route?: string;
30
30
  /**
31
- * A server builder target use for rendering the app shell in the format of
31
+ * A server builder target use for rendering the application shell in the format of
32
32
  * `project:target[:configuration]`. You can also pass in more than one configuration name
33
33
  * as a comma-separated list. Example: `project:target:production,staging`.
34
34
  */
@@ -6,12 +6,12 @@
6
6
  "properties": {
7
7
  "browserTarget": {
8
8
  "type": "string",
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`.",
9
+ "description": "A browser builder target use for rendering the application 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": "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`.",
14
+ "description": "A server builder target use for rendering the application 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": {
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
9
9
  import { WebpackLoggingCallback } from '@angular-devkit/build-webpack';
10
- import { json } from '@angular-devkit/core';
11
10
  import { Observable } from 'rxjs';
12
11
  import webpack from 'webpack';
13
12
  import { ExecutionTransformer } from '../../transforms';
@@ -16,7 +15,7 @@ import { Schema as BrowserBuilderSchema } from './schema';
16
15
  /**
17
16
  * @experimental Direct usage of this type is considered experimental.
18
17
  */
19
- export declare type BrowserBuilderOutput = json.JsonObject & BuilderOutput & {
18
+ export declare type BrowserBuilderOutput = BuilderOutput & {
20
19
  baseOutputPath: string;
21
20
  outputPaths: string[];
22
21
  /**
@@ -37,5 +36,5 @@ export declare function buildWebpackBrowser(options: BrowserBuilderSchema, conte
37
36
  logging?: WebpackLoggingCallback;
38
37
  indexHtml?: IndexHtmlTransform;
39
38
  }): Observable<BrowserBuilderOutput>;
40
- declare const _default: import("@angular-devkit/architect/src/internal").Builder<json.JsonObject & BrowserBuilderSchema>;
39
+ declare const _default: import("@angular-devkit/architect/src/internal").Builder<BrowserBuilderSchema & import("@angular-devkit/core").JsonObject>;
41
40
  export default _default;
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -29,7 +33,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
33
  exports.buildWebpackBrowser = exports.BUILD_TIMEOUT = void 0;
30
34
  const architect_1 = require("@angular-devkit/architect");
31
35
  const build_webpack_1 = require("@angular-devkit/build-webpack");
32
- const core_1 = require("@angular-devkit/core");
33
36
  const fs = __importStar(require("fs"));
34
37
  const path = __importStar(require("path"));
35
38
  const rxjs_1 = require("rxjs");
@@ -71,7 +74,7 @@ async function initialize(options, context, webpackConfigurationTransform) {
71
74
  ]);
72
75
  // Validate asset option values if processed directly
73
76
  if (((_a = options.assets) === null || _a === void 0 ? void 0 : _a.length) && !((_b = adjustedOptions.assets) === null || _b === void 0 ? void 0 : _b.length)) {
74
- (0, utils_1.normalizeAssetPatterns)(options.assets, (0, core_1.normalize)(context.workspaceRoot), (0, core_1.normalize)(projectRoot), projectSourceRoot === undefined ? undefined : (0, core_1.normalize)(projectSourceRoot)).forEach(({ output }) => {
77
+ (0, utils_1.normalizeAssetPatterns)(options.assets, context.workspaceRoot, projectRoot, projectSourceRoot).forEach(({ output }) => {
75
78
  if (output.startsWith('..')) {
76
79
  throw new Error('An asset cannot be written to a location outside of the output path.');
77
80
  }
@@ -92,7 +95,6 @@ async function initialize(options, context, webpackConfigurationTransform) {
92
95
  // eslint-disable-next-line max-lines-per-function
93
96
  function buildWebpackBrowser(options, context, transforms = {}) {
94
97
  var _a;
95
- const root = (0, core_1.normalize)(context.workspaceRoot);
96
98
  const projectName = (_a = context.target) === null || _a === void 0 ? void 0 : _a.project;
97
99
  if (!projectName) {
98
100
  throw new Error('The builder requires a target.');
@@ -102,13 +104,14 @@ function buildWebpackBrowser(options, context, transforms = {}) {
102
104
  // Check Angular version.
103
105
  (0, version_1.assertCompatibleAngularVersion)(context.workspaceRoot);
104
106
  return (0, rxjs_1.from)(context.getProjectMetadata(projectName)).pipe((0, operators_1.switchMap)(async (projectMetadata) => {
105
- var _a;
106
- const sysProjectRoot = (0, core_1.getSystemPath)((0, core_1.resolve)((0, core_1.normalize)(context.workspaceRoot), (0, core_1.normalize)((_a = projectMetadata.root) !== null && _a !== void 0 ? _a : '')));
107
107
  // Purge old build disk cache.
108
108
  await (0, purge_cache_1.purgeStaleBuildCache)(context);
109
- checkInternetExplorerSupport(sysProjectRoot, context.logger);
109
+ // Initialize builder
110
+ const initialization = await initialize(options, context, transforms.webpackConfiguration);
111
+ // Check and warn about IE browser support
112
+ checkInternetExplorerSupport(initialization.projectRoot, context.logger);
110
113
  return {
111
- ...(await initialize(options, context, transforms.webpackConfiguration)),
114
+ ...initialization,
112
115
  cacheOptions: (0, normalize_cache_1.normalizeCacheOptions)(projectMetadata, context.workspaceRoot),
113
116
  };
114
117
  }), (0, operators_1.switchMap)(
@@ -185,7 +188,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
185
188
  if (!options.watch && ((_c = options.assets) === null || _c === void 0 ? void 0 : _c.length)) {
186
189
  spinner.start('Copying assets...');
187
190
  try {
188
- await (0, copy_assets_1.copyAssets)((0, utils_1.normalizeAssetPatterns)(options.assets, root, (0, core_1.normalize)(projectRoot), projectSourceRoot === undefined ? undefined : (0, core_1.normalize)(projectSourceRoot)), Array.from(outputPaths.values()), context.workspaceRoot);
191
+ await (0, copy_assets_1.copyAssets)((0, utils_1.normalizeAssetPatterns)(options.assets, context.workspaceRoot, projectRoot, projectSourceRoot), Array.from(outputPaths.values()), context.workspaceRoot);
189
192
  spinner.succeed('Copying assets complete.');
190
193
  }
191
194
  catch (err) {
@@ -249,7 +252,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
249
252
  spinner.start('Generating service worker...');
250
253
  for (const [locale, outputPath] of outputPaths.entries()) {
251
254
  try {
252
- await (0, service_worker_1.augmentAppWithServiceWorker)((0, core_1.normalize)(projectRoot), (0, core_1.normalize)(outputPath), getLocaleBaseHref(i18n, locale) || options.baseHref || '/', options.ngswConfigPath);
255
+ await (0, service_worker_1.augmentAppWithServiceWorker)(projectRoot, context.workspaceRoot, outputPath, getLocaleBaseHref(i18n, locale) || options.baseHref || '/', options.ngswConfigPath);
253
256
  }
254
257
  catch (error) {
255
258
  spinner.fail('Service worker generation failed.');
@@ -98,7 +98,6 @@ export interface Schema {
98
98
  outputHashing?: OutputHashing;
99
99
  /**
100
100
  * The full path for the new output directory, relative to the current workspace.
101
- *
102
101
  * By default, writes output to a folder named dist/ in the current project.
103
102
  */
104
103
  outputPath: string;
@@ -193,12 +193,11 @@
193
193
  },
194
194
  "outputPath": {
195
195
  "type": "string",
196
- "description": "The full path for the new output directory, relative to the current workspace.\n\nBy default, writes output to a folder named dist/ in the current project."
196
+ "description": "The full path for the new output directory, relative to the current workspace.\nBy default, writes output to a folder named dist/ in the current project."
197
197
  },
198
198
  "resourcesOutputPath": {
199
199
  "type": "string",
200
- "description": "The path where style resources will be placed, relative to outputPath.",
201
- "default": ""
200
+ "description": "The path where style resources will be placed, relative to outputPath."
202
201
  },
203
202
  "aot": {
204
203
  "type": "boolean",
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import type { Plugin } from 'esbuild';
9
+ import { BundleStylesheetOptions } from './stylesheets';
10
+ export declare function createCompilerPlugin(pluginOptions: {
11
+ sourcemap: boolean;
12
+ tsconfig: string;
13
+ advancedOptimizations?: boolean;
14
+ }, styleOptions: BundleStylesheetOptions): Plugin;