@angular-devkit/build-angular 18.0.0-next.3 → 18.0.0-next.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.
Files changed (252) hide show
  1. package/builders.json +1 -5
  2. package/package.json +14 -13
  3. package/src/builders/app-shell/index.js +3 -5
  4. package/src/builders/browser/index.d.ts +1 -1
  5. package/src/builders/browser/index.js +8 -12
  6. package/src/builders/browser-esbuild/index.d.ts +2 -2
  7. package/src/builders/browser-esbuild/index.js +6 -9
  8. package/src/builders/dev-server/builder.d.ts +2 -2
  9. package/src/builders/dev-server/builder.js +11 -6
  10. package/src/builders/dev-server/index.d.ts +1 -1
  11. package/src/builders/dev-server/webpack-server.d.ts +1 -1
  12. package/src/builders/dev-server/webpack-server.js +3 -4
  13. package/src/builders/extract-i18n/application-extraction.js +2 -2
  14. package/src/builders/extract-i18n/builder.js +3 -4
  15. package/src/builders/extract-i18n/options.d.ts +1 -1
  16. package/src/builders/extract-i18n/options.js +2 -2
  17. package/src/builders/jest/index.js +2 -2
  18. package/src/builders/karma/index.js +3 -4
  19. package/src/builders/ng-packagr/index.js +8 -7
  20. package/src/builders/ng-packagr/schema.d.ts +4 -0
  21. package/src/builders/ng-packagr/schema.json +4 -0
  22. package/src/builders/prerender/index.js +2 -2
  23. package/src/builders/prerender/render-worker.js +1 -1
  24. package/src/builders/server/index.js +3 -4
  25. package/src/builders/server/platform-server-exports-loader.js +2 -1
  26. package/src/builders/ssr-dev-server/index.js +7 -7
  27. package/src/builders/web-test-runner/index.js +2 -2
  28. package/src/index.d.ts +1 -1
  29. package/src/index.js +2 -2
  30. package/src/tools/babel/presets/application.js +1 -1
  31. package/src/tools/webpack/configs/styles.js +2 -2
  32. package/src/tools/webpack/plugins/any-component-style-budget-checker.d.ts +1 -1
  33. package/src/tools/webpack/plugins/any-component-style-budget-checker.js +5 -5
  34. package/src/tools/webpack/plugins/css-optimizer-plugin.js +2 -2
  35. package/src/tools/webpack/plugins/index-html-webpack-plugin.d.ts +1 -1
  36. package/src/tools/webpack/plugins/index-html-webpack-plugin.js +2 -2
  37. package/src/tools/webpack/plugins/javascript-optimizer-plugin.js +2 -2
  38. package/src/tools/webpack/plugins/service-worker-plugin.js +2 -2
  39. package/src/tools/webpack/utils/stats.d.ts +1 -1
  40. package/src/tools/webpack/utils/stats.js +2 -2
  41. package/src/utils/i18n-webpack.d.ts +1 -1
  42. package/src/utils/i18n-webpack.js +5 -6
  43. package/src/utils/index.d.ts +1 -2
  44. package/src/utils/index.js +4 -2
  45. package/src/utils/normalize-builder-schema.js +2 -2
  46. package/src/utils/normalize-cache.js +1 -1
  47. package/src/utils/normalize-optimization.d.ts +1 -1
  48. package/src/utils/normalize-optimization.js +0 -2
  49. package/src/builders/application/build-action.d.ts +0 -33
  50. package/src/builders/application/build-action.js +0 -183
  51. package/src/builders/application/execute-build.d.ts +0 -11
  52. package/src/builders/application/execute-build.js +0 -125
  53. package/src/builders/application/execute-post-bundle.d.ts +0 -25
  54. package/src/builders/application/execute-post-bundle.js +0 -93
  55. package/src/builders/application/i18n.d.ts +0 -29
  56. package/src/builders/application/i18n.js +0 -128
  57. package/src/builders/application/index.d.ts +0 -57
  58. package/src/builders/application/index.js +0 -121
  59. package/src/builders/application/options.d.ts +0 -149
  60. package/src/builders/application/options.js +0 -369
  61. package/src/builders/application/schema.d.ts +0 -512
  62. package/src/builders/application/schema.js +0 -58
  63. package/src/builders/application/schema.json +0 -635
  64. package/src/builders/application/setup-bundling.d.ts +0 -19
  65. package/src/builders/application/setup-bundling.js +0 -71
  66. package/src/builders/dev-server/vite-server.d.ts +0 -30
  67. package/src/builders/dev-server/vite-server.js +0 -502
  68. package/src/tools/babel/plugins/adjust-static-class-members.d.ts +0 -27
  69. package/src/tools/babel/plugins/adjust-static-class-members.js +0 -351
  70. package/src/tools/babel/plugins/adjust-typescript-enums.d.ts +0 -23
  71. package/src/tools/babel/plugins/adjust-typescript-enums.js +0 -113
  72. package/src/tools/babel/plugins/elide-angular-metadata.d.ts +0 -23
  73. package/src/tools/babel/plugins/elide-angular-metadata.js +0 -110
  74. package/src/tools/babel/plugins/index.d.ts +0 -11
  75. package/src/tools/babel/plugins/index.js +0 -21
  76. package/src/tools/babel/plugins/pure-toplevel-functions.d.ts +0 -16
  77. package/src/tools/babel/plugins/pure-toplevel-functions.js +0 -90
  78. package/src/tools/esbuild/angular/angular-host.d.ts +0 -26
  79. package/src/tools/esbuild/angular/angular-host.js +0 -72
  80. package/src/tools/esbuild/angular/compilation/angular-compilation.d.ts +0 -42
  81. package/src/tools/esbuild/angular/compilation/angular-compilation.js +0 -94
  82. package/src/tools/esbuild/angular/compilation/aot-compilation.d.ts +0 -21
  83. package/src/tools/esbuild/angular/compilation/aot-compilation.js +0 -228
  84. package/src/tools/esbuild/angular/compilation/factory.d.ts +0 -16
  85. package/src/tools/esbuild/angular/compilation/factory.js +0 -56
  86. package/src/tools/esbuild/angular/compilation/index.d.ts +0 -10
  87. package/src/tools/esbuild/angular/compilation/index.js +0 -17
  88. package/src/tools/esbuild/angular/compilation/jit-compilation.d.ts +0 -21
  89. package/src/tools/esbuild/angular/compilation/jit-compilation.js +0 -106
  90. package/src/tools/esbuild/angular/compilation/noop-compilation.d.ts +0 -20
  91. package/src/tools/esbuild/angular/compilation/noop-compilation.js +0 -26
  92. package/src/tools/esbuild/angular/compilation/parallel-compilation.d.ts +0 -42
  93. package/src/tools/esbuild/angular/compilation/parallel-compilation.js +0 -123
  94. package/src/tools/esbuild/angular/compilation/parallel-worker.d.ts +0 -33
  95. package/src/tools/esbuild/angular/compilation/parallel-worker.js +0 -90
  96. package/src/tools/esbuild/angular/compilation-state.d.ts +0 -15
  97. package/src/tools/esbuild/angular/compilation-state.js +0 -44
  98. package/src/tools/esbuild/angular/compiler-plugin.d.ts +0 -27
  99. package/src/tools/esbuild/angular/compiler-plugin.js +0 -441
  100. package/src/tools/esbuild/angular/component-stylesheets.d.ts +0 -44
  101. package/src/tools/esbuild/angular/component-stylesheets.js +0 -150
  102. package/src/tools/esbuild/angular/diagnostics.d.ts +0 -15
  103. package/src/tools/esbuild/angular/diagnostics.js +0 -69
  104. package/src/tools/esbuild/angular/file-reference-tracker.d.ts +0 -17
  105. package/src/tools/esbuild/angular/file-reference-tracker.js +0 -57
  106. package/src/tools/esbuild/angular/jit-plugin-callbacks.d.ts +0 -23
  107. package/src/tools/esbuild/angular/jit-plugin-callbacks.js +0 -117
  108. package/src/tools/esbuild/angular/jit-resource-transformer.d.ts +0 -17
  109. package/src/tools/esbuild/angular/jit-resource-transformer.js +0 -186
  110. package/src/tools/esbuild/angular/source-file-cache.d.ts +0 -18
  111. package/src/tools/esbuild/angular/source-file-cache.js +0 -65
  112. package/src/tools/esbuild/angular/uri.d.ts +0 -54
  113. package/src/tools/esbuild/angular/uri.js +0 -74
  114. package/src/tools/esbuild/angular/web-worker-transformer.d.ts +0 -17
  115. package/src/tools/esbuild/angular/web-worker-transformer.js +0 -94
  116. package/src/tools/esbuild/application-code-bundle.d.ts +0 -20
  117. package/src/tools/esbuild/application-code-bundle.js +0 -368
  118. package/src/tools/esbuild/budget-stats.d.ts +0 -19
  119. package/src/tools/esbuild/budget-stats.js +0 -59
  120. package/src/tools/esbuild/bundler-context.d.ts +0 -75
  121. package/src/tools/esbuild/bundler-context.js +0 -366
  122. package/src/tools/esbuild/bundler-execution-result.d.ts +0 -71
  123. package/src/tools/esbuild/bundler-execution-result.js +0 -131
  124. package/src/tools/esbuild/cache.d.ts +0 -88
  125. package/src/tools/esbuild/cache.js +0 -92
  126. package/src/tools/esbuild/commonjs-checker.d.ts +0 -28
  127. package/src/tools/esbuild/commonjs-checker.js +0 -151
  128. package/src/tools/esbuild/compiler-plugin-options.d.ts +0 -16
  129. package/src/tools/esbuild/compiler-plugin-options.js +0 -49
  130. package/src/tools/esbuild/external-packages-plugin.d.ts +0 -18
  131. package/src/tools/esbuild/external-packages-plugin.js +0 -70
  132. package/src/tools/esbuild/global-scripts.d.ts +0 -16
  133. package/src/tools/esbuild/global-scripts.js +0 -142
  134. package/src/tools/esbuild/global-styles.d.ts +0 -10
  135. package/src/tools/esbuild/global-styles.js +0 -74
  136. package/src/tools/esbuild/i18n-inliner-worker.d.ts +0 -42
  137. package/src/tools/esbuild/i18n-inliner-worker.js +0 -136
  138. package/src/tools/esbuild/i18n-inliner.d.ts +0 -44
  139. package/src/tools/esbuild/i18n-inliner.js +0 -150
  140. package/src/tools/esbuild/i18n-locale-plugin.d.ts +0 -22
  141. package/src/tools/esbuild/i18n-locale-plugin.js +0 -120
  142. package/src/tools/esbuild/index-html-generator.d.ts +0 -15
  143. package/src/tools/esbuild/index-html-generator.js +0 -81
  144. package/src/tools/esbuild/javascript-transformer-worker.d.ts +0 -19
  145. package/src/tools/esbuild/javascript-transformer-worker.js +0 -154
  146. package/src/tools/esbuild/javascript-transformer.d.ts +0 -54
  147. package/src/tools/esbuild/javascript-transformer.js +0 -147
  148. package/src/tools/esbuild/license-extractor.d.ts +0 -25
  149. package/src/tools/esbuild/license-extractor.js +0 -158
  150. package/src/tools/esbuild/load-result-cache.d.ts +0 -21
  151. package/src/tools/esbuild/load-result-cache.js +0 -75
  152. package/src/tools/esbuild/profiling.d.ts +0 -11
  153. package/src/tools/esbuild/profiling.js +0 -78
  154. package/src/tools/esbuild/rxjs-esm-resolution-plugin.d.ts +0 -18
  155. package/src/tools/esbuild/rxjs-esm-resolution-plugin.js +0 -44
  156. package/src/tools/esbuild/sourcemap-ignorelist-plugin.d.ts +0 -17
  157. package/src/tools/esbuild/sourcemap-ignorelist-plugin.js +0 -73
  158. package/src/tools/esbuild/stylesheets/bundle-options.d.ts +0 -35
  159. package/src/tools/esbuild/stylesheets/bundle-options.js +0 -64
  160. package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.d.ts +0 -25
  161. package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.js +0 -57
  162. package/src/tools/esbuild/stylesheets/css-language.d.ts +0 -9
  163. package/src/tools/esbuild/stylesheets/css-language.js +0 -15
  164. package/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts +0 -18
  165. package/src/tools/esbuild/stylesheets/css-resource-plugin.js +0 -114
  166. package/src/tools/esbuild/stylesheets/less-language.d.ts +0 -9
  167. package/src/tools/esbuild/stylesheets/less-language.js +0 -155
  168. package/src/tools/esbuild/stylesheets/sass-language.d.ts +0 -10
  169. package/src/tools/esbuild/stylesheets/sass-language.js +0 -185
  170. package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts +0 -58
  171. package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js +0 -282
  172. package/src/tools/esbuild/utils.d.ts +0 -41
  173. package/src/tools/esbuild/utils.js +0 -378
  174. package/src/tools/esbuild/virtual-module-plugin.d.ts +0 -33
  175. package/src/tools/esbuild/virtual-module-plugin.js +0 -43
  176. package/src/tools/esbuild/watcher.d.ts +0 -25
  177. package/src/tools/esbuild/watcher.js +0 -118
  178. package/src/tools/sass/lexer.d.ts +0 -18
  179. package/src/tools/sass/lexer.js +0 -161
  180. package/src/tools/sass/rebasing-importer.d.ts +0 -101
  181. package/src/tools/sass/rebasing-importer.js +0 -334
  182. package/src/tools/sass/sass-service.d.ts +0 -72
  183. package/src/tools/sass/sass-service.js +0 -213
  184. package/src/tools/sass/worker.d.ts +0 -8
  185. package/src/tools/sass/worker.js +0 -192
  186. package/src/tools/vite/angular-memory-plugin.d.ts +0 -24
  187. package/src/tools/vite/angular-memory-plugin.js +0 -268
  188. package/src/tools/vite/i18n-locale-plugin.d.ts +0 -18
  189. package/src/tools/vite/i18n-locale-plugin.js +0 -55
  190. package/src/typings.d.ts +0 -21
  191. package/src/utils/bundle-calculator.d.ts +0 -44
  192. package/src/utils/bundle-calculator.js +0 -303
  193. package/src/utils/check-port.d.ts +0 -8
  194. package/src/utils/check-port.js +0 -58
  195. package/src/utils/delete-output-dir.d.ts +0 -11
  196. package/src/utils/delete-output-dir.js +0 -46
  197. package/src/utils/format-bytes.d.ts +0 -8
  198. package/src/utils/format-bytes.js +0 -22
  199. package/src/utils/i18n-options.d.ts +0 -33
  200. package/src/utils/i18n-options.js +0 -161
  201. package/src/utils/index-file/add-event-dispatch-contract.d.ts +0 -8
  202. package/src/utils/index-file/add-event-dispatch-contract.js +0 -28
  203. package/src/utils/index-file/augment-index-html.d.ts +0 -40
  204. package/src/utils/index-file/augment-index-html.js +0 -239
  205. package/src/utils/index-file/html-rewriting-stream.d.ts +0 -11
  206. package/src/utils/index-file/html-rewriting-stream.js +0 -28
  207. package/src/utils/index-file/index-html-generator.d.ts +0 -57
  208. package/src/utils/index-file/index-html-generator.js +0 -135
  209. package/src/utils/index-file/inline-critical-css.d.ts +0 -24
  210. package/src/utils/index-file/inline-critical-css.js +0 -179
  211. package/src/utils/index-file/inline-fonts.d.ts +0 -23
  212. package/src/utils/index-file/inline-fonts.js +0 -267
  213. package/src/utils/index-file/nonce.d.ts +0 -12
  214. package/src/utils/index-file/nonce.js +0 -55
  215. package/src/utils/load-proxy-config.d.ts +0 -8
  216. package/src/utils/load-proxy-config.js +0 -189
  217. package/src/utils/load-translations.d.ts +0 -16
  218. package/src/utils/load-translations.js +0 -84
  219. package/src/utils/postcss-configuration.d.ts +0 -17
  220. package/src/utils/postcss-configuration.js +0 -86
  221. package/src/utils/purge-cache.d.ts +0 -10
  222. package/src/utils/purge-cache.js +0 -40
  223. package/src/utils/resolve-assets.d.ts +0 -18
  224. package/src/utils/resolve-assets.js +0 -35
  225. package/src/utils/routes-extractor/extractor.d.ts +0 -15
  226. package/src/utils/routes-extractor/extractor.js +0 -97
  227. package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.d.ts +0 -18
  228. package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js +0 -129
  229. package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.d.ts +0 -8
  230. package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js +0 -13
  231. package/src/utils/server-rendering/fetch-patch.d.ts +0 -8
  232. package/src/utils/server-rendering/fetch-patch.js +0 -66
  233. package/src/utils/server-rendering/load-esm-from-memory.d.ts +0 -10
  234. package/src/utils/server-rendering/load-esm-from-memory.js +0 -26
  235. package/src/utils/server-rendering/main-bundle-exports.d.ts +0 -27
  236. package/src/utils/server-rendering/main-bundle-exports.js +0 -9
  237. package/src/utils/server-rendering/prerender.d.ts +0 -23
  238. package/src/utils/server-rendering/prerender.js +0 -192
  239. package/src/utils/server-rendering/render-page.d.ts +0 -26
  240. package/src/utils/server-rendering/render-page.js +0 -110
  241. package/src/utils/server-rendering/render-worker.d.ts +0 -22
  242. package/src/utils/server-rendering/render-worker.js +0 -30
  243. package/src/utils/server-rendering/routes-extractor-worker.d.ts +0 -21
  244. package/src/utils/server-rendering/routes-extractor-worker.js +0 -53
  245. package/src/utils/service-worker.d.ts +0 -25
  246. package/src/utils/service-worker.js +0 -211
  247. package/src/utils/stats-table.d.ts +0 -20
  248. package/src/utils/stats-table.js +0 -205
  249. package/src/utils/supported-browsers.d.ts +0 -10
  250. package/src/utils/supported-browsers.js +0 -42
  251. package/src/utils/version.d.ts +0 -8
  252. package/src/utils/version.js +0 -59
@@ -1,183 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC 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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = 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);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- var __importDefault = (this && this.__importDefault) || function (mod) {
33
- return (mod && mod.__esModule) ? mod : { "default": mod };
34
- };
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.runEsBuildBuildAction = void 0;
37
- const node_fs_1 = require("node:fs");
38
- const node_path_1 = __importDefault(require("node:path"));
39
- const sass_language_1 = require("../../tools/esbuild/stylesheets/sass-language");
40
- const utils_1 = require("../../tools/esbuild/utils");
41
- const delete_output_dir_1 = require("../../utils/delete-output-dir");
42
- const environment_options_1 = require("../../utils/environment-options");
43
- // Watch workspace for package manager changes
44
- const packageWatchFiles = [
45
- // manifest can affect module resolution
46
- 'package.json',
47
- // npm lock file
48
- 'package-lock.json',
49
- // pnpm lock file
50
- 'pnpm-lock.yaml',
51
- // yarn lock file including Yarn PnP manifest files (https://yarnpkg.com/advanced/pnp-spec/)
52
- 'yarn.lock',
53
- '.pnp.cjs',
54
- '.pnp.data.json',
55
- ];
56
- async function* runEsBuildBuildAction(action, options) {
57
- const { writeToFileSystemFilter, writeToFileSystem, watch, poll, clearScreen, logger, deleteOutputPath, cacheOptions, outputOptions, verbose, projectRoot, workspaceRoot, progress, preserveSymlinks, colors, jsonLogs, } = options;
58
- if (deleteOutputPath && writeToFileSystem) {
59
- await (0, delete_output_dir_1.deleteOutputDir)(workspaceRoot, outputOptions.base, [
60
- outputOptions.browser,
61
- outputOptions.server,
62
- ]);
63
- }
64
- const withProgress = progress ? utils_1.withSpinner : utils_1.withNoProgress;
65
- // Initial build
66
- let result;
67
- try {
68
- // Perform the build action
69
- result = await withProgress('Building...', () => action());
70
- // Log all diagnostic (error/warning/logs) messages
71
- await (0, utils_1.logMessages)(logger, result, colors, jsonLogs);
72
- }
73
- finally {
74
- // Ensure Sass workers are shutdown if not watching
75
- if (!watch) {
76
- (0, sass_language_1.shutdownSassWorkerPool)();
77
- }
78
- }
79
- // Setup watcher if watch mode enabled
80
- let watcher;
81
- if (watch) {
82
- if (progress) {
83
- logger.info('Watch mode enabled. Watching for file changes...');
84
- }
85
- const ignored = [
86
- // Ignore the output and cache paths to avoid infinite rebuild cycles
87
- outputOptions.base,
88
- cacheOptions.basePath,
89
- `${workspaceRoot.replace(/\\/g, '/')}/**/.*/**`,
90
- ];
91
- if (!preserveSymlinks) {
92
- // Ignore all node modules directories to avoid excessive file watchers.
93
- // Package changes are handled below by watching manifest and lock files.
94
- // NOTE: this is not enable when preserveSymlinks is true as this would break `npm link` usages.
95
- ignored.push('**/node_modules/**');
96
- }
97
- // Setup a watcher
98
- const { createWatcher } = await Promise.resolve().then(() => __importStar(require('../../tools/esbuild/watcher')));
99
- watcher = createWatcher({
100
- polling: typeof poll === 'number',
101
- interval: poll,
102
- followSymlinks: preserveSymlinks,
103
- ignored,
104
- });
105
- // Setup abort support
106
- options.signal?.addEventListener('abort', () => void watcher?.close());
107
- // Watch the entire project root if 'NG_BUILD_WATCH_ROOT' environment variable is set
108
- if (environment_options_1.shouldWatchRoot) {
109
- watcher.add(projectRoot);
110
- }
111
- watcher.add(packageWatchFiles
112
- .map((file) => node_path_1.default.join(workspaceRoot, file))
113
- .filter((file) => (0, node_fs_1.existsSync)(file)));
114
- // Watch locations provided by the initial build result
115
- watcher.add(result.watchFiles);
116
- }
117
- // Output the first build results after setting up the watcher to ensure that any code executed
118
- // higher in the iterator call stack will trigger the watcher. This is particularly relevant for
119
- // unit tests which execute the builder and modify the file system programmatically.
120
- yield await writeAndEmitOutput(writeToFileSystem, result, outputOptions, writeToFileSystemFilter);
121
- // Finish if watch mode is not enabled
122
- if (!watcher) {
123
- return;
124
- }
125
- // Wait for changes and rebuild as needed
126
- const currentWatchFiles = new Set(result.watchFiles);
127
- try {
128
- for await (const changes of watcher) {
129
- if (options.signal?.aborted) {
130
- break;
131
- }
132
- if (clearScreen) {
133
- // eslint-disable-next-line no-console
134
- console.clear();
135
- }
136
- if (verbose) {
137
- logger.info(changes.toDebugString());
138
- }
139
- result = await withProgress('Changes detected. Rebuilding...', () => action(result.createRebuildState(changes)));
140
- // Log all diagnostic (error/warning/logs) messages
141
- await (0, utils_1.logMessages)(logger, result, colors, jsonLogs);
142
- // Update watched locations provided by the new build result.
143
- // Keep watching all previous files if there are any errors; otherwise consider all
144
- // files stale until confirmed present in the new result's watch files.
145
- const staleWatchFiles = result.errors.length > 0 ? undefined : new Set(currentWatchFiles);
146
- for (const watchFile of result.watchFiles) {
147
- if (!currentWatchFiles.has(watchFile)) {
148
- // Add new watch location
149
- watcher.add(watchFile);
150
- currentWatchFiles.add(watchFile);
151
- }
152
- // Present so remove from stale locations
153
- staleWatchFiles?.delete(watchFile);
154
- }
155
- // Remove any stale locations if the build was successful
156
- if (staleWatchFiles?.size) {
157
- watcher.remove([...staleWatchFiles]);
158
- }
159
- yield await writeAndEmitOutput(writeToFileSystem, result, outputOptions, writeToFileSystemFilter);
160
- }
161
- }
162
- finally {
163
- // Stop the watcher and cleanup incremental rebuild state
164
- await Promise.allSettled([watcher.close(), result.dispose()]);
165
- (0, sass_language_1.shutdownSassWorkerPool)();
166
- }
167
- }
168
- exports.runEsBuildBuildAction = runEsBuildBuildAction;
169
- async function writeAndEmitOutput(writeToFileSystem, { outputFiles, output, outputWithFiles, assetFiles }, outputOptions, writeToFileSystemFilter) {
170
- if (writeToFileSystem) {
171
- // Write output files
172
- const outputFilesToWrite = writeToFileSystemFilter
173
- ? outputFiles.filter(writeToFileSystemFilter)
174
- : outputFiles;
175
- await (0, utils_1.writeResultFiles)(outputFilesToWrite, assetFiles, outputOptions);
176
- return output;
177
- }
178
- else {
179
- // Requires casting due to unneeded `JsonObject` requirement. Remove once fixed.
180
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
181
- return outputWithFiles;
182
- }
183
- }
@@ -1,11 +0,0 @@
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 { BuilderContext } from '@angular-devkit/architect';
9
- import { ExecutionResult, RebuildState } from '../../tools/esbuild/bundler-execution-result';
10
- import { NormalizedApplicationBuildOptions } from './options';
11
- export declare function executeBuild(options: NormalizedApplicationBuildOptions, context: BuilderContext, rebuildState?: RebuildState): Promise<ExecutionResult>;
@@ -1,125 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC 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
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.executeBuild = void 0;
11
- const source_file_cache_1 = require("../../tools/esbuild/angular/source-file-cache");
12
- const budget_stats_1 = require("../../tools/esbuild/budget-stats");
13
- const bundler_context_1 = require("../../tools/esbuild/bundler-context");
14
- const bundler_execution_result_1 = require("../../tools/esbuild/bundler-execution-result");
15
- const commonjs_checker_1 = require("../../tools/esbuild/commonjs-checker");
16
- const license_extractor_1 = require("../../tools/esbuild/license-extractor");
17
- const utils_1 = require("../../tools/esbuild/utils");
18
- const bundle_calculator_1 = require("../../utils/bundle-calculator");
19
- const resolve_assets_1 = require("../../utils/resolve-assets");
20
- const supported_browsers_1 = require("../../utils/supported-browsers");
21
- const execute_post_bundle_1 = require("./execute-post-bundle");
22
- const i18n_1 = require("./i18n");
23
- const setup_bundling_1 = require("./setup-bundling");
24
- async function executeBuild(options, context, rebuildState) {
25
- const { projectRoot, workspaceRoot, i18nOptions, optimizationOptions, assets, cacheOptions, prerenderOptions, ssrOptions, verbose, colors, jsonLogs, } = options;
26
- // TODO: Consider integrating into watch mode. Would require full rebuild on target changes.
27
- const browsers = (0, supported_browsers_1.getSupportedBrowsers)(projectRoot, context.logger);
28
- // Load active translations if inlining
29
- // TODO: Integrate into watch mode and only load changed translations
30
- if (i18nOptions.shouldInline) {
31
- await (0, i18n_1.loadActiveTranslations)(context, i18nOptions);
32
- }
33
- // Reuse rebuild state or create new bundle contexts for code and global stylesheets
34
- let bundlerContexts = rebuildState?.rebuildContexts;
35
- const codeBundleCache = rebuildState?.codeBundleCache ??
36
- new source_file_cache_1.SourceFileCache(cacheOptions.enabled ? cacheOptions.path : undefined);
37
- if (bundlerContexts === undefined) {
38
- bundlerContexts = (0, setup_bundling_1.setupBundlerContexts)(options, browsers, codeBundleCache);
39
- }
40
- const bundlingResult = await bundler_context_1.BundlerContext.bundleAll(bundlerContexts, rebuildState?.fileChanges.all);
41
- const executionResult = new bundler_execution_result_1.ExecutionResult(bundlerContexts, codeBundleCache);
42
- executionResult.addWarnings(bundlingResult.warnings);
43
- // Return if the bundling has errors
44
- if (bundlingResult.errors) {
45
- executionResult.addErrors(bundlingResult.errors);
46
- return executionResult;
47
- }
48
- // Analyze external imports if external options are enabled
49
- if (options.externalPackages || bundlingResult.externalConfiguration) {
50
- const { externalConfiguration, externalImports: { browser, server }, } = bundlingResult;
51
- const implicitBrowser = browser ? [...browser] : [];
52
- const implicitServer = server ? [...server] : [];
53
- // TODO: Implement wildcard externalConfiguration filtering
54
- executionResult.setExternalMetadata(externalConfiguration
55
- ? implicitBrowser.filter((value) => !externalConfiguration.includes(value))
56
- : implicitBrowser, externalConfiguration
57
- ? implicitServer.filter((value) => !externalConfiguration.includes(value))
58
- : implicitServer, externalConfiguration);
59
- }
60
- const { metafile, initialFiles, outputFiles } = bundlingResult;
61
- executionResult.outputFiles.push(...outputFiles);
62
- const changedFiles = rebuildState && executionResult.findChangedFiles(rebuildState.previousOutputHashes);
63
- // Analyze files for bundle budget failures if present
64
- let budgetFailures;
65
- if (options.budgets) {
66
- const compatStats = (0, budget_stats_1.generateBudgetStats)(metafile, initialFiles);
67
- budgetFailures = [...(0, bundle_calculator_1.checkBudgets)(options.budgets, compatStats, true)];
68
- for (const { message, severity } of budgetFailures) {
69
- if (severity === 'error') {
70
- executionResult.addError(message);
71
- }
72
- else {
73
- executionResult.addWarning(message);
74
- }
75
- }
76
- }
77
- // Calculate estimated transfer size if scripts are optimized
78
- let estimatedTransferSizes;
79
- if (optimizationOptions.scripts || optimizationOptions.styles.minify) {
80
- estimatedTransferSizes = await (0, utils_1.calculateEstimatedTransferSizes)(executionResult.outputFiles);
81
- }
82
- // Check metafile for CommonJS module usage if optimizing scripts
83
- if (optimizationOptions.scripts) {
84
- const messages = (0, commonjs_checker_1.checkCommonJSModules)(metafile, options.allowedCommonJsDependencies);
85
- executionResult.addWarnings(messages);
86
- }
87
- // Copy assets
88
- if (assets) {
89
- executionResult.addAssets(await (0, resolve_assets_1.resolveAssets)(assets, workspaceRoot));
90
- }
91
- // Extract and write licenses for used packages
92
- if (options.extractLicenses) {
93
- executionResult.addOutputFile('3rdpartylicenses.txt', await (0, license_extractor_1.extractLicenses)(metafile, workspaceRoot), bundler_context_1.BuildOutputFileType.Root);
94
- }
95
- // Perform i18n translation inlining if enabled
96
- if (i18nOptions.shouldInline) {
97
- const result = await (0, i18n_1.inlineI18n)(options, executionResult, initialFiles);
98
- executionResult.addErrors(result.errors);
99
- executionResult.addWarnings(result.warnings);
100
- executionResult.addPrerenderedRoutes(result.prerenderedRoutes);
101
- }
102
- else {
103
- const result = await (0, execute_post_bundle_1.executePostBundleSteps)(options, executionResult.outputFiles, executionResult.assetFiles, initialFiles,
104
- // Set lang attribute to the defined source locale if present
105
- i18nOptions.hasDefinedSourceLocale ? i18nOptions.sourceLocale : undefined);
106
- executionResult.addErrors(result.errors);
107
- executionResult.addWarnings(result.warnings);
108
- executionResult.addPrerenderedRoutes(result.prerenderedRoutes);
109
- executionResult.outputFiles.push(...result.additionalOutputFiles);
110
- executionResult.assetFiles.push(...result.additionalAssets);
111
- }
112
- if (prerenderOptions) {
113
- const prerenderedRoutes = executionResult.prerenderedRoutes;
114
- executionResult.addOutputFile('prerendered-routes.json', JSON.stringify({ routes: prerenderedRoutes }, null, 2), bundler_context_1.BuildOutputFileType.Root);
115
- }
116
- // Write metafile if stats option is enabled
117
- if (options.stats) {
118
- executionResult.addOutputFile('stats.json', JSON.stringify(metafile, null, 2), bundler_context_1.BuildOutputFileType.Root);
119
- }
120
- if (!jsonLogs) {
121
- executionResult.addLog((0, utils_1.logBuildStats)(metafile, initialFiles, budgetFailures, colors, changedFiles, estimatedTransferSizes, !!ssrOptions, verbose));
122
- }
123
- return executionResult;
124
- }
125
- exports.executeBuild = executeBuild;
@@ -1,25 +0,0 @@
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 { BuildOutputFile, InitialFileRecord } from '../../tools/esbuild/bundler-context';
9
- import { BuildOutputAsset } from '../../tools/esbuild/bundler-execution-result';
10
- import { NormalizedApplicationBuildOptions } from './options';
11
- /**
12
- * Run additional builds steps including SSG, AppShell, Index HTML file and Service worker generation.
13
- * @param options The normalized application builder options used to create the build.
14
- * @param outputFiles The output files of an executed build.
15
- * @param assetFiles The assets of an executed build.
16
- * @param initialFiles A map containing initial file information for the executed build.
17
- * @param locale A language locale to insert in the index.html.
18
- */
19
- export declare function executePostBundleSteps(options: NormalizedApplicationBuildOptions, outputFiles: BuildOutputFile[], assetFiles: BuildOutputAsset[], initialFiles: Map<string, InitialFileRecord>, locale: string | undefined): Promise<{
20
- errors: string[];
21
- warnings: string[];
22
- additionalOutputFiles: BuildOutputFile[];
23
- additionalAssets: BuildOutputAsset[];
24
- prerenderedRoutes: string[];
25
- }>;
@@ -1,93 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC 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
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.executePostBundleSteps = void 0;
14
- const node_assert_1 = __importDefault(require("node:assert"));
15
- const bundler_context_1 = require("../../tools/esbuild/bundler-context");
16
- const index_html_generator_1 = require("../../tools/esbuild/index-html-generator");
17
- const utils_1 = require("../../tools/esbuild/utils");
18
- const environment_options_1 = require("../../utils/environment-options");
19
- const prerender_1 = require("../../utils/server-rendering/prerender");
20
- const service_worker_1 = require("../../utils/service-worker");
21
- /**
22
- * Run additional builds steps including SSG, AppShell, Index HTML file and Service worker generation.
23
- * @param options The normalized application builder options used to create the build.
24
- * @param outputFiles The output files of an executed build.
25
- * @param assetFiles The assets of an executed build.
26
- * @param initialFiles A map containing initial file information for the executed build.
27
- * @param locale A language locale to insert in the index.html.
28
- */
29
- async function executePostBundleSteps(options, outputFiles, assetFiles, initialFiles, locale) {
30
- const additionalAssets = [];
31
- const additionalOutputFiles = [];
32
- const allErrors = [];
33
- const allWarnings = [];
34
- const prerenderedRoutes = [];
35
- const { serviceWorker, indexHtmlOptions, optimizationOptions, sourcemapOptions, prerenderOptions, appShellOptions, workspaceRoot, verbose, } = options;
36
- /**
37
- * Index HTML content without CSS inlining to be used for server rendering (AppShell, SSG and SSR).
38
- *
39
- * NOTE: we don't perform critical CSS inlining as this will be done during server rendering.
40
- */
41
- let ssrIndexContent;
42
- // When using prerender/app-shell the index HTML file can be regenerated.
43
- // Thus, we use a Map so that we do not generate 2 files with the same filename.
44
- const additionalHtmlOutputFiles = new Map();
45
- // Generate index HTML file
46
- // If localization is enabled, index generation is handled in the inlining process.
47
- if (indexHtmlOptions) {
48
- const { csrContent, ssrContent, errors, warnings } = await (0, index_html_generator_1.generateIndexHtml)(initialFiles, outputFiles, options, locale);
49
- allErrors.push(...errors);
50
- allWarnings.push(...warnings);
51
- additionalHtmlOutputFiles.set(indexHtmlOptions.output, (0, utils_1.createOutputFileFromText)(indexHtmlOptions.output, csrContent, bundler_context_1.BuildOutputFileType.Browser));
52
- if (ssrContent) {
53
- const serverIndexHtmlFilename = 'index.server.html';
54
- additionalHtmlOutputFiles.set(serverIndexHtmlFilename, (0, utils_1.createOutputFileFromText)(serverIndexHtmlFilename, ssrContent, bundler_context_1.BuildOutputFileType.Server));
55
- ssrIndexContent = ssrContent;
56
- }
57
- }
58
- // Pre-render (SSG) and App-shell
59
- // If localization is enabled, prerendering is handled in the inlining process.
60
- if (prerenderOptions || appShellOptions) {
61
- (0, node_assert_1.default)(ssrIndexContent, 'The "index" option is required when using the "ssg" or "appShell" options.');
62
- const { output, warnings, errors, prerenderedRoutes: generatedRoutes, } = await (0, prerender_1.prerenderPages)(workspaceRoot, appShellOptions, prerenderOptions, outputFiles, assetFiles, ssrIndexContent, sourcemapOptions.scripts, optimizationOptions.styles.inlineCritical, environment_options_1.maxWorkers, verbose);
63
- allErrors.push(...errors);
64
- allWarnings.push(...warnings);
65
- prerenderedRoutes.push(...Array.from(generatedRoutes));
66
- for (const [path, content] of Object.entries(output)) {
67
- additionalHtmlOutputFiles.set(path, (0, utils_1.createOutputFileFromText)(path, content, bundler_context_1.BuildOutputFileType.Browser));
68
- }
69
- }
70
- additionalOutputFiles.push(...additionalHtmlOutputFiles.values());
71
- // Augment the application with service worker support
72
- // If localization is enabled, service worker is handled in the inlining process.
73
- if (serviceWorker) {
74
- try {
75
- const serviceWorkerResult = await (0, service_worker_1.augmentAppWithServiceWorkerEsbuild)(workspaceRoot, serviceWorker, options.baseHref || '/', options.indexHtmlOptions?.output,
76
- // Ensure additional files recently added are used
77
- [...outputFiles, ...additionalOutputFiles], assetFiles);
78
- additionalOutputFiles.push((0, utils_1.createOutputFileFromText)('ngsw.json', serviceWorkerResult.manifest, bundler_context_1.BuildOutputFileType.Browser));
79
- additionalAssets.push(...serviceWorkerResult.assetFiles);
80
- }
81
- catch (error) {
82
- allErrors.push(error instanceof Error ? error.message : `${error}`);
83
- }
84
- }
85
- return {
86
- errors: allErrors,
87
- warnings: allWarnings,
88
- additionalAssets,
89
- prerenderedRoutes,
90
- additionalOutputFiles,
91
- };
92
- }
93
- exports.executePostBundleSteps = executePostBundleSteps;
@@ -1,29 +0,0 @@
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 { BuilderContext } from '@angular-devkit/architect';
9
- import { InitialFileRecord } from '../../tools/esbuild/bundler-context';
10
- import { ExecutionResult } from '../../tools/esbuild/bundler-execution-result';
11
- import { NormalizedApplicationBuildOptions } from './options';
12
- /**
13
- * Inlines all active locales as specified by the application build options into all
14
- * application JavaScript files created during the build.
15
- * @param options The normalized application builder options used to create the build.
16
- * @param executionResult The result of an executed build.
17
- * @param initialFiles A map containing initial file information for the executed build.
18
- */
19
- export declare function inlineI18n(options: NormalizedApplicationBuildOptions, executionResult: ExecutionResult, initialFiles: Map<string, InitialFileRecord>): Promise<{
20
- errors: string[];
21
- warnings: string[];
22
- prerenderedRoutes: string[];
23
- }>;
24
- /**
25
- * Loads all active translations using the translation loaders from the `@angular/localize` package.
26
- * @param context The architect builder context for the current build.
27
- * @param i18n The normalized i18n options to use.
28
- */
29
- export declare function loadActiveTranslations(context: BuilderContext, i18n: NormalizedApplicationBuildOptions['i18nOptions']): Promise<void>;
@@ -1,128 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC 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
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.loadActiveTranslations = exports.inlineI18n = void 0;
11
- const node_path_1 = require("node:path");
12
- const bundler_context_1 = require("../../tools/esbuild/bundler-context");
13
- const i18n_inliner_1 = require("../../tools/esbuild/i18n-inliner");
14
- const environment_options_1 = require("../../utils/environment-options");
15
- const i18n_options_1 = require("../../utils/i18n-options");
16
- const load_translations_1 = require("../../utils/load-translations");
17
- const url_1 = require("../../utils/url");
18
- const execute_post_bundle_1 = require("./execute-post-bundle");
19
- /**
20
- * Inlines all active locales as specified by the application build options into all
21
- * application JavaScript files created during the build.
22
- * @param options The normalized application builder options used to create the build.
23
- * @param executionResult The result of an executed build.
24
- * @param initialFiles A map containing initial file information for the executed build.
25
- */
26
- async function inlineI18n(options, executionResult, initialFiles) {
27
- // Create the multi-threaded inliner with common options and the files generated from the build.
28
- const inliner = new i18n_inliner_1.I18nInliner({
29
- missingTranslation: options.i18nOptions.missingTranslationBehavior ?? 'warning',
30
- outputFiles: executionResult.outputFiles,
31
- shouldOptimize: options.optimizationOptions.scripts,
32
- }, environment_options_1.maxWorkers);
33
- const inlineResult = {
34
- errors: [],
35
- warnings: [],
36
- prerenderedRoutes: [],
37
- };
38
- // For each active locale, use the inliner to process the output files of the build.
39
- const updatedOutputFiles = [];
40
- const updatedAssetFiles = [];
41
- try {
42
- for (const locale of options.i18nOptions.inlineLocales) {
43
- // A locale specific set of files is returned from the inliner.
44
- const localeInlineResult = await inliner.inlineForLocale(locale, options.i18nOptions.locales[locale].translation);
45
- const localeOutputFiles = localeInlineResult.outputFiles;
46
- inlineResult.errors.push(...localeInlineResult.errors);
47
- inlineResult.warnings.push(...localeInlineResult.warnings);
48
- const baseHref = getLocaleBaseHref(options.baseHref, options.i18nOptions, locale) ?? options.baseHref;
49
- const { errors, warnings, additionalAssets, additionalOutputFiles, prerenderedRoutes: generatedRoutes, } = await (0, execute_post_bundle_1.executePostBundleSteps)({
50
- ...options,
51
- baseHref,
52
- }, localeOutputFiles, executionResult.assetFiles, initialFiles, locale);
53
- localeOutputFiles.push(...additionalOutputFiles);
54
- inlineResult.errors.push(...errors);
55
- inlineResult.warnings.push(...warnings);
56
- // Update directory with locale base
57
- if (options.i18nOptions.flatOutput !== true) {
58
- localeOutputFiles.forEach((file) => {
59
- file.path = (0, node_path_1.join)(locale, file.path);
60
- });
61
- for (const assetFile of [...executionResult.assetFiles, ...additionalAssets]) {
62
- updatedAssetFiles.push({
63
- source: assetFile.source,
64
- destination: (0, node_path_1.join)(locale, assetFile.destination),
65
- });
66
- }
67
- inlineResult.prerenderedRoutes.push(...generatedRoutes.map((route) => node_path_1.posix.join('/', locale, route)));
68
- }
69
- else {
70
- inlineResult.prerenderedRoutes.push(...generatedRoutes);
71
- executionResult.assetFiles.push(...additionalAssets);
72
- }
73
- updatedOutputFiles.push(...localeOutputFiles);
74
- }
75
- }
76
- finally {
77
- await inliner.close();
78
- }
79
- // Update the result with all localized files.
80
- executionResult.outputFiles = [
81
- // Root files are not modified.
82
- ...executionResult.outputFiles.filter(({ type }) => type === bundler_context_1.BuildOutputFileType.Root),
83
- // Updated files for each locale.
84
- ...updatedOutputFiles,
85
- ];
86
- // Assets are only changed if not using the flat output option
87
- if (options.i18nOptions.flatOutput !== true) {
88
- executionResult.assetFiles = updatedAssetFiles;
89
- }
90
- return inlineResult;
91
- }
92
- exports.inlineI18n = inlineI18n;
93
- function getLocaleBaseHref(baseHref, i18n, locale) {
94
- if (i18n.flatOutput) {
95
- return undefined;
96
- }
97
- if (i18n.locales[locale] && i18n.locales[locale].baseHref !== '') {
98
- return (0, url_1.urlJoin)(baseHref || '', i18n.locales[locale].baseHref ?? `/${locale}/`);
99
- }
100
- return undefined;
101
- }
102
- /**
103
- * Loads all active translations using the translation loaders from the `@angular/localize` package.
104
- * @param context The architect builder context for the current build.
105
- * @param i18n The normalized i18n options to use.
106
- */
107
- async function loadActiveTranslations(context, i18n) {
108
- // Load locale data and translations (if present)
109
- let loader;
110
- for (const [locale, desc] of Object.entries(i18n.locales)) {
111
- if (!i18n.inlineLocales.has(locale) && locale !== i18n.sourceLocale) {
112
- continue;
113
- }
114
- if (!desc.files.length) {
115
- continue;
116
- }
117
- loader ??= await (0, load_translations_1.createTranslationLoader)();
118
- (0, i18n_options_1.loadTranslations)(locale, desc, context.workspaceRoot, loader, {
119
- warn(message) {
120
- context.logger.warn(message);
121
- },
122
- error(message) {
123
- throw new Error(message);
124
- },
125
- }, undefined, i18n.duplicateTranslationBehavior);
126
- }
127
- }
128
- exports.loadActiveTranslations = loadActiveTranslations;
@@ -1,57 +0,0 @@
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 { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
9
- import type { Plugin } from 'esbuild';
10
- import { BuildOutputFile } from '../../tools/esbuild/bundler-context';
11
- import { ApplicationBuilderExtensions, ApplicationBuilderInternalOptions } from './options';
12
- import { Schema as ApplicationBuilderOptions } from './schema';
13
- export { ApplicationBuilderOptions };
14
- export declare function buildApplicationInternal(options: ApplicationBuilderInternalOptions, context: BuilderContext & {
15
- signal?: AbortSignal;
16
- }, infrastructureSettings?: {
17
- write?: boolean;
18
- }, extensions?: ApplicationBuilderExtensions): AsyncIterable<ApplicationBuilderOutput>;
19
- export interface ApplicationBuilderOutput extends BuilderOutput {
20
- outputFiles?: BuildOutputFile[];
21
- assetFiles?: {
22
- source: string;
23
- destination: string;
24
- }[];
25
- }
26
- /**
27
- * Builds an application using the `application` builder with the provided
28
- * options.
29
- *
30
- * Usage of the `plugins` parameter is NOT supported and may cause unexpected
31
- * build output or build failures.
32
- *
33
- * @experimental Direct usage of this function is considered experimental.
34
- *
35
- * @param options The options defined by the builder's schema to use.
36
- * @param context An Architect builder context instance.
37
- * @param plugins An array of plugins to apply to the main code bundling.
38
- * @returns The build output results of the build.
39
- */
40
- export declare function buildApplication(options: ApplicationBuilderOptions, context: BuilderContext, plugins?: Plugin[]): AsyncIterable<ApplicationBuilderOutput>;
41
- /**
42
- * Builds an application using the `application` builder with the provided
43
- * options.
44
- *
45
- * Usage of the `extensions` parameter is NOT supported and may cause unexpected
46
- * build output or build failures.
47
- *
48
- * @experimental Direct usage of this function is considered experimental.
49
- *
50
- * @param options The options defined by the builder's schema to use.
51
- * @param context An Architect builder context instance.
52
- * @param extensions An object contain extension points for the build.
53
- * @returns The build output results of the build.
54
- */
55
- export declare function buildApplication(options: ApplicationBuilderOptions, context: BuilderContext, extensions?: ApplicationBuilderExtensions): AsyncIterable<ApplicationBuilderOutput>;
56
- declare const _default: import("../../../../architect/src/internal").Builder<ApplicationBuilderOptions & import("../../../../core/src").JsonObject>;
57
- export default _default;