@angular-builders/custom-esbuild 19.0.0 → 19.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.
- package/README.md +1 -1
- package/dist/application/index.js +2 -2
- package/dist/application/index.js.map +1 -1
- package/dist/dev-server/index.js +2 -1
- package/dist/dev-server/index.js.map +1 -1
- 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 +2 -2
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>`.
|
|
@@ -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"}
|
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;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,GAAG,YAAY,CAAC,oBAAoB;YAC5D,CAAC,CAAC,MAAM,IAAA,sDAAwB,EAC5B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,oBAAoB,CAAC,EAC3D,QAAQ,EACR,OAAO,CAAC,MAAM,EACd,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"}
|
|
@@ -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.0",
|
|
3
|
+
"version": "19.1.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": [
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"ts-node": "^10.0.0",
|
|
57
57
|
"typescript": "5.6.2"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "4b5468f24f2c91ebc2657599f9eef74d0017e648"
|
|
60
60
|
}
|