@nx/angular 17.2.0-beta.8 → 17.2.0-canary.20231206-a93ee1c

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 (41) hide show
  1. package/executors.d.ts +2 -1
  2. package/executors.js +2 -1
  3. package/executors.json +10 -5
  4. package/package.json +10 -10
  5. package/src/builders/dev-server/dev-server.impl.js +65 -24
  6. package/src/builders/utilities/module-federation.js +1 -1
  7. package/src/builders/webpack-browser/webpack-browser.impl.js +2 -1
  8. package/src/builders/webpack-server/webpack-server.impl.js +2 -1
  9. package/src/executors/application/application.impl.d.ts +9 -0
  10. package/src/executors/application/application.impl.js +28 -0
  11. package/src/executors/application/schema.d.ts +7 -0
  12. package/src/executors/application/schema.json +612 -0
  13. package/src/executors/browser-esbuild/browser-esbuild.impl.d.ts +2 -3
  14. package/src/executors/browser-esbuild/browser-esbuild.impl.js +15 -6
  15. package/src/executors/browser-esbuild/schema.d.ts +3 -1
  16. package/src/executors/browser-esbuild/schema.json +30 -0
  17. package/src/executors/module-federation-dev-server/lib/build-static-remotes.d.ts +7 -0
  18. package/src/executors/module-federation-dev-server/lib/build-static-remotes.js +49 -0
  19. package/src/executors/module-federation-dev-server/lib/index.d.ts +4 -0
  20. package/src/executors/module-federation-dev-server/lib/index.js +7 -0
  21. package/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +2 -0
  22. package/src/executors/module-federation-dev-server/lib/normalize-options.js +20 -0
  23. package/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +9 -0
  24. package/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +29 -0
  25. package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.d.ts +12 -0
  26. package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.js +48 -0
  27. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +3 -0
  28. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +110 -0
  29. package/src/{builders → executors}/module-federation-dev-server/schema.json +9 -3
  30. package/src/executors/utilities/buildable-libs.d.ts +6 -0
  31. package/src/executors/{browser-esbuild/lib → utilities}/buildable-libs.js +3 -4
  32. package/src/executors/utilities/esbuild-extensions.d.ts +6 -0
  33. package/src/executors/utilities/esbuild-extensions.js +27 -0
  34. package/src/executors/utilities/module-loader.d.ts +15 -0
  35. package/src/executors/utilities/module-loader.js +52 -0
  36. package/src/executors/utilities/ng-compiler-cli.d.ts +0 -14
  37. package/src/executors/utilities/ng-compiler-cli.js +3 -23
  38. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -5
  39. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +0 -232
  40. package/src/executors/browser-esbuild/lib/buildable-libs.d.ts +0 -9
  41. /package/src/{builders → executors}/module-federation-dev-server/schema.d.ts +0 -0
@@ -0,0 +1,612 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "title": "Schema for Nx Application Executor",
4
+ "description": "Builds an application with esbuild with support for incremental builds. _Note: this is only supported in Angular versions >= 17.0.0_.",
5
+ "examplesFile": "../../../docs/application-executor-examples.md",
6
+ "outputCapture": "direct-nodejs",
7
+ "type": "object",
8
+ "properties": {
9
+ "assets": {
10
+ "type": "array",
11
+ "description": "List of static application assets.",
12
+ "default": [],
13
+ "items": {
14
+ "$ref": "#/definitions/assetPattern"
15
+ }
16
+ },
17
+ "browser": {
18
+ "type": "string",
19
+ "description": "The full path for the browser entry point to the application, relative to the current workspace."
20
+ },
21
+ "server": {
22
+ "type": "string",
23
+ "description": "The full path for the server entry point to the application, relative to the current workspace."
24
+ },
25
+ "polyfills": {
26
+ "description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
27
+ "type": "array",
28
+ "items": {
29
+ "type": "string",
30
+ "uniqueItems": true
31
+ },
32
+ "default": []
33
+ },
34
+ "tsConfig": {
35
+ "type": "string",
36
+ "description": "The full path for the TypeScript configuration file, relative to the current workspace."
37
+ },
38
+ "scripts": {
39
+ "description": "Global scripts to be included in the build.",
40
+ "type": "array",
41
+ "default": [],
42
+ "items": {
43
+ "oneOf": [
44
+ {
45
+ "type": "object",
46
+ "properties": {
47
+ "input": {
48
+ "type": "string",
49
+ "description": "The file to include.",
50
+ "pattern": "\\.[cm]?jsx?$"
51
+ },
52
+ "bundleName": {
53
+ "type": "string",
54
+ "pattern": "^[\\w\\-.]*$",
55
+ "description": "The bundle name for this extra entry point."
56
+ },
57
+ "inject": {
58
+ "type": "boolean",
59
+ "description": "If the bundle will be referenced in the HTML file.",
60
+ "default": true
61
+ }
62
+ },
63
+ "additionalProperties": false,
64
+ "required": ["input"]
65
+ },
66
+ {
67
+ "type": "string",
68
+ "description": "The JavaScript/TypeScript file or package containing the file to include."
69
+ }
70
+ ]
71
+ }
72
+ },
73
+ "styles": {
74
+ "description": "Global styles to be included in the build.",
75
+ "type": "array",
76
+ "default": [],
77
+ "items": {
78
+ "oneOf": [
79
+ {
80
+ "type": "object",
81
+ "properties": {
82
+ "input": {
83
+ "type": "string",
84
+ "description": "The file to include.",
85
+ "pattern": "\\.(?:css|scss|sass|less)$"
86
+ },
87
+ "bundleName": {
88
+ "type": "string",
89
+ "pattern": "^[\\w\\-.]*$",
90
+ "description": "The bundle name for this extra entry point."
91
+ },
92
+ "inject": {
93
+ "type": "boolean",
94
+ "description": "If the bundle will be referenced in the HTML file.",
95
+ "default": true
96
+ }
97
+ },
98
+ "additionalProperties": false,
99
+ "required": ["input"]
100
+ },
101
+ {
102
+ "type": "string",
103
+ "description": "The file to include.",
104
+ "pattern": "\\.(?:css|scss|sass|less)$"
105
+ }
106
+ ]
107
+ }
108
+ },
109
+ "inlineStyleLanguage": {
110
+ "description": "The stylesheet language to use for the application's inline component styles.",
111
+ "type": "string",
112
+ "default": "css",
113
+ "enum": ["css", "less", "sass", "scss"]
114
+ },
115
+ "stylePreprocessorOptions": {
116
+ "description": "Options to pass to style preprocessors.",
117
+ "type": "object",
118
+ "properties": {
119
+ "includePaths": {
120
+ "description": "Paths to include. Paths will be resolved to workspace root.",
121
+ "type": "array",
122
+ "items": {
123
+ "type": "string"
124
+ },
125
+ "default": []
126
+ }
127
+ },
128
+ "additionalProperties": false
129
+ },
130
+ "externalDependencies": {
131
+ "description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.",
132
+ "type": "array",
133
+ "items": {
134
+ "type": "string"
135
+ },
136
+ "default": []
137
+ },
138
+ "optimization": {
139
+ "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
140
+ "default": true,
141
+ "x-user-analytics": "ep.ng_optimization",
142
+ "oneOf": [
143
+ {
144
+ "type": "object",
145
+ "properties": {
146
+ "scripts": {
147
+ "type": "boolean",
148
+ "description": "Enables optimization of the scripts output.",
149
+ "default": true
150
+ },
151
+ "styles": {
152
+ "description": "Enables optimization of the styles output.",
153
+ "default": true,
154
+ "oneOf": [
155
+ {
156
+ "type": "object",
157
+ "properties": {
158
+ "minify": {
159
+ "type": "boolean",
160
+ "description": "Minify CSS definitions by removing extraneous whitespace and comments, merging identifiers and minimizing values.",
161
+ "default": true
162
+ },
163
+ "inlineCritical": {
164
+ "type": "boolean",
165
+ "description": "Extract and inline critical CSS definitions to improve first paint time.",
166
+ "default": true
167
+ }
168
+ },
169
+ "additionalProperties": false
170
+ },
171
+ {
172
+ "type": "boolean"
173
+ }
174
+ ]
175
+ },
176
+ "fonts": {
177
+ "description": "Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.",
178
+ "default": true,
179
+ "oneOf": [
180
+ {
181
+ "type": "object",
182
+ "properties": {
183
+ "inline": {
184
+ "type": "boolean",
185
+ "description": "Reduce render blocking requests by inlining external Google Fonts and Adobe Fonts CSS definitions in the application's HTML index file. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.",
186
+ "default": true
187
+ }
188
+ },
189
+ "additionalProperties": false
190
+ },
191
+ {
192
+ "type": "boolean"
193
+ }
194
+ ]
195
+ }
196
+ },
197
+ "additionalProperties": false
198
+ },
199
+ {
200
+ "type": "boolean"
201
+ }
202
+ ]
203
+ },
204
+ "fileReplacements": {
205
+ "description": "Replace compilation source files with other compilation source files in the build.",
206
+ "type": "array",
207
+ "items": {
208
+ "$ref": "#/definitions/fileReplacement"
209
+ },
210
+ "default": []
211
+ },
212
+ "outputPath": {
213
+ "type": "string",
214
+ "description": "The full path for the new output directory, relative to the current workspace."
215
+ },
216
+ "aot": {
217
+ "type": "boolean",
218
+ "description": "Build using Ahead of Time compilation.",
219
+ "x-user-analytics": "ep.ng_aot",
220
+ "default": true
221
+ },
222
+ "sourceMap": {
223
+ "description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
224
+ "default": false,
225
+ "oneOf": [
226
+ {
227
+ "type": "object",
228
+ "properties": {
229
+ "scripts": {
230
+ "type": "boolean",
231
+ "description": "Output source maps for all scripts.",
232
+ "default": true
233
+ },
234
+ "styles": {
235
+ "type": "boolean",
236
+ "description": "Output source maps for all styles.",
237
+ "default": true
238
+ },
239
+ "hidden": {
240
+ "type": "boolean",
241
+ "description": "Output source maps used for error reporting tools.",
242
+ "default": false
243
+ },
244
+ "vendor": {
245
+ "type": "boolean",
246
+ "description": "Resolve vendor packages source maps.",
247
+ "default": false
248
+ }
249
+ },
250
+ "additionalProperties": false
251
+ },
252
+ {
253
+ "type": "boolean"
254
+ }
255
+ ]
256
+ },
257
+ "baseHref": {
258
+ "type": "string",
259
+ "description": "Base url for the application being built."
260
+ },
261
+ "verbose": {
262
+ "type": "boolean",
263
+ "description": "Adds more details to output logging.",
264
+ "default": false
265
+ },
266
+ "progress": {
267
+ "type": "boolean",
268
+ "description": "Log progress to the console while building.",
269
+ "default": true
270
+ },
271
+ "i18nMissingTranslation": {
272
+ "type": "string",
273
+ "description": "How to handle missing translations for i18n.",
274
+ "enum": ["warning", "error", "ignore"],
275
+ "default": "warning"
276
+ },
277
+ "i18nDuplicateTranslation": {
278
+ "type": "string",
279
+ "description": "How to handle duplicate translations for i18n.",
280
+ "enum": ["warning", "error", "ignore"],
281
+ "default": "warning"
282
+ },
283
+ "localize": {
284
+ "description": "Translate the bundles in one or more locales.",
285
+ "oneOf": [
286
+ {
287
+ "type": "boolean",
288
+ "description": "Translate all locales."
289
+ },
290
+ {
291
+ "type": "array",
292
+ "description": "List of locales ID's to translate.",
293
+ "minItems": 1,
294
+ "items": {
295
+ "type": "string",
296
+ "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$"
297
+ }
298
+ }
299
+ ]
300
+ },
301
+ "watch": {
302
+ "type": "boolean",
303
+ "description": "Run build when files change.",
304
+ "default": false
305
+ },
306
+ "outputHashing": {
307
+ "type": "string",
308
+ "description": "Define the output filename cache-busting hashing mode.",
309
+ "default": "none",
310
+ "enum": ["none", "all", "media", "bundles"]
311
+ },
312
+ "poll": {
313
+ "type": "number",
314
+ "description": "Enable and define the file watching poll time period in milliseconds."
315
+ },
316
+ "deleteOutputPath": {
317
+ "type": "boolean",
318
+ "description": "Delete the output path before building.",
319
+ "default": true
320
+ },
321
+ "preserveSymlinks": {
322
+ "type": "boolean",
323
+ "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
324
+ },
325
+ "extractLicenses": {
326
+ "type": "boolean",
327
+ "description": "Extract all licenses in a separate file.",
328
+ "default": true
329
+ },
330
+ "namedChunks": {
331
+ "type": "boolean",
332
+ "description": "Use file name for lazy loaded chunks.",
333
+ "default": false
334
+ },
335
+ "subresourceIntegrity": {
336
+ "type": "boolean",
337
+ "description": "Enables the use of subresource integrity validation.",
338
+ "default": false
339
+ },
340
+ "serviceWorker": {
341
+ "description": "Generates a service worker configuration.",
342
+ "default": false,
343
+ "oneOf": [
344
+ {
345
+ "type": "string",
346
+ "description": "Path to ngsw-config.json."
347
+ },
348
+ {
349
+ "const": false,
350
+ "type": "boolean",
351
+ "description": "Does not generate a service worker configuration."
352
+ }
353
+ ]
354
+ },
355
+ "index": {
356
+ "description": "Configures the generation of the application's HTML index.",
357
+ "oneOf": [
358
+ {
359
+ "type": "string",
360
+ "description": "The path of a file to use for the application's HTML index. The filename of the specified path will be used for the generated file and will be created in the root of the application's configured output path."
361
+ },
362
+ {
363
+ "type": "object",
364
+ "description": "",
365
+ "properties": {
366
+ "input": {
367
+ "type": "string",
368
+ "minLength": 1,
369
+ "description": "The path of a file to use for the application's generated HTML index."
370
+ },
371
+ "output": {
372
+ "type": "string",
373
+ "minLength": 1,
374
+ "default": "index.html",
375
+ "description": "The output path of the application's generated HTML index file. The full provided path will be used and will be considered relative to the application's configured output path."
376
+ }
377
+ },
378
+ "required": ["input"]
379
+ },
380
+ {
381
+ "const": false,
382
+ "type": "boolean",
383
+ "description": "Does not generate an `index.html` file."
384
+ }
385
+ ]
386
+ },
387
+ "statsJson": {
388
+ "type": "boolean",
389
+ "description": "Generates a 'stats.json' file which can be analyzed with https://esbuild.github.io/analyze/.",
390
+ "default": false
391
+ },
392
+ "budgets": {
393
+ "description": "Budget thresholds to ensure parts of your application stay within boundaries which you set.",
394
+ "type": "array",
395
+ "items": {
396
+ "$ref": "#/definitions/budget"
397
+ },
398
+ "default": []
399
+ },
400
+ "webWorkerTsConfig": {
401
+ "type": "string",
402
+ "description": "TypeScript configuration for Web Worker modules."
403
+ },
404
+ "crossOrigin": {
405
+ "type": "string",
406
+ "description": "Define the crossorigin attribute setting of elements that provide CORS support.",
407
+ "default": "none",
408
+ "enum": ["none", "anonymous", "use-credentials"]
409
+ },
410
+ "allowedCommonJsDependencies": {
411
+ "description": "A list of CommonJS or AMD packages that are allowed to be used without a build time warning. Use `'*'` to allow all.",
412
+ "type": "array",
413
+ "items": {
414
+ "type": "string"
415
+ },
416
+ "default": []
417
+ },
418
+ "prerender": {
419
+ "description": "Prerender (SSG) pages of your application during build time.",
420
+ "default": false,
421
+ "oneOf": [
422
+ {
423
+ "type": "boolean",
424
+ "description": "Enable prerending of pages of your application during build time."
425
+ },
426
+ {
427
+ "type": "object",
428
+ "properties": {
429
+ "routesFile": {
430
+ "type": "string",
431
+ "description": "The path to a file that contains a list of all routes to prerender, separated by newlines. This option is useful if you want to prerender routes with parameterized URLs."
432
+ },
433
+ "discoverRoutes": {
434
+ "type": "boolean",
435
+ "description": "Whether the builder should process the Angular Router configuration to find all unparameterized routes and prerender them.",
436
+ "default": true
437
+ }
438
+ },
439
+ "additionalProperties": false
440
+ }
441
+ ]
442
+ },
443
+ "ssr": {
444
+ "description": "Server side render (SSR) pages of your application during runtime.",
445
+ "default": false,
446
+ "oneOf": [
447
+ {
448
+ "type": "boolean",
449
+ "description": "Enable the server bundles to be written to disk."
450
+ },
451
+ {
452
+ "type": "object",
453
+ "properties": {
454
+ "entry": {
455
+ "type": "string",
456
+ "description": "The server entry-point that when executed will spawn the web server."
457
+ }
458
+ },
459
+ "additionalProperties": false
460
+ }
461
+ ]
462
+ },
463
+ "appShell": {
464
+ "type": "boolean",
465
+ "description": "Generates an application shell during build time.",
466
+ "default": false
467
+ },
468
+ "buildLibsFromSource": {
469
+ "type": "boolean",
470
+ "description": "Read buildable libraries from source instead of building them separately.",
471
+ "default": true
472
+ },
473
+ "plugins": {
474
+ "description": "A list of ESBuild plugins.",
475
+ "type": "array",
476
+ "items": {
477
+ "oneOf": [
478
+ {
479
+ "type": "object",
480
+ "properties": {
481
+ "path": {
482
+ "type": "string",
483
+ "description": "The path to the plugin. Relative to the workspace root."
484
+ },
485
+ "options": {
486
+ "type": "object",
487
+ "description": "The options to provide to the plugin.",
488
+ "properties": {},
489
+ "additionalProperties": true
490
+ }
491
+ },
492
+ "additionalProperties": false,
493
+ "required": ["path"]
494
+ },
495
+ {
496
+ "type": "string",
497
+ "description": "The path to the plugin. Relative to the workspace root."
498
+ }
499
+ ]
500
+ }
501
+ }
502
+ },
503
+ "additionalProperties": false,
504
+ "required": ["outputPath", "index", "browser", "tsConfig"],
505
+ "definitions": {
506
+ "assetPattern": {
507
+ "oneOf": [
508
+ {
509
+ "type": "object",
510
+ "properties": {
511
+ "followSymlinks": {
512
+ "type": "boolean",
513
+ "default": false,
514
+ "description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched."
515
+ },
516
+ "glob": {
517
+ "type": "string",
518
+ "description": "The pattern to match."
519
+ },
520
+ "input": {
521
+ "type": "string",
522
+ "description": "The input directory path in which to apply 'glob'. Defaults to the project root."
523
+ },
524
+ "ignore": {
525
+ "description": "An array of globs to ignore.",
526
+ "type": "array",
527
+ "items": {
528
+ "type": "string"
529
+ }
530
+ },
531
+ "output": {
532
+ "type": "string",
533
+ "description": "Absolute path within the output."
534
+ }
535
+ },
536
+ "additionalProperties": false,
537
+ "required": ["glob", "input", "output"]
538
+ },
539
+ {
540
+ "type": "string"
541
+ }
542
+ ]
543
+ },
544
+ "fileReplacement": {
545
+ "type": "object",
546
+ "properties": {
547
+ "replace": {
548
+ "type": "string",
549
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
550
+ },
551
+ "with": {
552
+ "type": "string",
553
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
554
+ }
555
+ },
556
+ "additionalProperties": false,
557
+ "required": ["replace", "with"]
558
+ },
559
+ "budget": {
560
+ "type": "object",
561
+ "properties": {
562
+ "type": {
563
+ "type": "string",
564
+ "description": "The type of budget.",
565
+ "enum": [
566
+ "all",
567
+ "allScript",
568
+ "any",
569
+ "anyScript",
570
+ "anyComponentStyle",
571
+ "bundle",
572
+ "initial"
573
+ ]
574
+ },
575
+ "name": {
576
+ "type": "string",
577
+ "description": "The name of the bundle."
578
+ },
579
+ "baseline": {
580
+ "type": "string",
581
+ "description": "The baseline size for comparison."
582
+ },
583
+ "maximumWarning": {
584
+ "type": "string",
585
+ "description": "The maximum threshold for warning relative to the baseline."
586
+ },
587
+ "maximumError": {
588
+ "type": "string",
589
+ "description": "The maximum threshold for error relative to the baseline."
590
+ },
591
+ "minimumWarning": {
592
+ "type": "string",
593
+ "description": "The minimum threshold for warning relative to the baseline."
594
+ },
595
+ "minimumError": {
596
+ "type": "string",
597
+ "description": "The minimum threshold for error relative to the baseline."
598
+ },
599
+ "warning": {
600
+ "type": "string",
601
+ "description": "The threshold for warning relative to the baseline (min & max)."
602
+ },
603
+ "error": {
604
+ "type": "string",
605
+ "description": "The threshold for error relative to the baseline (min & max)."
606
+ }
607
+ },
608
+ "additionalProperties": false,
609
+ "required": ["type"]
610
+ }
611
+ }
612
+ }
@@ -1,8 +1,7 @@
1
- import { type EsBuildSchema } from './schema';
2
1
  import { type ExecutorContext } from '@nx/devkit';
3
- import { type OutputFile } from 'esbuild';
2
+ import type { EsBuildSchema } from './schema';
4
3
  export default function esbuildExecutor(options: EsBuildSchema, context: ExecutorContext): AsyncGenerator<import("@angular-devkit/core").JsonObject & import("@angular-devkit/architect/src/output-schema").Schema & {
5
- outputFiles?: OutputFile[];
4
+ outputFiles?: import("@angular-devkit/build-angular/src/tools/esbuild/bundler-context").BuildOutputFile[];
6
5
  assetFiles?: {
7
6
  source: string;
8
7
  destination: string;
@@ -1,25 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const devkit_1 = require("@nx/devkit");
4
- const buildable_libs_1 = require("./lib/buildable-libs");
5
4
  const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
5
+ const angular_version_utils_1 = require("../utilities/angular-version-utils");
6
+ const buildable_libs_1 = require("../utilities/buildable-libs");
7
+ const esbuild_extensions_1 = require("../utilities/esbuild-extensions");
6
8
  async function* esbuildExecutor(options, context) {
9
+ if (options.plugins) {
10
+ const { major: angularMajorVersion, version: angularVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
11
+ if (angularMajorVersion < 17) {
12
+ throw new Error((0, devkit_1.stripIndents) `The "plugins" option is only supported in Angular >= 17.0.0. You are currently using "${angularVersion}".
13
+ You can resolve this error by removing the "plugins" option or by migrating to Angular 17.0.0.`);
14
+ }
15
+ }
7
16
  options.buildLibsFromSource ??= true;
8
- const { buildLibsFromSource, ...delegateExecutorOptions } = options;
17
+ const { buildLibsFromSource, plugins: pluginPaths, ...delegateExecutorOptions } = options;
9
18
  let dependencies;
10
- let projectGraph = context.projectGraph;
11
19
  if (!buildLibsFromSource) {
12
- projectGraph = projectGraph ?? (0, devkit_1.readCachedProjectGraph)();
13
- const { tsConfigPath, dependencies: foundDependencies } = (0, buildable_libs_1.createTmpTsConfigForBuildableLibs)(delegateExecutorOptions.tsConfig, context, { projectGraph });
20
+ const { tsConfigPath, dependencies: foundDependencies } = (0, buildable_libs_1.createTmpTsConfigForBuildableLibs)(delegateExecutorOptions.tsConfig, context);
14
21
  dependencies = foundDependencies;
15
22
  delegateExecutorOptions.tsConfig = tsConfigPath;
16
23
  }
24
+ const plugins = await (0, esbuild_extensions_1.loadPlugins)(pluginPaths, options.tsConfig);
17
25
  const { buildEsbuildBrowser } = await Promise.resolve().then(() => require('@angular-devkit/build-angular/src/builders/browser-esbuild/index'));
18
26
  const builderContext = await (0, ngcli_adapter_1.createBuilderContext)({
19
27
  builderName: 'browser-esbuild',
20
28
  description: 'Build a browser application',
21
29
  optionSchema: await Promise.resolve().then(() => require('@angular-devkit/build-angular/src/builders/browser-esbuild/schema.json')),
22
30
  }, context);
23
- return yield* buildEsbuildBrowser(delegateExecutorOptions, builderContext);
31
+ return yield* buildEsbuildBrowser(delegateExecutorOptions, builderContext,
32
+ /* infrastructureSettings */ undefined, plugins);
24
33
  }
25
34
  exports.default = esbuildExecutor;
@@ -1,5 +1,7 @@
1
- import { Schema } from '@angular-devkit/build-angular/src/builders/browser-esbuild/schema';
1
+ import type { Schema } from '@angular-devkit/build-angular/src/builders/browser-esbuild/schema';
2
+ import type { PluginSpec } from '../utilities/esbuild-extensions';
2
3
 
3
4
  export interface EsBuildSchema extends Schema {
4
5
  buildLibsFromSource?: boolean;
6
+ plugins?: string[] | PluginSpec[];
5
7
  }