@angular-builders/custom-esbuild 19.0.0 → 19.1.0-beta.1
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 +1 -1
- package/dist/application/index.d.ts +6 -2
- package/dist/application/index.js +2 -2
- package/dist/application/index.js.map +1 -1
- package/dist/application/schema.json +1 -2
- package/dist/dev-server/index.d.ts +1 -1
- package/dist/dev-server/index.js +2 -1
- package/dist/dev-server/index.js.map +1 -1
- package/dist/dev-server/schema.json +3 -3
- package/dist/load-index-html-transformer.d.ts +4 -0
- package/dist/load-index-html-transformer.js +20 -0
- package/dist/load-index-html-transformer.js.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -212,7 +212,7 @@ The `@angular-builders/custom-esbuild:dev-server` is an enhanced version of the
|
|
|
212
212
|
Since Angular 8, `index.html` is not generated as part of the build. If you want to modify your `index.html`, you should use the `indexHtmlTransformer` option. `indexHtmlTransformer` is a path (relative to the workspace root) to a `.js` or `.ts` file that exports a transformation function for `index.html`. If `indexHtmlTransformer` is written in TypeScript, the application's `tsConfig` file will be used by `tsnode` for its execution:
|
|
213
213
|
|
|
214
214
|
```typescript
|
|
215
|
-
(indexHtmlContent: string) => string | Promise<string>;
|
|
215
|
+
(indexHtmlContent: string, target: Target) => string | Promise<string>;
|
|
216
216
|
```
|
|
217
217
|
|
|
218
218
|
or, in other words, the function receives target options and original `index.html` content (generated by Angular CLI) and returns a new content as `string` or `Promise<string>`.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
2
|
+
import { json } from '@angular-devkit/core';
|
|
2
3
|
import { CustomEsbuildApplicationSchema } from '../custom-esbuild-schema';
|
|
3
|
-
export declare function buildCustomEsbuildApplication(options: CustomEsbuildApplicationSchema, context: BuilderContext): import("rxjs").Observable<
|
|
4
|
-
declare const _default: import("@angular-devkit/architect
|
|
4
|
+
export declare function buildCustomEsbuildApplication(options: CustomEsbuildApplicationSchema, context: BuilderContext): import("rxjs").Observable<import("@angular-devkit/architect").BuilderOutput>;
|
|
5
|
+
declare const _default: import("@angular-devkit/architect").Builder<json.JsonObject & import("@angular-devkit/build-angular").ApplicationBuilderOptions & {
|
|
6
|
+
plugins?: string[];
|
|
7
|
+
indexHtmlTransformer?: string;
|
|
8
|
+
}>;
|
|
5
9
|
export default _default;
|
|
@@ -15,15 +15,15 @@ const architect_1 = require("@angular-devkit/architect");
|
|
|
15
15
|
const build_angular_1 = require("@angular-devkit/build-angular");
|
|
16
16
|
const core_1 = require("@angular-devkit/core");
|
|
17
17
|
const rxjs_1 = require("rxjs");
|
|
18
|
-
const common_1 = require("@angular-builders/common");
|
|
19
18
|
const load_plugins_1 = require("../load-plugins");
|
|
19
|
+
const load_index_html_transformer_1 = require("../load-index-html-transformer");
|
|
20
20
|
function buildCustomEsbuildApplication(options, context) {
|
|
21
21
|
const workspaceRoot = (0, core_1.getSystemPath)((0, core_1.normalize)(context.workspaceRoot));
|
|
22
22
|
const tsConfig = path.join(workspaceRoot, options.tsConfig);
|
|
23
23
|
return (0, rxjs_1.defer)(() => __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
const codePlugins = yield (0, load_plugins_1.loadPlugins)(options.plugins, workspaceRoot, tsConfig, context.logger);
|
|
25
25
|
const indexHtmlTransformer = options.indexHtmlTransformer
|
|
26
|
-
? yield (0,
|
|
26
|
+
? yield (0, load_index_html_transformer_1.loadIndexHtmlTransformer)(path.join(workspaceRoot, options.indexHtmlTransformer), tsConfig, context.logger, context.target)
|
|
27
27
|
: undefined;
|
|
28
28
|
return { codePlugins, indexHtmlTransformer };
|
|
29
29
|
})).pipe((0, rxjs_1.switchMap)(extensions => (0, build_angular_1.buildApplication)(options, context, extensions)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAWA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAWA,sEAqBC;AAhCD,kCAAkC;AAClC,yDAA0E;AAC1E,iEAAiE;AACjE,+CAAsE;AAEtE,+BAAwC;AAExC,kDAA8C;AAE9C,gFAA0E;AAE1E,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,sDAAwB,EAC5B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,oBAAoB,CAAC,EACtD,QAAQ,EACR,OAAO,CAAC,MAAM,EACd,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"}
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"description": "The full path for the browser entry point to the application, relative to the current workspace."
|
|
18
18
|
},
|
|
19
19
|
"server": {
|
|
20
|
-
"type": "string",
|
|
21
20
|
"description": "The full path for the server entry point to the application, relative to the current workspace.",
|
|
22
21
|
"oneOf": [
|
|
23
22
|
{
|
|
@@ -205,7 +204,7 @@
|
|
|
205
204
|
"additionalProperties": false
|
|
206
205
|
},
|
|
207
206
|
"externalDependencies": {
|
|
208
|
-
"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.",
|
|
207
|
+
"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. Note: `@foo/bar` marks all paths within the `@foo/bar` package as external, including sub-paths like `@foo/bar/baz`.",
|
|
209
208
|
"type": "array",
|
|
210
209
|
"items": {
|
|
211
210
|
"type": "string"
|
|
@@ -4,5 +4,5 @@ import { json } from '@angular-devkit/core';
|
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { CustomEsbuildDevServerSchema } from '../custom-esbuild-schema';
|
|
6
6
|
export declare function executeCustomDevServerBuilder(options: CustomEsbuildDevServerSchema, context: BuilderContext): Observable<DevServerBuilderOutput>;
|
|
7
|
-
declare const _default: import("@angular-devkit/architect
|
|
7
|
+
declare const _default: import("@angular-devkit/architect").Builder<DevServerBuilderOptions & json.JsonObject>;
|
|
8
8
|
export default _default;
|
package/dist/dev-server/index.js
CHANGED
|
@@ -18,6 +18,7 @@ const rxjs_1 = require("rxjs");
|
|
|
18
18
|
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
|
+
const load_index_html_transformer_1 = require("../load-index-html-transformer");
|
|
21
22
|
function executeCustomDevServerBuilder(options, context) {
|
|
22
23
|
const buildTarget = (0, architect_1.targetFromTargetString)(options.buildTarget);
|
|
23
24
|
function getBuildTargetOptions() {
|
|
@@ -37,7 +38,7 @@ function executeCustomDevServerBuilder(options, context) {
|
|
|
37
38
|
}
|
|
38
39
|
const buildPlugins = yield (0, load_plugins_1.loadPlugins)(buildOptions.plugins, workspaceRoot, tsConfig, context.logger);
|
|
39
40
|
const indexHtmlTransformer = buildOptions.indexHtmlTransformer
|
|
40
|
-
? yield (0,
|
|
41
|
+
? yield (0, load_index_html_transformer_1.loadIndexHtmlTransformer)(path.join(workspaceRoot, buildOptions.indexHtmlTransformer), tsConfig, context.logger, context.target)
|
|
41
42
|
: undefined;
|
|
42
43
|
(0, patch_builder_context_1.patchBuilderContext)(context, buildTarget);
|
|
43
44
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dev-server/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAoBA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dev-server/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAoBA,sEA4DC;AAhFD,kCAAkC;AAClC,yDAAkG;AAClG,iEAIuC;AACvC,+CAAsE;AACtE,+BAAmD;AACnD,qDAAsD;AAGtD,kDAA8C;AAC9C,mEAA8D;AAK9D,gFAA0E;AAE1E,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;QAE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of hosts that are allowed to access the dev server.
|
|
70
|
+
"description": "List of hosts that are allowed to access the dev server.",
|
|
71
71
|
"default": [],
|
|
72
72
|
"items": {
|
|
73
73
|
"type": "string"
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
"disableHostCheck": {
|
|
81
81
|
"type": "boolean",
|
|
82
|
-
"description": "Don't verify connected clients are part of allowed hosts.
|
|
82
|
+
"description": "Don't verify connected clients are part of allowed hosts.",
|
|
83
83
|
"default": false
|
|
84
84
|
},
|
|
85
85
|
"hmr": {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
},
|
|
111
111
|
"forceEsbuild": {
|
|
112
112
|
"type": "boolean",
|
|
113
|
-
"description": "Force the development server to use the 'browser-esbuild' builder when building.
|
|
113
|
+
"description": "Force the development server to use the 'browser-esbuild' builder when building.",
|
|
114
114
|
"default": false
|
|
115
115
|
},
|
|
116
116
|
"prebundle": {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { logging } from '@angular-devkit/core';
|
|
2
|
+
import { Target } from '@angular-devkit/architect';
|
|
3
|
+
import type { IndexHtmlTransform } from '@angular/build/src/utils/index-file/index-html-generator';
|
|
4
|
+
export declare function loadIndexHtmlTransformer(indexHtmlTransformerPath: string, tsConfig: string, logger: logging.LoggerApi, target: Target): Promise<IndexHtmlTransform>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.loadIndexHtmlTransformer = loadIndexHtmlTransformer;
|
|
13
|
+
const common_1 = require("@angular-builders/common");
|
|
14
|
+
function loadIndexHtmlTransformer(indexHtmlTransformerPath, tsConfig, logger, target) {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const transformer = yield (0, common_1.loadModule)(indexHtmlTransformerPath, tsConfig, logger);
|
|
17
|
+
return (indexHtml) => transformer(indexHtml, target);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=load-index-html-transformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-index-html-transformer.js","sourceRoot":"","sources":["../src/load-index-html-transformer.ts"],"names":[],"mappings":";;;;;;;;;;;AAKA,4DAYC;AAjBD,qDAAsD;AAKtD,SAAsB,wBAAwB,CAC5C,wBAAgC,EAChC,QAAgB,EAChB,MAAyB,EACzB,MAAc;;QAEd,MAAM,WAAW,GAAG,MAAM,IAAA,mBAAU,EAClC,wBAAwB,EACxB,QAAQ,EACR,MAAM,CACP,CAAC;QACF,OAAO,CAAC,SAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-builders/custom-esbuild",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.1.0-beta.1",
|
|
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": [
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@angular/build": "^19.0.0",
|
|
53
|
-
"esbuild": "0.
|
|
53
|
+
"esbuild": "0.25.1",
|
|
54
54
|
"jest": "29.7.0",
|
|
55
55
|
"rimraf": "^5.0.0",
|
|
56
56
|
"ts-node": "^10.0.0",
|
|
57
57
|
"typescript": "5.6.2"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "6edd45f7fa54119d585ff595715d03ead8631bee"
|
|
60
60
|
}
|