@angular-builders/custom-esbuild 18.0.1-beta.0 → 19.0.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.
- package/README.md +27 -2
- package/dist/application/index.js +1 -2
- package/dist/application/index.js.map +1 -1
- package/dist/application/schema.json +103 -5
- package/dist/custom-esbuild-schema.d.ts +4 -0
- package/dist/dev-server/index.js +9 -9
- package/dist/dev-server/index.js.map +1 -1
- package/dist/dev-server/patch-builder-context.js +1 -2
- package/dist/dev-server/patch-builder-context.js.map +1 -1
- package/dist/dev-server/schema.json +3 -19
- package/dist/dev-server/types.d.ts +2 -0
- package/dist/dev-server/types.js +3 -0
- package/dist/dev-server/types.js.map +1 -0
- package/dist/load-plugins.d.ts +2 -1
- package/dist/load-plugins.js +11 -4
- package/dist/load-plugins.js.map +1 -1
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -100,19 +100,25 @@ Builder options:
|
|
|
100
100
|
"build": {
|
|
101
101
|
"builder": "@angular-builders/custom-esbuild:application",
|
|
102
102
|
"options": {
|
|
103
|
-
"plugins": ["./esbuild/plugins.ts", "./esbuild/
|
|
103
|
+
"plugins": ["./esbuild/plugins.ts", { "path": "./esbuild/define-env.ts", "options": { "stage": "development" } }],
|
|
104
104
|
"indexHtmlTransformer": "./esbuild/index-html-transformer.js",
|
|
105
105
|
"outputPath": "dist/my-cool-client",
|
|
106
106
|
"index": "src/index.html",
|
|
107
107
|
"browser": "src/main.ts",
|
|
108
108
|
"polyfills": ["zone.js"],
|
|
109
109
|
"tsConfig": "src/tsconfig.app.json"
|
|
110
|
+
},
|
|
111
|
+
"configurations": {
|
|
112
|
+
"production": {
|
|
113
|
+
"plugins": ["./esbuild/plugins.ts", { "path": "./esbuild/define-env.ts", "options": { "stage": "production" } }]
|
|
114
|
+
}
|
|
110
115
|
}
|
|
116
|
+
}
|
|
111
117
|
```
|
|
112
118
|
|
|
113
119
|
In the above example, we specify the list of `plugins` that should implement the ESBuild plugin schema. These plugins are custom user plugins and are added to the original ESBuild Angular configuration. Additionally, the `indexHtmlTransformer` property is used to specify the path to the file that exports the function used to modify the `index.html`.
|
|
114
120
|
|
|
115
|
-
The plugin file can export either a single plugin or a list of plugins
|
|
121
|
+
The plugin file can export either a single plugin or a list of plugins. If a plugin accepts configuration then the config should be provided in `angular.json`:
|
|
116
122
|
|
|
117
123
|
```ts
|
|
118
124
|
// esbuild/plugins.ts
|
|
@@ -129,6 +135,25 @@ const defineTextPlugin: Plugin = {
|
|
|
129
135
|
export default defineTextPlugin;
|
|
130
136
|
```
|
|
131
137
|
|
|
138
|
+
OR:
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
// esbuild/plugins.ts
|
|
142
|
+
import type { Plugin, PluginBuild } from 'esbuild';
|
|
143
|
+
|
|
144
|
+
function defineEnv(pluginOptions: { stage: string }): Plugin {
|
|
145
|
+
return {
|
|
146
|
+
name: 'define-env',
|
|
147
|
+
setup(build: PluginBuild) {
|
|
148
|
+
const buildOptions = build.initialOptions;
|
|
149
|
+
buildOptions.define.stage = JSON.stringify(pluginOptions.stage);
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export default defineEnv;
|
|
155
|
+
```
|
|
156
|
+
|
|
132
157
|
Or:
|
|
133
158
|
|
|
134
159
|
```ts
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.buildCustomEsbuildApplication =
|
|
12
|
+
exports.buildCustomEsbuildApplication = buildCustomEsbuildApplication;
|
|
13
13
|
const path = require("node:path");
|
|
14
14
|
const architect_1 = require("@angular-devkit/architect");
|
|
15
15
|
const build_angular_1 = require("@angular-devkit/build-angular");
|
|
@@ -28,6 +28,5 @@ function buildCustomEsbuildApplication(options, context) {
|
|
|
28
28
|
return { codePlugins, indexHtmlTransformer };
|
|
29
29
|
})).pipe((0, rxjs_1.switchMap)(extensions => (0, build_angular_1.buildApplication)(options, context, extensions)));
|
|
30
30
|
}
|
|
31
|
-
exports.buildCustomEsbuildApplication = buildCustomEsbuildApplication;
|
|
32
31
|
exports.default = (0, architect_1.createBuilder)(buildCustomEsbuildApplication);
|
|
33
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAWA,sEAoBC;AA/BD,kCAAkC;AAClC,yDAA0E;AAC1E,iEAAiE;AACjE,+CAAsE;AAEtE,+BAAwC;AACxC,qDAAsD;AAEtD,kDAA8C;AAG9C,SAAgB,6BAA6B,CAC3C,OAAuC,EACvC,OAAuB;IAEvB,MAAM,aAAa,GAAG,IAAA,oBAAa,EAAC,IAAA,gBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE5D,OAAO,IAAA,YAAK,EAAC,GAAS,EAAE;QACtB,MAAM,WAAW,GAAG,MAAM,IAAA,0BAAW,EAAC,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAEhG,MAAM,oBAAoB,GAAG,OAAO,CAAC,oBAAoB;YACvD,CAAC,CAAC,MAAM,IAAA,mBAAU,EACd,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,oBAAoB,CAAC,EACtD,QAAQ,EACR,OAAO,CAAC,MAAM,CACf;YACH,CAAC,CAAC,SAAS,CAAC;QAEd,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAkC,CAAC;IAC/E,CAAC,CAAA,CAAC,CAAC,IAAI,CAAC,IAAA,gBAAS,EAAC,UAAU,CAAC,EAAE,CAAC,IAAA,gCAAgB,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,kBAAe,IAAA,yBAAa,EAC1B,6BAA6B,CAC9B,CAAC"}
|
|
@@ -18,7 +18,18 @@
|
|
|
18
18
|
},
|
|
19
19
|
"server": {
|
|
20
20
|
"type": "string",
|
|
21
|
-
"description": "The full path for the server entry point to the application, relative to the current workspace."
|
|
21
|
+
"description": "The full path for the server entry point to the application, relative to the current workspace.",
|
|
22
|
+
"oneOf": [
|
|
23
|
+
{
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "The full path for the server entry point to the application, relative to the current workspace."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"const": false,
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Indicates that a server entry point is not provided."
|
|
31
|
+
}
|
|
32
|
+
]
|
|
22
33
|
},
|
|
23
34
|
"polyfills": {
|
|
24
35
|
"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'.",
|
|
@@ -37,6 +48,33 @@
|
|
|
37
48
|
"type": "string",
|
|
38
49
|
"description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
|
|
39
50
|
},
|
|
51
|
+
"security": {
|
|
52
|
+
"description": "Security features to protect against XSS and other common attacks",
|
|
53
|
+
"type": "object",
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"properties": {
|
|
56
|
+
"autoCsp": {
|
|
57
|
+
"description": "Enables automatic generation of a hash-based Strict Content Security Policy (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will default to true once we are out of experimental/preview phases.",
|
|
58
|
+
"default": false,
|
|
59
|
+
"oneOf": [
|
|
60
|
+
{
|
|
61
|
+
"type": "object",
|
|
62
|
+
"properties": {
|
|
63
|
+
"unsafeEval": {
|
|
64
|
+
"type": "boolean",
|
|
65
|
+
"description": "Include the `unsafe-eval` directive (https://web.dev/articles/strict-csp#remove-eval) in the auto-CSP. Please only enable this if you are absolutely sure that you need to, as allowing calls to eval will weaken the XSS defenses provided by the auto-CSP.",
|
|
66
|
+
"default": false
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"additionalProperties": false
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
40
78
|
"scripts": {
|
|
41
79
|
"description": "Global scripts to be included in the build.",
|
|
42
80
|
"type": "array",
|
|
@@ -134,6 +172,34 @@
|
|
|
134
172
|
"type": "string"
|
|
135
173
|
},
|
|
136
174
|
"default": []
|
|
175
|
+
},
|
|
176
|
+
"sass": {
|
|
177
|
+
"description": "Options to pass to the sass preprocessor.",
|
|
178
|
+
"type": "object",
|
|
179
|
+
"properties": {
|
|
180
|
+
"fatalDeprecations": {
|
|
181
|
+
"description": "A set of deprecations to treat as fatal. If a deprecation warning of any provided type is encountered during compilation, the compiler will error instead. If a Version is provided, then all deprecations that were active in that compiler version will be treated as fatal.",
|
|
182
|
+
"type": "array",
|
|
183
|
+
"items": {
|
|
184
|
+
"type": "string"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"silenceDeprecations": {
|
|
188
|
+
"description": " A set of active deprecations to ignore. If a deprecation warning of any provided type is encountered during compilation, the compiler will ignore it instead.",
|
|
189
|
+
"type": "array",
|
|
190
|
+
"items": {
|
|
191
|
+
"type": "string"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"futureDeprecations": {
|
|
195
|
+
"description": "A set of future deprecations to opt into early. Future deprecations passed here will be treated as active by the compiler, emitting warnings as necessary.",
|
|
196
|
+
"type": "array",
|
|
197
|
+
"items": {
|
|
198
|
+
"type": "string"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"additionalProperties": false
|
|
137
203
|
}
|
|
138
204
|
},
|
|
139
205
|
"additionalProperties": false
|
|
@@ -518,7 +584,6 @@
|
|
|
518
584
|
},
|
|
519
585
|
"prerender": {
|
|
520
586
|
"description": "Prerender (SSG) pages of your application during build time.",
|
|
521
|
-
"default": false,
|
|
522
587
|
"oneOf": [
|
|
523
588
|
{
|
|
524
589
|
"type": "boolean",
|
|
@@ -555,6 +620,14 @@
|
|
|
555
620
|
"entry": {
|
|
556
621
|
"type": "string",
|
|
557
622
|
"description": "The server entry-point that when executed will spawn the web server."
|
|
623
|
+
},
|
|
624
|
+
"experimentalPlatform": {
|
|
625
|
+
"description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules. Additionally, it is experimental, and the schematics may undergo changes in future versions.",
|
|
626
|
+
"default": "node",
|
|
627
|
+
"enum": [
|
|
628
|
+
"node",
|
|
629
|
+
"neutral"
|
|
630
|
+
]
|
|
558
631
|
}
|
|
559
632
|
},
|
|
560
633
|
"additionalProperties": false
|
|
@@ -563,15 +636,40 @@
|
|
|
563
636
|
},
|
|
564
637
|
"appShell": {
|
|
565
638
|
"type": "boolean",
|
|
566
|
-
"description": "Generates an application shell during build time."
|
|
567
|
-
|
|
639
|
+
"description": "Generates an application shell during build time."
|
|
640
|
+
},
|
|
641
|
+
"outputMode": {
|
|
642
|
+
"type": "string",
|
|
643
|
+
"description": "Defines the build output target. 'static': Generates a static site for deployment on any static hosting service. 'server': Produces an application designed for deployment on a server that supports server-side rendering (SSR).",
|
|
644
|
+
"enum": [
|
|
645
|
+
"static",
|
|
646
|
+
"server"
|
|
647
|
+
]
|
|
568
648
|
},
|
|
569
649
|
"plugins": {
|
|
570
650
|
"type": "array",
|
|
571
651
|
"description": "A list of paths to ESBuild plugins",
|
|
572
652
|
"default": [],
|
|
573
653
|
"items": {
|
|
574
|
-
"
|
|
654
|
+
"anyOf": [
|
|
655
|
+
{
|
|
656
|
+
"type": "string"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"type": "object",
|
|
660
|
+
"properties": {
|
|
661
|
+
"path": {
|
|
662
|
+
"type": "string"
|
|
663
|
+
},
|
|
664
|
+
"options": {
|
|
665
|
+
"type": "object"
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
"required": [
|
|
669
|
+
"path"
|
|
670
|
+
]
|
|
671
|
+
}
|
|
672
|
+
],
|
|
575
673
|
"uniqueItems": true
|
|
576
674
|
}
|
|
577
675
|
},
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ApplicationBuilderOptions, DevServerBuilderOptions } from '@angular-devkit/build-angular';
|
|
2
|
+
export type PluginConfig = string | {
|
|
3
|
+
path: string;
|
|
4
|
+
options?: Record<string, unknown>;
|
|
5
|
+
};
|
|
2
6
|
export type CustomEsbuildApplicationSchema = ApplicationBuilderOptions & {
|
|
3
7
|
plugins?: string[];
|
|
4
8
|
indexHtmlTransformer?: string;
|
package/dist/dev-server/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.executeCustomDevServerBuilder =
|
|
12
|
+
exports.executeCustomDevServerBuilder = executeCustomDevServerBuilder;
|
|
13
13
|
const path = require("node:path");
|
|
14
14
|
const architect_1 = require("@angular-devkit/architect");
|
|
15
15
|
const build_angular_1 = require("@angular-devkit/build-angular");
|
|
@@ -19,10 +19,7 @@ const common_1 = require("@angular-builders/common");
|
|
|
19
19
|
const load_plugins_1 = require("../load-plugins");
|
|
20
20
|
const patch_builder_context_1 = require("./patch-builder-context");
|
|
21
21
|
function executeCustomDevServerBuilder(options, context) {
|
|
22
|
-
|
|
23
|
-
const buildTarget = (0, architect_1.targetFromTargetString)(
|
|
24
|
-
// `browserTarget` has been deprecated.
|
|
25
|
-
(_a = options.buildTarget) !== null && _a !== void 0 ? _a : options.browserTarget);
|
|
22
|
+
const buildTarget = (0, architect_1.targetFromTargetString)(options.buildTarget);
|
|
26
23
|
function getBuildTargetOptions() {
|
|
27
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
25
|
return (yield context.getTargetOptions(buildTarget));
|
|
@@ -31,9 +28,13 @@ function executeCustomDevServerBuilder(options, context) {
|
|
|
31
28
|
const workspaceRoot = (0, core_1.getSystemPath)((0, core_1.normalize)(context.workspaceRoot));
|
|
32
29
|
return (0, rxjs_1.from)(getBuildTargetOptions()).pipe((0, rxjs_1.switchMap)((buildOptions) => __awaiter(this, void 0, void 0, function* () {
|
|
33
30
|
const tsConfig = path.join(workspaceRoot, buildOptions.tsConfig);
|
|
34
|
-
const middleware =
|
|
35
|
-
//
|
|
36
|
-
|
|
31
|
+
const middleware = [];
|
|
32
|
+
// Not using `Promise.all` preserves the order of middlewares as they
|
|
33
|
+
// are declared in the configuration list.
|
|
34
|
+
for (const middlewarePath of options.middlewares || []) {
|
|
35
|
+
// https://github.com/angular/angular-cli/pull/26212/files#diff-a99020cbdb97d20b2bc686bcb64b31942107d56db06fd880171b0a86f7859e6eR52
|
|
36
|
+
middleware.push(yield (0, common_1.loadModule)(path.join(workspaceRoot, middlewarePath), tsConfig, context.logger));
|
|
37
|
+
}
|
|
37
38
|
const buildPlugins = yield (0, load_plugins_1.loadPlugins)(buildOptions.plugins, workspaceRoot, tsConfig, context.logger);
|
|
38
39
|
const indexHtmlTransformer = buildOptions.indexHtmlTransformer
|
|
39
40
|
? yield (0, common_1.loadModule)(path.join(workspaceRoot, buildOptions.indexHtmlTransformer), tsConfig, context.logger)
|
|
@@ -45,6 +46,5 @@ function executeCustomDevServerBuilder(options, context) {
|
|
|
45
46
|
};
|
|
46
47
|
})), (0, rxjs_1.switchMap)(({ transforms, extensions }) => (0, build_angular_1.executeDevServerBuilder)(options, context, transforms, extensions)));
|
|
47
48
|
}
|
|
48
|
-
exports.executeCustomDevServerBuilder = executeCustomDevServerBuilder;
|
|
49
49
|
exports.default = (0, architect_1.createBuilder)(executeCustomDevServerBuilder);
|
|
50
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dev-server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dev-server/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAoBA,sEA2DC;AA/ED,kCAAkC;AAClC,yDAAkG;AAClG,iEAIuC;AAEvC,+CAAsE;AACtE,+BAAmD;AACnD,qDAAsD;AAGtD,kDAA8C;AAC9C,mEAA8D;AAM9D,SAAgB,6BAA6B,CAC3C,OAAqC,EACrC,OAAuB;IAEvB,MAAM,WAAW,GAAG,IAAA,kCAAsB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAEhE,SAAe,qBAAqB;;YAClC,OAAO,CAAC,MAAM,OAAO,CAAC,gBAAgB,CACpC,WAAW,CACZ,CAA8C,CAAC;QAClD,CAAC;KAAA;IAED,MAAM,aAAa,GAAG,IAAA,oBAAa,EAAC,IAAA,gBAAS,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IAEtE,OAAO,IAAA,WAAI,EAAC,qBAAqB,EAAE,CAAC,CAAC,IAAI,CACvC,IAAA,gBAAS,EAAC,CAAM,YAAY,EAAC,EAAE;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;QAEjE,MAAM,UAAU,GAAiB,EAAE,CAAC;QAEpC,qEAAqE;QACrE,0CAA0C;QAC1C,KAAK,MAAM,cAAc,IAAI,OAAO,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC;YACvD,mIAAmI;YACnI,UAAU,CAAC,IAAI,CACb,MAAM,IAAA,mBAAU,EACd,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,EACxC,QAAQ,EACR,OAAO,CAAC,MAAM,CACf,CACF,CAAC;QACJ,CAAC;QAED,MAAM,YAAY,GAAG,MAAM,IAAA,0BAAW,EACpC,YAAY,CAAC,OAAO,EACpB,aAAa,EACb,QAAQ,EACR,OAAO,CAAC,MAAM,CACf,CAAC;QAEF,MAAM,oBAAoB,GAAuB,YAAY,CAAC,oBAAoB;YAChF,CAAC,CAAC,MAAM,IAAA,mBAAU,EACd,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,oBAAoB,CAAC,EAC3D,QAAQ,EACR,OAAO,CAAC,MAAM,CACf;YACH,CAAC,CAAC,SAAS,CAAC;QAEd,IAAA,2CAAmB,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAE1C,OAAO;YACL,UAAU,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE;YAC/C,UAAU,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE;SACzC,CAAC;IACJ,CAAC,CAAA,CAAC,EACF,IAAA,gBAAS,EAAC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,CACvC,IAAA,uCAAuB,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CAClE,CACF,CAAC;AACJ,CAAC;AAED,kBAAe,IAAA,yBAAa,EAC1B,6BAA6B,CAC9B,CAAC"}
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.patchBuilderContext =
|
|
12
|
+
exports.patchBuilderContext = patchBuilderContext;
|
|
13
13
|
const executorToBuilderMap = new Map([
|
|
14
14
|
['@angular-builders/custom-esbuild', '@angular-devkit/build-angular:application'],
|
|
15
15
|
['@angular-builders/custom-esbuild:application', '@angular-devkit/build-angular:application'],
|
|
@@ -45,5 +45,4 @@ function patchBuilderContext(context, buildTarget) {
|
|
|
45
45
|
return options;
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
exports.patchBuilderContext = patchBuilderContext;
|
|
49
48
|
//# sourceMappingURL=patch-builder-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch-builder-context.js","sourceRoot":"","sources":["../../src/dev-server/patch-builder-context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patch-builder-context.js","sourceRoot":"","sources":["../../src/dev-server/patch-builder-context.ts"],"names":[],"mappings":";;;;;;;;;;;AAaA,kDAiCC;AA5CD,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAiB;IACnD,CAAC,kCAAkC,EAAE,2CAA2C,CAAC;IACjF,CAAC,8CAA8C,EAAE,2CAA2C,CAAC;CAC9F,CAAC,CAAC;AAEH,SAAS,uBAAuB,CAAC,OAAY;IAC3C,OAAO,OAAO,CAAC,OAAO,CAAC;IACvB,OAAO,OAAO,CAAC,oBAAoB,CAAC;IACpC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAgB,mBAAmB,CAAC,OAAuB,EAAE,WAAmB;IAC9E,MAAM,+BAA+B,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAExE,wEAAwE;IACxE,6EAA6E;IAC7E,wEAAwE;IACxE,4FAA4F;IAC5F,+EAA+E;IAC/E,kFAAkF;IAClF,OAAO,CAAC,uBAAuB,GAAG,CAAM,MAAM,EAAC,EAAE;QAC/C,MAAM,WAAW,GAAG,MAAM,+BAA+B,CAAC,MAAM,CAAC,CAAC;QAElE,IAAI,oBAAoB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAC1C,OAAO,oBAAoB,CAAC,GAAG,CAAC,WAAW,CAAE,CAAC;QAChD,CAAC;QAED,OAAO,WAAW,CAAC;IACrB,CAAC,CAAA,CAAC;IAEF,MAAM,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAC1D,OAAO,CAAC,gBAAgB,GAAG,CAAM,MAAM,EAAC,EAAE;QACxC,MAAM,OAAO,GAAG,MAAM,wBAAwB,CAAC,MAAM,CAAC,CAAC;QAEvD,IACE,MAAM,CAAC,OAAO,KAAK,WAAW,CAAC,OAAO;YACtC,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM;YACpC,MAAM,CAAC,aAAa,KAAK,WAAW,CAAC,aAAa,EAClD,CAAC;YACD,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC,CAAA,CAAC;AACJ,CAAC"}
|
|
@@ -4,12 +4,6 @@
|
|
|
4
4
|
"description": "Dev server target options",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
|
-
"browserTarget": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "A browser builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
|
|
10
|
-
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$",
|
|
11
|
-
"x-deprecated": "Use 'buildTarget' instead."
|
|
12
|
-
},
|
|
13
7
|
"buildTarget": {
|
|
14
8
|
"type": "string",
|
|
15
9
|
"description": "A build builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
|
|
@@ -90,8 +84,7 @@
|
|
|
90
84
|
},
|
|
91
85
|
"hmr": {
|
|
92
86
|
"type": "boolean",
|
|
93
|
-
"description": "Enable hot module replacement."
|
|
94
|
-
"default": false
|
|
87
|
+
"description": "Enable hot module replacement."
|
|
95
88
|
},
|
|
96
89
|
"watch": {
|
|
97
90
|
"type": "boolean",
|
|
@@ -155,17 +148,8 @@
|
|
|
155
148
|
}
|
|
156
149
|
},
|
|
157
150
|
"additionalProperties": false,
|
|
158
|
-
"
|
|
159
|
-
|
|
160
|
-
"required": [
|
|
161
|
-
"buildTarget"
|
|
162
|
-
]
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"required": [
|
|
166
|
-
"browserTarget"
|
|
167
|
-
]
|
|
168
|
-
}
|
|
151
|
+
"required": [
|
|
152
|
+
"buildTarget"
|
|
169
153
|
],
|
|
170
154
|
"$id": "CustomEsbuildDevServerSchema"
|
|
171
155
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/dev-server/types.ts"],"names":[],"mappings":""}
|
package/dist/load-plugins.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Plugin } from 'esbuild';
|
|
2
2
|
import type { logging } from '@angular-devkit/core';
|
|
3
|
-
|
|
3
|
+
import { PluginConfig } from './custom-esbuild-schema';
|
|
4
|
+
export declare function loadPlugins(pluginConfig: PluginConfig[] | undefined, workspaceRoot: string, tsConfig: string, logger: logging.LoggerApi): Promise<Plugin[]>;
|
package/dist/load-plugins.js
CHANGED
|
@@ -9,14 +9,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.loadPlugins =
|
|
12
|
+
exports.loadPlugins = loadPlugins;
|
|
13
13
|
const path = require("node:path");
|
|
14
14
|
const common_1 = require("@angular-builders/common");
|
|
15
|
-
function loadPlugins(
|
|
15
|
+
function loadPlugins(pluginConfig, workspaceRoot, tsConfig, logger) {
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const plugins = yield Promise.all((
|
|
17
|
+
const plugins = yield Promise.all((pluginConfig || []).map((pluginConfig) => __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
if (typeof pluginConfig === 'string') {
|
|
19
|
+
return (0, common_1.loadModule)(path.join(workspaceRoot, pluginConfig), tsConfig, logger);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const pluginFactory = yield (0, common_1.loadModule)(path.join(workspaceRoot, pluginConfig.path), tsConfig, logger);
|
|
23
|
+
return pluginFactory(pluginConfig.options);
|
|
24
|
+
}
|
|
25
|
+
})));
|
|
18
26
|
return plugins.flat();
|
|
19
27
|
});
|
|
20
28
|
}
|
|
21
|
-
exports.loadPlugins = loadPlugins;
|
|
22
29
|
//# sourceMappingURL=load-plugins.js.map
|
package/dist/load-plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-plugins.js","sourceRoot":"","sources":["../src/load-plugins.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-plugins.js","sourceRoot":"","sources":["../src/load-plugins.ts"],"names":[],"mappings":";;;;;;;;;;;AAMA,kCAoBC;AA1BD,kCAAkC;AAGlC,qDAAsD;AAGtD,SAAsB,WAAW,CAC/B,YAAwC,EACxC,aAAqB,EACrB,QAAgB,EAChB,MAAyB;;QAEzB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAM,YAAY,EAAC,EAAE;YAC1C,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;gBACrC,OAAO,IAAA,mBAAU,EAAoB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YACjG,CAAC;iBAAM,CAAC;gBACN,MAAM,aAAa,GAAG,MAAM,IAAA,mBAAU,EAA6B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAClI,OAAO,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAC7C,CAAC;QAEH,CAAC,CAAA,CACF,CACF,CAAC;QAEF,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-builders/custom-esbuild",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0-beta.0",
|
|
4
4
|
"description": "Custom esbuild builders for Angular build facade. Allow to modify Angular build configuration without ejecting it",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"author": "JeB Barabanov",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": "^
|
|
21
|
+
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"cli",
|
|
@@ -32,28 +32,29 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"prebuild": "yarn clean",
|
|
34
34
|
"build": "yarn prebuild && tsc && ts-node ../../merge-schemes.ts && yarn postbuild",
|
|
35
|
-
"postbuild": "yarn run e2e",
|
|
35
|
+
"postbuild": "yarn test && yarn run e2e",
|
|
36
|
+
"test": "jest --config ../../jest-ut.config.js",
|
|
36
37
|
"e2e": "jest --config ../../jest-e2e.config.js",
|
|
37
38
|
"clean": "rimraf dist",
|
|
38
39
|
"ci": "./scripts/ci.sh"
|
|
39
40
|
},
|
|
40
41
|
"builders": "builders.json",
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@angular-builders/common": "
|
|
43
|
-
"@angular-devkit/architect": ">=0.
|
|
44
|
-
"@angular-devkit/build-angular": "^
|
|
45
|
-
"@angular-devkit/core": "^
|
|
43
|
+
"@angular-builders/common": "3.0.0-beta.0",
|
|
44
|
+
"@angular-devkit/architect": ">=0.1900.0 < 0.2000.0",
|
|
45
|
+
"@angular-devkit/build-angular": "^19.0.0",
|
|
46
|
+
"@angular-devkit/core": "^19.0.0"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
|
-
"@angular/compiler-cli": "^
|
|
49
|
+
"@angular/compiler-cli": "^19.0.0"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@angular/build": "^
|
|
52
|
-
"esbuild": "0.
|
|
52
|
+
"@angular/build": "^19.0.0",
|
|
53
|
+
"esbuild": "0.24.0",
|
|
53
54
|
"jest": "29.7.0",
|
|
54
55
|
"rimraf": "^5.0.0",
|
|
55
56
|
"ts-node": "^10.0.0",
|
|
56
|
-
"typescript": "5.
|
|
57
|
+
"typescript": "5.6.2"
|
|
57
58
|
},
|
|
58
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "4095a1f909b0abbc48dcdb6484fc0dcd09d8cced"
|
|
59
60
|
}
|