@angular-builders/custom-esbuild 17.1.0-beta.0

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.
@@ -0,0 +1,690 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "title": "Custom application schema for Build Facade",
4
+ "description": "Application target options",
5
+ "type": "object",
6
+ "properties": {
7
+ "assets": {
8
+ "type": "array",
9
+ "description": "List of static application assets.",
10
+ "default": [],
11
+ "items": {
12
+ "$ref": "#/definitions/assetPattern"
13
+ }
14
+ },
15
+ "browser": {
16
+ "type": "string",
17
+ "description": "The full path for the browser entry point to the application, relative to the current workspace."
18
+ },
19
+ "server": {
20
+ "type": "string",
21
+ "description": "The full path for the server entry point to the application, relative to the current workspace."
22
+ },
23
+ "polyfills": {
24
+ "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'.",
25
+ "type": "array",
26
+ "items": {
27
+ "type": "string",
28
+ "uniqueItems": true
29
+ },
30
+ "default": []
31
+ },
32
+ "tsConfig": {
33
+ "type": "string",
34
+ "description": "The full path for the TypeScript configuration file, relative to the current workspace."
35
+ },
36
+ "scripts": {
37
+ "description": "Global scripts to be included in the build.",
38
+ "type": "array",
39
+ "default": [],
40
+ "items": {
41
+ "oneOf": [
42
+ {
43
+ "type": "object",
44
+ "properties": {
45
+ "input": {
46
+ "type": "string",
47
+ "description": "The file to include.",
48
+ "pattern": "\\.[cm]?jsx?$"
49
+ },
50
+ "bundleName": {
51
+ "type": "string",
52
+ "pattern": "^[\\w\\-.]*$",
53
+ "description": "The bundle name for this extra entry point."
54
+ },
55
+ "inject": {
56
+ "type": "boolean",
57
+ "description": "If the bundle will be referenced in the HTML file.",
58
+ "default": true
59
+ }
60
+ },
61
+ "additionalProperties": false,
62
+ "required": [
63
+ "input"
64
+ ]
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": [
100
+ "input"
101
+ ]
102
+ },
103
+ {
104
+ "type": "string",
105
+ "description": "The file to include.",
106
+ "pattern": "\\.(?:css|scss|sass|less)$"
107
+ }
108
+ ]
109
+ }
110
+ },
111
+ "inlineStyleLanguage": {
112
+ "description": "The stylesheet language to use for the application's inline component styles.",
113
+ "type": "string",
114
+ "default": "css",
115
+ "enum": [
116
+ "css",
117
+ "less",
118
+ "sass",
119
+ "scss"
120
+ ]
121
+ },
122
+ "stylePreprocessorOptions": {
123
+ "description": "Options to pass to style preprocessors.",
124
+ "type": "object",
125
+ "properties": {
126
+ "includePaths": {
127
+ "description": "Paths to include. Paths will be resolved to workspace root.",
128
+ "type": "array",
129
+ "items": {
130
+ "type": "string"
131
+ },
132
+ "default": []
133
+ }
134
+ },
135
+ "additionalProperties": false
136
+ },
137
+ "externalDependencies": {
138
+ "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.",
139
+ "type": "array",
140
+ "items": {
141
+ "type": "string"
142
+ },
143
+ "default": []
144
+ },
145
+ "optimization": {
146
+ "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.",
147
+ "default": true,
148
+ "x-user-analytics": "ep.ng_optimization",
149
+ "oneOf": [
150
+ {
151
+ "type": "object",
152
+ "properties": {
153
+ "scripts": {
154
+ "type": "boolean",
155
+ "description": "Enables optimization of the scripts output.",
156
+ "default": true
157
+ },
158
+ "styles": {
159
+ "description": "Enables optimization of the styles output.",
160
+ "default": true,
161
+ "oneOf": [
162
+ {
163
+ "type": "object",
164
+ "properties": {
165
+ "minify": {
166
+ "type": "boolean",
167
+ "description": "Minify CSS definitions by removing extraneous whitespace and comments, merging identifiers and minimizing values.",
168
+ "default": true
169
+ },
170
+ "inlineCritical": {
171
+ "type": "boolean",
172
+ "description": "Extract and inline critical CSS definitions to improve first paint time.",
173
+ "default": true
174
+ },
175
+ "removeSpecialComments": {
176
+ "type": "boolean",
177
+ "description": "Remove comments in global CSS that contains '@license' or '@preserve' or that starts with '//!' or '/*!'.",
178
+ "default": true
179
+ }
180
+ },
181
+ "additionalProperties": false
182
+ },
183
+ {
184
+ "type": "boolean"
185
+ }
186
+ ]
187
+ },
188
+ "fonts": {
189
+ "description": "Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.",
190
+ "default": true,
191
+ "oneOf": [
192
+ {
193
+ "type": "object",
194
+ "properties": {
195
+ "inline": {
196
+ "type": "boolean",
197
+ "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.",
198
+ "default": true
199
+ }
200
+ },
201
+ "additionalProperties": false
202
+ },
203
+ {
204
+ "type": "boolean"
205
+ }
206
+ ]
207
+ }
208
+ },
209
+ "additionalProperties": false
210
+ },
211
+ {
212
+ "type": "boolean"
213
+ }
214
+ ]
215
+ },
216
+ "loader": {
217
+ "description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `empty` considers the content to be empty and not include it in bundles.",
218
+ "type": "object",
219
+ "patternProperties": {
220
+ "^\\.\\S+$": {
221
+ "enum": [
222
+ "text",
223
+ "binary",
224
+ "file",
225
+ "empty"
226
+ ]
227
+ }
228
+ }
229
+ },
230
+ "fileReplacements": {
231
+ "description": "Replace compilation source files with other compilation source files in the build.",
232
+ "type": "array",
233
+ "items": {
234
+ "$ref": "#/definitions/fileReplacement"
235
+ },
236
+ "default": []
237
+ },
238
+ "outputPath": {
239
+ "description": "Specify the output path relative to workspace root.",
240
+ "oneOf": [
241
+ {
242
+ "type": "object",
243
+ "properties": {
244
+ "base": {
245
+ "type": "string",
246
+ "description": "Specify the output path relative to workspace root."
247
+ },
248
+ "browser": {
249
+ "type": "string",
250
+ "pattern": "^[-\\w\\.]*$",
251
+ "default": "browser",
252
+ "description": "The output directory name of your browser build within the output path base. Defaults to 'browser'."
253
+ },
254
+ "server": {
255
+ "type": "string",
256
+ "pattern": "^[-\\w\\.]*$",
257
+ "default": "server",
258
+ "description": "The output directory name of your server build within the output path base. Defaults to 'server'."
259
+ },
260
+ "media": {
261
+ "type": "string",
262
+ "pattern": "^[-\\w\\.]+$",
263
+ "default": "media",
264
+ "description": "The output directory name of your media files within the output browser directory. Defaults to 'media'."
265
+ }
266
+ },
267
+ "required": [
268
+ "base"
269
+ ],
270
+ "additionalProperties": false
271
+ },
272
+ {
273
+ "type": "string"
274
+ }
275
+ ]
276
+ },
277
+ "aot": {
278
+ "type": "boolean",
279
+ "description": "Build using Ahead of Time compilation.",
280
+ "x-user-analytics": "ep.ng_aot",
281
+ "default": true
282
+ },
283
+ "sourceMap": {
284
+ "description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
285
+ "default": false,
286
+ "oneOf": [
287
+ {
288
+ "type": "object",
289
+ "properties": {
290
+ "scripts": {
291
+ "type": "boolean",
292
+ "description": "Output source maps for all scripts.",
293
+ "default": true
294
+ },
295
+ "styles": {
296
+ "type": "boolean",
297
+ "description": "Output source maps for all styles.",
298
+ "default": true
299
+ },
300
+ "hidden": {
301
+ "type": "boolean",
302
+ "description": "Output source maps used for error reporting tools.",
303
+ "default": false
304
+ },
305
+ "vendor": {
306
+ "type": "boolean",
307
+ "description": "Resolve vendor packages source maps.",
308
+ "default": false
309
+ }
310
+ },
311
+ "additionalProperties": false
312
+ },
313
+ {
314
+ "type": "boolean"
315
+ }
316
+ ]
317
+ },
318
+ "baseHref": {
319
+ "type": "string",
320
+ "description": "Base url for the application being built."
321
+ },
322
+ "verbose": {
323
+ "type": "boolean",
324
+ "description": "Adds more details to output logging.",
325
+ "default": false
326
+ },
327
+ "progress": {
328
+ "type": "boolean",
329
+ "description": "Log progress to the console while building.",
330
+ "default": true
331
+ },
332
+ "i18nMissingTranslation": {
333
+ "type": "string",
334
+ "description": "How to handle missing translations for i18n.",
335
+ "enum": [
336
+ "warning",
337
+ "error",
338
+ "ignore"
339
+ ],
340
+ "default": "warning"
341
+ },
342
+ "i18nDuplicateTranslation": {
343
+ "type": "string",
344
+ "description": "How to handle duplicate translations for i18n.",
345
+ "enum": [
346
+ "warning",
347
+ "error",
348
+ "ignore"
349
+ ],
350
+ "default": "warning"
351
+ },
352
+ "localize": {
353
+ "description": "Translate the bundles in one or more locales.",
354
+ "oneOf": [
355
+ {
356
+ "type": "boolean",
357
+ "description": "Translate all locales."
358
+ },
359
+ {
360
+ "type": "array",
361
+ "description": "List of locales ID's to translate.",
362
+ "minItems": 1,
363
+ "items": {
364
+ "type": "string",
365
+ "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})+)?$"
366
+ }
367
+ }
368
+ ]
369
+ },
370
+ "watch": {
371
+ "type": "boolean",
372
+ "description": "Run build when files change.",
373
+ "default": false
374
+ },
375
+ "outputHashing": {
376
+ "type": "string",
377
+ "description": "Define the output filename cache-busting hashing mode.",
378
+ "default": "none",
379
+ "enum": [
380
+ "none",
381
+ "all",
382
+ "media",
383
+ "bundles"
384
+ ]
385
+ },
386
+ "poll": {
387
+ "type": "number",
388
+ "description": "Enable and define the file watching poll time period in milliseconds."
389
+ },
390
+ "deleteOutputPath": {
391
+ "type": "boolean",
392
+ "description": "Delete the output path before building.",
393
+ "default": true
394
+ },
395
+ "preserveSymlinks": {
396
+ "type": "boolean",
397
+ "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
398
+ },
399
+ "extractLicenses": {
400
+ "type": "boolean",
401
+ "description": "Extract all licenses in a separate file.",
402
+ "default": true
403
+ },
404
+ "namedChunks": {
405
+ "type": "boolean",
406
+ "description": "Use file name for lazy loaded chunks.",
407
+ "default": false
408
+ },
409
+ "subresourceIntegrity": {
410
+ "type": "boolean",
411
+ "description": "Enables the use of subresource integrity validation.",
412
+ "default": false
413
+ },
414
+ "serviceWorker": {
415
+ "description": "Generates a service worker configuration.",
416
+ "default": false,
417
+ "oneOf": [
418
+ {
419
+ "type": "string",
420
+ "description": "Path to ngsw-config.json."
421
+ },
422
+ {
423
+ "const": false,
424
+ "type": "boolean",
425
+ "description": "Does not generate a service worker configuration."
426
+ }
427
+ ]
428
+ },
429
+ "index": {
430
+ "description": "Configures the generation of the application's HTML index.",
431
+ "oneOf": [
432
+ {
433
+ "type": "string",
434
+ "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."
435
+ },
436
+ {
437
+ "type": "object",
438
+ "description": "",
439
+ "properties": {
440
+ "input": {
441
+ "type": "string",
442
+ "minLength": 1,
443
+ "description": "The path of a file to use for the application's generated HTML index."
444
+ },
445
+ "output": {
446
+ "type": "string",
447
+ "minLength": 1,
448
+ "default": "index.html",
449
+ "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."
450
+ },
451
+ "preloadInitial": {
452
+ "type": "boolean",
453
+ "default": true,
454
+ "description": "Generates 'preload', 'modulepreload', and 'preconnect' link elements for initial application files and resources."
455
+ }
456
+ },
457
+ "required": [
458
+ "input"
459
+ ]
460
+ },
461
+ {
462
+ "const": false,
463
+ "type": "boolean",
464
+ "description": "Does not generate an `index.html` file."
465
+ }
466
+ ]
467
+ },
468
+ "statsJson": {
469
+ "type": "boolean",
470
+ "description": "Generates a 'stats.json' file which can be analyzed with https://esbuild.github.io/analyze/.",
471
+ "default": false
472
+ },
473
+ "budgets": {
474
+ "description": "Budget thresholds to ensure parts of your application stay within boundaries which you set.",
475
+ "type": "array",
476
+ "items": {
477
+ "$ref": "#/definitions/budget"
478
+ },
479
+ "default": []
480
+ },
481
+ "webWorkerTsConfig": {
482
+ "type": "string",
483
+ "description": "TypeScript configuration for Web Worker modules."
484
+ },
485
+ "crossOrigin": {
486
+ "type": "string",
487
+ "description": "Define the crossorigin attribute setting of elements that provide CORS support.",
488
+ "default": "none",
489
+ "enum": [
490
+ "none",
491
+ "anonymous",
492
+ "use-credentials"
493
+ ]
494
+ },
495
+ "allowedCommonJsDependencies": {
496
+ "description": "A list of CommonJS or AMD packages that are allowed to be used without a build time warning. Use `'*'` to allow all.",
497
+ "type": "array",
498
+ "items": {
499
+ "type": "string"
500
+ },
501
+ "default": []
502
+ },
503
+ "prerender": {
504
+ "description": "Prerender (SSG) pages of your application during build time.",
505
+ "default": false,
506
+ "oneOf": [
507
+ {
508
+ "type": "boolean",
509
+ "description": "Enable prerending of pages of your application during build time."
510
+ },
511
+ {
512
+ "type": "object",
513
+ "properties": {
514
+ "routesFile": {
515
+ "type": "string",
516
+ "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."
517
+ },
518
+ "discoverRoutes": {
519
+ "type": "boolean",
520
+ "description": "Whether the builder should process the Angular Router configuration to find all unparameterized routes and prerender them.",
521
+ "default": true
522
+ }
523
+ },
524
+ "additionalProperties": false
525
+ }
526
+ ]
527
+ },
528
+ "ssr": {
529
+ "description": "Server side render (SSR) pages of your application during runtime.",
530
+ "default": false,
531
+ "oneOf": [
532
+ {
533
+ "type": "boolean",
534
+ "description": "Enable the server bundles to be written to disk."
535
+ },
536
+ {
537
+ "type": "object",
538
+ "properties": {
539
+ "entry": {
540
+ "type": "string",
541
+ "description": "The server entry-point that when executed will spawn the web server."
542
+ }
543
+ },
544
+ "additionalProperties": false
545
+ }
546
+ ]
547
+ },
548
+ "appShell": {
549
+ "type": "boolean",
550
+ "description": "Generates an application shell during build time.",
551
+ "default": false
552
+ },
553
+ "plugins": {
554
+ "description": "A list of paths to ESBuild plugins",
555
+ "default": [],
556
+ "items": {
557
+ "type": "string",
558
+ "uniqueItems": true
559
+ }
560
+ },
561
+ "indexHtmlTransformer": {
562
+ "description": "A path to the file with index.html transform function",
563
+ "type": "string"
564
+ }
565
+ },
566
+ "additionalProperties": false,
567
+ "required": [
568
+ "outputPath",
569
+ "index",
570
+ "browser",
571
+ "tsConfig"
572
+ ],
573
+ "definitions": {
574
+ "assetPattern": {
575
+ "oneOf": [
576
+ {
577
+ "type": "object",
578
+ "properties": {
579
+ "followSymlinks": {
580
+ "type": "boolean",
581
+ "default": false,
582
+ "description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched."
583
+ },
584
+ "glob": {
585
+ "type": "string",
586
+ "description": "The pattern to match."
587
+ },
588
+ "input": {
589
+ "type": "string",
590
+ "description": "The input directory path in which to apply 'glob'. Defaults to the project root."
591
+ },
592
+ "ignore": {
593
+ "description": "An array of globs to ignore.",
594
+ "type": "array",
595
+ "items": {
596
+ "type": "string"
597
+ }
598
+ },
599
+ "output": {
600
+ "type": "string",
601
+ "description": "Absolute path within the output."
602
+ }
603
+ },
604
+ "additionalProperties": false,
605
+ "required": [
606
+ "glob",
607
+ "input",
608
+ "output"
609
+ ]
610
+ },
611
+ {
612
+ "type": "string"
613
+ }
614
+ ]
615
+ },
616
+ "fileReplacement": {
617
+ "type": "object",
618
+ "properties": {
619
+ "replace": {
620
+ "type": "string",
621
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
622
+ },
623
+ "with": {
624
+ "type": "string",
625
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
626
+ }
627
+ },
628
+ "additionalProperties": false,
629
+ "required": [
630
+ "replace",
631
+ "with"
632
+ ]
633
+ },
634
+ "budget": {
635
+ "type": "object",
636
+ "properties": {
637
+ "type": {
638
+ "type": "string",
639
+ "description": "The type of budget.",
640
+ "enum": [
641
+ "all",
642
+ "allScript",
643
+ "any",
644
+ "anyScript",
645
+ "anyComponentStyle",
646
+ "bundle",
647
+ "initial"
648
+ ]
649
+ },
650
+ "name": {
651
+ "type": "string",
652
+ "description": "The name of the bundle."
653
+ },
654
+ "baseline": {
655
+ "type": "string",
656
+ "description": "The baseline size for comparison."
657
+ },
658
+ "maximumWarning": {
659
+ "type": "string",
660
+ "description": "The maximum threshold for warning relative to the baseline."
661
+ },
662
+ "maximumError": {
663
+ "type": "string",
664
+ "description": "The maximum threshold for error relative to the baseline."
665
+ },
666
+ "minimumWarning": {
667
+ "type": "string",
668
+ "description": "The minimum threshold for warning relative to the baseline."
669
+ },
670
+ "minimumError": {
671
+ "type": "string",
672
+ "description": "The minimum threshold for error relative to the baseline."
673
+ },
674
+ "warning": {
675
+ "type": "string",
676
+ "description": "The threshold for warning relative to the baseline (min & max)."
677
+ },
678
+ "error": {
679
+ "type": "string",
680
+ "description": "The threshold for error relative to the baseline (min & max)."
681
+ }
682
+ },
683
+ "additionalProperties": false,
684
+ "required": [
685
+ "type"
686
+ ]
687
+ }
688
+ },
689
+ "$id": "BuildCustomApplicationSchema"
690
+ }
@@ -0,0 +1,8 @@
1
+ import { ApplicationBuilderOptions, DevServerBuilderOptions } from '@angular-devkit/build-angular';
2
+ export type CustomEsbuildApplicationSchema = ApplicationBuilderOptions & {
3
+ plugins?: string[];
4
+ indexHtmlTransformer?: string;
5
+ };
6
+ export type CustomEsbuildDevServerSchema = DevServerBuilderOptions & {
7
+ middlewares?: string[];
8
+ };