@nx/angular-rspack 0.0.0-pr-32422-a3285be
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/LICENSE +22 -0
- package/README.md +98 -0
- package/README.md__tpl__ +48 -0
- package/dist/lib/config/config-utils/browser-config.d.ts +4 -0
- package/dist/lib/config/config-utils/browser-config.d.ts.map +1 -0
- package/dist/lib/config/config-utils/browser-config.js +83 -0
- package/dist/lib/config/config-utils/common-config.d.ts +3 -0
- package/dist/lib/config/config-utils/common-config.d.ts.map +1 -0
- package/dist/lib/config/config-utils/common-config.js +144 -0
- package/dist/lib/config/config-utils/dev-server-config-utils.d.ts +4 -0
- package/dist/lib/config/config-utils/dev-server-config-utils.d.ts.map +1 -0
- package/dist/lib/config/config-utils/dev-server-config-utils.js +258 -0
- package/dist/lib/config/config-utils/entry-points.d.ts +9 -0
- package/dist/lib/config/config-utils/entry-points.d.ts.map +1 -0
- package/dist/lib/config/config-utils/entry-points.js +36 -0
- package/dist/lib/config/config-utils/get-stats-options.d.ts +3 -0
- package/dist/lib/config/config-utils/get-stats-options.d.ts.map +1 -0
- package/dist/lib/config/config-utils/get-stats-options.js +39 -0
- package/dist/lib/config/config-utils/helpers.d.ts +13 -0
- package/dist/lib/config/config-utils/helpers.d.ts.map +1 -0
- package/dist/lib/config/config-utils/helpers.js +106 -0
- package/dist/lib/config/config-utils/optimization-config.d.ts +5 -0
- package/dist/lib/config/config-utils/optimization-config.d.ts.map +1 -0
- package/dist/lib/config/config-utils/optimization-config.js +69 -0
- package/dist/lib/config/config-utils/server-config.d.ts +4 -0
- package/dist/lib/config/config-utils/server-config.d.ts.map +1 -0
- package/dist/lib/config/config-utils/server-config.js +92 -0
- package/dist/lib/config/config-utils/sourcemap-utils.d.ts +7 -0
- package/dist/lib/config/config-utils/sourcemap-utils.d.ts.map +1 -0
- package/dist/lib/config/config-utils/sourcemap-utils.js +48 -0
- package/dist/lib/config/config-utils/style-config-utils.d.ts +7 -0
- package/dist/lib/config/config-utils/style-config-utils.d.ts.map +1 -0
- package/dist/lib/config/config-utils/style-config-utils.js +353 -0
- package/dist/lib/config/config-utils/user-defined-config-helpers.d.ts +73 -0
- package/dist/lib/config/config-utils/user-defined-config-helpers.d.ts.map +1 -0
- package/dist/lib/config/config-utils/user-defined-config-helpers.js +23 -0
- package/dist/lib/config/create-config.d.ts +11 -0
- package/dist/lib/config/create-config.d.ts.map +1 -0
- package/dist/lib/config/create-config.js +35 -0
- package/dist/lib/config/i18n/create-i18n-options.d.ts +6 -0
- package/dist/lib/config/i18n/create-i18n-options.d.ts.map +1 -0
- package/dist/lib/config/i18n/create-i18n-options.js +124 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +14 -0
- package/dist/lib/models/angular-rspack-plugin-options.d.ts +344 -0
- package/dist/lib/models/angular-rspack-plugin-options.d.ts.map +1 -0
- package/dist/lib/models/angular-rspack-plugin-options.js +2 -0
- package/dist/lib/models/augmented-compilation.d.ts +13 -0
- package/dist/lib/models/augmented-compilation.d.ts.map +1 -0
- package/dist/lib/models/augmented-compilation.js +4 -0
- package/dist/lib/models/i18n.d.ts +33 -0
- package/dist/lib/models/i18n.d.ts.map +1 -0
- package/dist/lib/models/i18n.js +41 -0
- package/dist/lib/models/index.d.ts +5 -0
- package/dist/lib/models/index.d.ts.map +1 -0
- package/dist/lib/models/index.js +7 -0
- package/dist/lib/models/normalize-options.d.ts +16 -0
- package/dist/lib/models/normalize-options.d.ts.map +1 -0
- package/dist/lib/models/normalize-options.js +424 -0
- package/dist/lib/plugins/angular-rspack-plugin.d.ts +9 -0
- package/dist/lib/plugins/angular-rspack-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/angular-rspack-plugin.js +234 -0
- package/dist/lib/plugins/angular-ssr-dev-server.d.ts +8 -0
- package/dist/lib/plugins/angular-ssr-dev-server.d.ts.map +1 -0
- package/dist/lib/plugins/angular-ssr-dev-server.js +62 -0
- package/dist/lib/plugins/any-component-style-budget-checker-plugin.d.ts +19 -0
- package/dist/lib/plugins/any-component-style-budget-checker-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/any-component-style-budget-checker-plugin.js +64 -0
- package/dist/lib/plugins/client/ssr-reload-client.d.ts +2 -0
- package/dist/lib/plugins/client/ssr-reload-client.d.ts.map +1 -0
- package/dist/lib/plugins/client/ssr-reload-client.js +15 -0
- package/dist/lib/plugins/i18n-inline-plugin.d.ts +8 -0
- package/dist/lib/plugins/i18n-inline-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/i18n-inline-plugin.js +201 -0
- package/dist/lib/plugins/index-html-plugin.d.ts +21 -0
- package/dist/lib/plugins/index-html-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/index-html-plugin.js +107 -0
- package/dist/lib/plugins/loaders/angular-partial-transform.loader.d.ts +3 -0
- package/dist/lib/plugins/loaders/angular-partial-transform.loader.d.ts.map +1 -0
- package/dist/lib/plugins/loaders/angular-partial-transform.loader.js +39 -0
- package/dist/lib/plugins/loaders/angular-transform.loader.d.ts +7 -0
- package/dist/lib/plugins/loaders/angular-transform.loader.d.ts.map +1 -0
- package/dist/lib/plugins/loaders/angular-transform.loader.js +40 -0
- package/dist/lib/plugins/loaders/hmr-accept-loader.d.ts +11 -0
- package/dist/lib/plugins/loaders/hmr-accept-loader.d.ts.map +1 -0
- package/dist/lib/plugins/loaders/hmr-accept-loader.js +24 -0
- package/dist/lib/plugins/loaders/hmr-accept.d.ts +9 -0
- package/dist/lib/plugins/loaders/hmr-accept.d.ts.map +1 -0
- package/dist/lib/plugins/loaders/hmr-accept.js +183 -0
- package/dist/lib/plugins/loaders/platform-server-exports.loader.d.ts +5 -0
- package/dist/lib/plugins/loaders/platform-server-exports.loader.d.ts.map +1 -0
- package/dist/lib/plugins/loaders/platform-server-exports.loader.js +18 -0
- package/dist/lib/plugins/ng-rspack.d.ts +13 -0
- package/dist/lib/plugins/ng-rspack.d.ts.map +1 -0
- package/dist/lib/plugins/ng-rspack.js +134 -0
- package/dist/lib/plugins/prerender-plugin.d.ts +8 -0
- package/dist/lib/plugins/prerender-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/prerender-plugin.js +216 -0
- package/dist/lib/plugins/progress-plugin.d.ts +12 -0
- package/dist/lib/plugins/progress-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/progress-plugin.js +36 -0
- package/dist/lib/plugins/rxjs-esm-resolution.d.ts +5 -0
- package/dist/lib/plugins/rxjs-esm-resolution.d.ts.map +1 -0
- package/dist/lib/plugins/rxjs-esm-resolution.js +15 -0
- package/dist/lib/plugins/server/ssr-reload-server.d.ts +6 -0
- package/dist/lib/plugins/server/ssr-reload-server.d.ts.map +1 -0
- package/dist/lib/plugins/server/ssr-reload-server.js +21 -0
- package/dist/lib/plugins/stats-json-plugin.d.ts +14 -0
- package/dist/lib/plugins/stats-json-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/stats-json-plugin.js +69 -0
- package/dist/lib/plugins/suppress-js-for-css-chunks-plugin.d.ts +5 -0
- package/dist/lib/plugins/suppress-js-for-css-chunks-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/suppress-js-for-css-chunks-plugin.js +34 -0
- package/dist/lib/plugins/tools/dev-tools-ignore-plugin.d.ts +17 -0
- package/dist/lib/plugins/tools/dev-tools-ignore-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/tools/dev-tools-ignore-plugin.js +57 -0
- package/dist/lib/plugins/tools/render-worker.d.ts +31 -0
- package/dist/lib/plugins/tools/render-worker.d.ts.map +1 -0
- package/dist/lib/plugins/tools/render-worker.js +105 -0
- package/dist/lib/plugins/tools/routes-extractor-worker.d.ts +21 -0
- package/dist/lib/plugins/tools/routes-extractor-worker.d.ts.map +1 -0
- package/dist/lib/plugins/tools/routes-extractor-worker.js +48 -0
- package/dist/lib/plugins/tools/worker-pool.d.ts +13 -0
- package/dist/lib/plugins/tools/worker-pool.d.ts.map +1 -0
- package/dist/lib/plugins/tools/worker-pool.js +23 -0
- package/dist/lib/plugins/transfer-size-plugin.d.ts +12 -0
- package/dist/lib/plugins/transfer-size-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/transfer-size-plugin.js +49 -0
- package/dist/lib/plugins/watch-file-logs-plugin.d.ts +12 -0
- package/dist/lib/plugins/watch-file-logs-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/watch-file-logs-plugin.js +27 -0
- package/dist/lib/utils/async-chunks.d.ts +17 -0
- package/dist/lib/utils/async-chunks.d.ts.map +1 -0
- package/dist/lib/utils/async-chunks.js +44 -0
- package/dist/lib/utils/color.d.ts +11 -0
- package/dist/lib/utils/color.d.ts.map +1 -0
- package/dist/lib/utils/color.js +41 -0
- package/dist/lib/utils/find-project-for-path.d.ts +16 -0
- package/dist/lib/utils/find-project-for-path.d.ts.map +1 -0
- package/dist/lib/utils/find-project-for-path.js +42 -0
- package/dist/lib/utils/get-locale-base-href.d.ts +3 -0
- package/dist/lib/utils/get-locale-base-href.d.ts.map +1 -0
- package/dist/lib/utils/get-locale-base-href.js +17 -0
- package/dist/lib/utils/graph.d.ts +3 -0
- package/dist/lib/utils/graph.d.ts.map +1 -0
- package/dist/lib/utils/graph.js +25 -0
- package/dist/lib/utils/i18n.d.ts +4 -0
- package/dist/lib/utils/i18n.d.ts.map +1 -0
- package/dist/lib/utils/i18n.js +25 -0
- package/dist/lib/utils/index-file/add-body-script.d.ts +2 -0
- package/dist/lib/utils/index-file/add-body-script.d.ts.map +1 -0
- package/dist/lib/utils/index-file/add-body-script.js +15 -0
- package/dist/lib/utils/index-file/add-event-dispatch-contract.d.ts +9 -0
- package/dist/lib/utils/index-file/add-event-dispatch-contract.d.ts.map +1 -0
- package/dist/lib/utils/index-file/add-event-dispatch-contract.js +27 -0
- package/dist/lib/utils/index-file/get-index-input-file.d.ts +3 -0
- package/dist/lib/utils/index-file/get-index-input-file.d.ts.map +1 -0
- package/dist/lib/utils/index-file/get-index-input-file.js +9 -0
- package/dist/lib/utils/index-file/get-index-output-file.d.ts +3 -0
- package/dist/lib/utils/index-file/get-index-output-file.d.ts.map +1 -0
- package/dist/lib/utils/index-file/get-index-output-file.js +10 -0
- package/dist/lib/utils/index-file/html-rewriting-stream.d.ts +16 -0
- package/dist/lib/utils/index-file/html-rewriting-stream.d.ts.map +1 -0
- package/dist/lib/utils/index-file/html-rewriting-stream.js +27 -0
- package/dist/lib/utils/max-workers.d.ts +2 -0
- package/dist/lib/utils/max-workers.d.ts.map +1 -0
- package/dist/lib/utils/max-workers.js +21 -0
- package/dist/lib/utils/misc-helpers.d.ts +7 -0
- package/dist/lib/utils/misc-helpers.d.ts.map +1 -0
- package/dist/lib/utils/misc-helpers.js +34 -0
- package/dist/lib/utils/postcss-cli-resources.d.ts +22 -0
- package/dist/lib/utils/postcss-cli-resources.d.ts.map +1 -0
- package/dist/lib/utils/postcss-cli-resources.js +159 -0
- package/dist/lib/utils/postcss-configuration.d.ts +18 -0
- package/dist/lib/utils/postcss-configuration.d.ts.map +1 -0
- package/dist/lib/utils/postcss-configuration.js +92 -0
- package/dist/lib/utils/rspack-diagnostics.d.ts +4 -0
- package/dist/lib/utils/rspack-diagnostics.d.ts.map +1 -0
- package/dist/lib/utils/rspack-diagnostics.js +22 -0
- package/dist/lib/utils/spinner.d.ts +21 -0
- package/dist/lib/utils/spinner.d.ts.map +1 -0
- package/dist/lib/utils/spinner.js +54 -0
- package/dist/lib/utils/stats.d.ts +35 -0
- package/dist/lib/utils/stats.d.ts.map +1 -0
- package/dist/lib/utils/stats.js +313 -0
- package/dist/lib/utils/tty.d.ts +9 -0
- package/dist/lib/utils/tty.d.ts.map +1 -0
- package/dist/lib/utils/tty.js +22 -0
- package/dist/lib/utils/url-join.d.ts +9 -0
- package/dist/lib/utils/url-join.d.ts.map +1 -0
- package/dist/lib/utils/url-join.js +17 -0
- package/package.json +150 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { ProgressPlugin as RspackProgressPlugin } from '@rspack/core';
|
|
9
|
+
export declare class ProgressPlugin extends RspackProgressPlugin {
|
|
10
|
+
constructor(platform: 'server' | 'browser');
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=progress-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/progress-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGtE,qBAAa,cAAe,SAAQ,oBAAoB;gBAC1C,QAAQ,EAAE,QAAQ,GAAG,SAAS;CA6B3C"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ProgressPlugin = void 0;
|
|
11
|
+
const core_1 = require("@rspack/core");
|
|
12
|
+
const spinner_1 = require("../utils/spinner");
|
|
13
|
+
class ProgressPlugin extends core_1.ProgressPlugin {
|
|
14
|
+
constructor(platform) {
|
|
15
|
+
const platformCapitalFirst = platform.replace(/^\w/, (s) => s.toUpperCase());
|
|
16
|
+
const spinner = new spinner_1.Spinner();
|
|
17
|
+
spinner.start(`Generating ${platform} application bundles (phase: setup)...`);
|
|
18
|
+
super((percentage, message) => {
|
|
19
|
+
const phase = message ? ` (phase: ${message})` : '';
|
|
20
|
+
spinner.text = `Generating ${platform} application bundles${phase}...`;
|
|
21
|
+
switch (percentage) {
|
|
22
|
+
case 1:
|
|
23
|
+
if (spinner.isSpinning) {
|
|
24
|
+
spinner.succeed(`${platformCapitalFirst} application bundle generation complete.`);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
case 0:
|
|
28
|
+
if (!spinner.isSpinning) {
|
|
29
|
+
spinner.start();
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ProgressPlugin = ProgressPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rxjs-esm-resolution.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/rxjs-esm-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE9D,qBAAa,uBAAwB,YAAW,oBAAoB;IAClE,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAezB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RxjsEsmResolutionPlugin = void 0;
|
|
4
|
+
class RxjsEsmResolutionPlugin {
|
|
5
|
+
apply(compiler) {
|
|
6
|
+
compiler.hooks.normalModuleFactory.tap('RxJSEsmResolution', (normalModuleFactory) => {
|
|
7
|
+
normalModuleFactory.hooks.resolve.tap('RxJSEsmResolution', (data) => {
|
|
8
|
+
if (data.request.startsWith('rxjs')) {
|
|
9
|
+
data.request = data.request.replace(/([\\/]dist[\\/])cjs([\\/])/, '$1esm$2');
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.RxjsEsmResolutionPlugin = RxjsEsmResolutionPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr-reload-server.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/server/ssr-reload-server.ts"],"names":[],"mappings":"AAEA,qBAAa,eAAe;;;IAS1B,UAAU;CAKX"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _SsrReloadServer_server;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SsrReloadServer = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const ws_1 = require("ws");
|
|
7
|
+
class SsrReloadServer {
|
|
8
|
+
constructor() {
|
|
9
|
+
_SsrReloadServer_server.set(this, void 0);
|
|
10
|
+
tslib_1.__classPrivateFieldSet(this, _SsrReloadServer_server, new ws_1.WebSocket.Server({ port: 60_000 }), "f");
|
|
11
|
+
process.on('SIGTERM', () => tslib_1.__classPrivateFieldGet(this, _SsrReloadServer_server, "f").close());
|
|
12
|
+
process.on('exit', () => tslib_1.__classPrivateFieldGet(this, _SsrReloadServer_server, "f").close());
|
|
13
|
+
}
|
|
14
|
+
sendReload() {
|
|
15
|
+
tslib_1.__classPrivateFieldGet(this, _SsrReloadServer_server, "f").clients.forEach((client) => {
|
|
16
|
+
client.send('ssr-reload');
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.SsrReloadServer = SsrReloadServer;
|
|
21
|
+
_SsrReloadServer_server = new WeakMap();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import type { RspackPluginInstance, Compiler } from '@rspack/core';
|
|
9
|
+
export declare class StatsJsonPlugin implements RspackPluginInstance {
|
|
10
|
+
private readonly statsOutputPath;
|
|
11
|
+
constructor(statsOutputPath: string);
|
|
12
|
+
apply(compiler: Compiler): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=stats-json-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-json-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/stats-json-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAInE,qBAAa,eAAgB,YAAW,oBAAoB;IAC9C,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,MAAM;IAEpD,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAuBzB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.StatsJsonPlugin = void 0;
|
|
44
|
+
const node_fs_1 = require("node:fs");
|
|
45
|
+
const promises_1 = require("node:fs/promises");
|
|
46
|
+
const node_path_1 = require("node:path");
|
|
47
|
+
const promises_2 = require("node:stream/promises");
|
|
48
|
+
const misc_helpers_1 = require("../utils/misc-helpers");
|
|
49
|
+
const rspack_diagnostics_1 = require("../utils/rspack-diagnostics");
|
|
50
|
+
class StatsJsonPlugin {
|
|
51
|
+
constructor(statsOutputPath) {
|
|
52
|
+
this.statsOutputPath = statsOutputPath;
|
|
53
|
+
}
|
|
54
|
+
apply(compiler) {
|
|
55
|
+
compiler.hooks.done.tapPromise('AngularRspackStatsJsonPlugin', async (stats) => {
|
|
56
|
+
const { stringifyChunked } = await Promise.resolve().then(() => __importStar(require('@discoveryjs/json-ext')));
|
|
57
|
+
const data = stats.toJson('verbose');
|
|
58
|
+
try {
|
|
59
|
+
await (0, promises_1.mkdir)((0, node_path_1.dirname)(this.statsOutputPath), { recursive: true });
|
|
60
|
+
await (0, promises_2.pipeline)(stringifyChunked(data), (0, node_fs_1.createWriteStream)(this.statsOutputPath));
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
(0, misc_helpers_1.assertIsError)(error);
|
|
64
|
+
(0, rspack_diagnostics_1.addError)(stats.compilation, `Unable to write stats file: ${error.message || 'unknown error'}`);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.StatsJsonPlugin = StatsJsonPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppress-js-for-css-chunks-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/suppress-js-for-css-chunks-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE5E,qBAAa,+BAAgC,YAAW,oBAAoB;IAC1E,KAAK,CAAC,QAAQ,EAAE,QAAQ;CA6CzB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SuppressJsForCssOnlyEntryPlugin = void 0;
|
|
4
|
+
class SuppressJsForCssOnlyEntryPlugin {
|
|
5
|
+
apply(compiler) {
|
|
6
|
+
compiler.hooks.thisCompilation.tap('SuppressJsForCssOnlyEntryPlugin', (compilation) => {
|
|
7
|
+
compilation.hooks.processAssets.tap({
|
|
8
|
+
name: 'SuppressJsForCssOnlyEntryPlugin',
|
|
9
|
+
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE,
|
|
10
|
+
}, (_) => {
|
|
11
|
+
for (const chunk of compilation.chunks) {
|
|
12
|
+
const cssFiles = [...chunk.files].filter((f) => f.endsWith('.css'));
|
|
13
|
+
const jsFiles = [...chunk.files].filter((f) => f.endsWith('.js'));
|
|
14
|
+
// Only act if chunk has CSS and a single JS file
|
|
15
|
+
if (cssFiles.length > 0 && jsFiles.length === 1) {
|
|
16
|
+
const jsAssetName = jsFiles[0];
|
|
17
|
+
const asset = compilation.getAsset(jsAssetName);
|
|
18
|
+
if (!asset)
|
|
19
|
+
continue;
|
|
20
|
+
const entryModules = compilation.chunkGraph.getChunkEntryModulesIterable(chunk);
|
|
21
|
+
const cssOnly = Array.from(entryModules).every((module) => {
|
|
22
|
+
const extensions = ['.css', '.scss', '.sass', '.less'];
|
|
23
|
+
return extensions.some((ext) => module.resourceResolveData?.path?.endsWith(ext));
|
|
24
|
+
});
|
|
25
|
+
if (cssOnly) {
|
|
26
|
+
compilation.deleteAsset(jsAssetName);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.SuppressJsForCssOnlyEntryPlugin = SuppressJsForCssOnlyEntryPlugin;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { Compiler, RspackPluginInstance } from '@rspack/core';
|
|
9
|
+
/**
|
|
10
|
+
* This plugin adds a field to source maps that identifies which sources are
|
|
11
|
+
* vendored or runtime-injected (aka third-party) sources. These are consumed by
|
|
12
|
+
* Chrome DevTools to automatically ignore-list sources.
|
|
13
|
+
*/
|
|
14
|
+
export declare class DevToolsIgnorePlugin implements RspackPluginInstance {
|
|
15
|
+
apply(compiler: Compiler): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=dev-tools-ignore-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-tools-ignore-plugin.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/tools/dev-tools-ignore-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAe,QAAQ,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAa3E;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,oBAAoB;IAC/D,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAgDzB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.DevToolsIgnorePlugin = void 0;
|
|
11
|
+
const core_1 = require("@rspack/core");
|
|
12
|
+
// Following the naming conventions from
|
|
13
|
+
// https://sourcemaps.info/spec.html#h.ghqpj1ytqjbm
|
|
14
|
+
const IGNORE_LIST = 'x_google_ignoreList';
|
|
15
|
+
const PLUGIN_NAME = 'devtools-ignore-plugin';
|
|
16
|
+
/**
|
|
17
|
+
* This plugin adds a field to source maps that identifies which sources are
|
|
18
|
+
* vendored or runtime-injected (aka third-party) sources. These are consumed by
|
|
19
|
+
* Chrome DevTools to automatically ignore-list sources.
|
|
20
|
+
*/
|
|
21
|
+
class DevToolsIgnorePlugin {
|
|
22
|
+
apply(compiler) {
|
|
23
|
+
const { RawSource } = compiler.rspack.sources;
|
|
24
|
+
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|
25
|
+
compilation.hooks.processAssets.tap({
|
|
26
|
+
name: PLUGIN_NAME,
|
|
27
|
+
stage: core_1.Compilation.PROCESS_ASSETS_STAGE_DEV_TOOLING,
|
|
28
|
+
}, (assets) => {
|
|
29
|
+
for (const [name, asset] of Object.entries(assets)) {
|
|
30
|
+
// Instead of using `asset.map()` to fetch the source maps from
|
|
31
|
+
// SourceMapSource assets, process them directly as a RawSource.
|
|
32
|
+
// This is because `.map()` is slow and can take several seconds.
|
|
33
|
+
if (!name.endsWith('.map')) {
|
|
34
|
+
// Ignore non source map files.
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const mapContent = asset.source().toString();
|
|
38
|
+
if (!mapContent) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
const map = JSON.parse(mapContent);
|
|
42
|
+
const ignoreList = [];
|
|
43
|
+
for (const [index, path] of map.sources.entries()) {
|
|
44
|
+
if (path.includes('/node_modules/') ||
|
|
45
|
+
path.startsWith('webpack/') ||
|
|
46
|
+
path.startsWith('rspack/')) {
|
|
47
|
+
ignoreList.push(index);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
map[IGNORE_LIST] = ignoreList;
|
|
51
|
+
compilation.updateAsset(name, new RawSource(JSON.stringify(map)), (assetInfo) => assetInfo);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.DevToolsIgnorePlugin = DevToolsIgnorePlugin;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
export interface RenderOptions {
|
|
9
|
+
indexFile: string;
|
|
10
|
+
deployUrl: string;
|
|
11
|
+
inlineCriticalCss: boolean;
|
|
12
|
+
minifyCss: boolean;
|
|
13
|
+
outputPath: string;
|
|
14
|
+
serverBundlePath: string;
|
|
15
|
+
route: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RenderResult {
|
|
18
|
+
errors?: string[];
|
|
19
|
+
warnings?: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Renders each route in routes and writes them to <outputPath>/<route>/index.html.
|
|
23
|
+
*/
|
|
24
|
+
declare function render({ indexFile, deployUrl, minifyCss, outputPath, serverBundlePath, route, inlineCriticalCss, }: RenderOptions): Promise<RenderResult>;
|
|
25
|
+
/**
|
|
26
|
+
* The default export will be the promise returned by the initialize function.
|
|
27
|
+
* This is awaited by piscina prior to using the Worker.
|
|
28
|
+
*/
|
|
29
|
+
declare const _default: Promise<typeof render>;
|
|
30
|
+
export default _default;
|
|
31
|
+
//# sourceMappingURL=render-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-worker.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/tools/render-worker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AA2BD;;GAEG;AACH,iBAAe,MAAM,CAAC,EACpB,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,KAAK,EACL,iBAAiB,GAClB,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAmGvC;AAuBD;;;GAGG;;AACH,wBAA4B"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
const node_assert_1 = tslib_1.__importDefault(require("node:assert"));
|
|
12
|
+
const fs = tslib_1.__importStar(require("node:fs"));
|
|
13
|
+
const path = tslib_1.__importStar(require("node:path"));
|
|
14
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
15
|
+
/**
|
|
16
|
+
* The fully resolved path to the zone.js package that will be loaded during worker initialization.
|
|
17
|
+
* This is passed as workerData when setting up the worker via the `piscina` package.
|
|
18
|
+
*/
|
|
19
|
+
const { zonePackage } = node_worker_threads_1.workerData;
|
|
20
|
+
/**
|
|
21
|
+
* Renders each route in routes and writes them to <outputPath>/<route>/index.html.
|
|
22
|
+
*/
|
|
23
|
+
async function render({ indexFile, deployUrl, minifyCss, outputPath, serverBundlePath, route, inlineCriticalCss, }) {
|
|
24
|
+
const result = {};
|
|
25
|
+
const browserIndexOutputPath = path.join(outputPath, indexFile);
|
|
26
|
+
const outputFolderPath = path.join(outputPath, route);
|
|
27
|
+
const outputIndexPath = path.join(outputFolderPath, 'index.html');
|
|
28
|
+
const { ɵSERVER_CONTEXT, AppServerModule, renderModule, renderApplication, default: bootstrapAppFn, } = (await Promise.resolve(`${serverBundlePath}`).then(s => tslib_1.__importStar(require(s))));
|
|
29
|
+
(0, node_assert_1.default)(ɵSERVER_CONTEXT, `ɵSERVER_CONTEXT was not exported from: ${serverBundlePath}.`);
|
|
30
|
+
const indexBaseName = fs.existsSync(path.join(outputPath, 'index.original.html'))
|
|
31
|
+
? 'index.original.html'
|
|
32
|
+
: indexFile;
|
|
33
|
+
const browserIndexInputPath = path.join(outputPath, indexBaseName);
|
|
34
|
+
const document = await fs.promises.readFile(browserIndexInputPath, 'utf8');
|
|
35
|
+
const platformProviders = [
|
|
36
|
+
{
|
|
37
|
+
provide: ɵSERVER_CONTEXT,
|
|
38
|
+
useValue: 'ssg',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
let html;
|
|
42
|
+
// Render platform server module
|
|
43
|
+
if (isBootstrapFn(bootstrapAppFn)) {
|
|
44
|
+
(0, node_assert_1.default)(renderApplication, `renderApplication was not exported from: ${serverBundlePath}.`);
|
|
45
|
+
html = await renderApplication(bootstrapAppFn, {
|
|
46
|
+
document,
|
|
47
|
+
url: route,
|
|
48
|
+
platformProviders,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
(0, node_assert_1.default)(renderModule, `renderModule was not exported from: ${serverBundlePath}.`);
|
|
53
|
+
const moduleClass = bootstrapAppFn || AppServerModule;
|
|
54
|
+
(0, node_assert_1.default)(moduleClass, `Neither an AppServerModule nor a bootstrapping function was exported from: ${serverBundlePath}.`);
|
|
55
|
+
html = await renderModule(moduleClass, {
|
|
56
|
+
document,
|
|
57
|
+
url: route,
|
|
58
|
+
extraProviders: platformProviders,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (inlineCriticalCss) {
|
|
62
|
+
const { InlineCriticalCssProcessor } = await Promise.resolve().then(() => tslib_1.__importStar(require('@angular/build/private')));
|
|
63
|
+
const inlineCriticalCssProcessor = new InlineCriticalCssProcessor({
|
|
64
|
+
deployUrl: deployUrl,
|
|
65
|
+
minify: minifyCss,
|
|
66
|
+
});
|
|
67
|
+
const { content, warnings, errors } = await inlineCriticalCssProcessor.process(html, {
|
|
68
|
+
outputPath,
|
|
69
|
+
});
|
|
70
|
+
result.errors = errors;
|
|
71
|
+
result.warnings = warnings;
|
|
72
|
+
html = content;
|
|
73
|
+
}
|
|
74
|
+
// This case happens when we are prerendering "/".
|
|
75
|
+
if (browserIndexOutputPath === outputIndexPath) {
|
|
76
|
+
const browserIndexOutputPathOriginal = path.join(outputPath, 'index.original.html');
|
|
77
|
+
fs.renameSync(browserIndexOutputPath, browserIndexOutputPathOriginal);
|
|
78
|
+
}
|
|
79
|
+
fs.mkdirSync(outputFolderPath, { recursive: true });
|
|
80
|
+
fs.writeFileSync(outputIndexPath, html);
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
function isBootstrapFn(value) {
|
|
84
|
+
// We can differentiate between a module and a bootstrap function by reading compiler-generated `ɵmod` static property:
|
|
85
|
+
return typeof value === 'function' && !('ɵmod' in value);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Initializes the worker when it is first created by loading the Zone.js package
|
|
89
|
+
* into the worker instance.
|
|
90
|
+
*
|
|
91
|
+
* @returns A promise resolving to the render function of the worker.
|
|
92
|
+
*/
|
|
93
|
+
async function initialize() {
|
|
94
|
+
// Setup Zone.js
|
|
95
|
+
if (zonePackage) {
|
|
96
|
+
await Promise.resolve(`${zonePackage}`).then(s => tslib_1.__importStar(require(s)));
|
|
97
|
+
}
|
|
98
|
+
// Return the render function for use
|
|
99
|
+
return render;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The default export will be the promise returned by the initialize function.
|
|
103
|
+
* This is awaited by piscina prior to using the Worker.
|
|
104
|
+
*/
|
|
105
|
+
exports.default = initialize();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
export interface RoutesExtractorWorkerData {
|
|
9
|
+
zonePackage: string | false;
|
|
10
|
+
indexFile: string;
|
|
11
|
+
outputPath: string;
|
|
12
|
+
serverBundlePath: string;
|
|
13
|
+
}
|
|
14
|
+
declare function extract(): Promise<string[]>;
|
|
15
|
+
/**
|
|
16
|
+
* The default export will be the promise returned by the initialize function.
|
|
17
|
+
* This is awaited by piscina prior to using the Worker.
|
|
18
|
+
*/
|
|
19
|
+
declare const _default: Promise<typeof extract>;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=routes-extractor-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-extractor-worker.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/tools/routes-extractor-worker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAgBD,iBAAe,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CA8B1C;AAiBD;;;GAGG;;AACH,wBAA4B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
const node_assert_1 = tslib_1.__importDefault(require("node:assert"));
|
|
12
|
+
const fs = tslib_1.__importStar(require("node:fs"));
|
|
13
|
+
const path = tslib_1.__importStar(require("node:path"));
|
|
14
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
15
|
+
const { zonePackage, serverBundlePath, outputPath, indexFile } = node_worker_threads_1.workerData;
|
|
16
|
+
async function extract() {
|
|
17
|
+
const { AppServerModule, ɵgetRoutesFromAngularRouterConfig: getRoutesFromAngularRouterConfig, default: bootstrapAppFn, } = (await Promise.resolve(`${serverBundlePath}`).then(s => tslib_1.__importStar(require(s))));
|
|
18
|
+
const browserIndexInputPath = path.join(outputPath, indexFile);
|
|
19
|
+
const document = await fs.promises.readFile(browserIndexInputPath, 'utf8');
|
|
20
|
+
const bootstrapAppFnOrModule = bootstrapAppFn || AppServerModule;
|
|
21
|
+
(0, node_assert_1.default)(bootstrapAppFnOrModule, `The file "${serverBundlePath}" does not have a default export for an AppServerModule or a bootstrapping function.`);
|
|
22
|
+
const routes = [];
|
|
23
|
+
const { routes: extractRoutes } = await getRoutesFromAngularRouterConfig(bootstrapAppFnOrModule, document, new URL('http://localhost'));
|
|
24
|
+
for (const { route, redirectTo } of extractRoutes) {
|
|
25
|
+
if (redirectTo === undefined && !/[:*]/.test(route)) {
|
|
26
|
+
routes.push(route);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return routes;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Initializes the worker when it is first created by loading the Zone.js package
|
|
33
|
+
* into the worker instance.
|
|
34
|
+
*
|
|
35
|
+
* @returns A promise resolving to the extract function of the worker.
|
|
36
|
+
*/
|
|
37
|
+
async function initialize() {
|
|
38
|
+
// Setup Zone.js
|
|
39
|
+
if (zonePackage) {
|
|
40
|
+
await Promise.resolve(`${zonePackage}`).then(s => tslib_1.__importStar(require(s)));
|
|
41
|
+
}
|
|
42
|
+
return extract;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The default export will be the promise returned by the initialize function.
|
|
46
|
+
* This is awaited by piscina prior to using the Worker.
|
|
47
|
+
*/
|
|
48
|
+
exports.default = initialize();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { Piscina } from 'piscina';
|
|
9
|
+
export type WorkerPoolOptions = ConstructorParameters<typeof Piscina>[0];
|
|
10
|
+
export declare class WorkerPool extends Piscina {
|
|
11
|
+
constructor(options: WorkerPoolOptions);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=worker-pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-pool.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/tools/worker-pool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzE,qBAAa,UAAW,SAAQ,OAAO;gBACzB,OAAO,EAAE,iBAAiB;CAUvC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.WorkerPool = void 0;
|
|
11
|
+
const piscina_1 = require("piscina");
|
|
12
|
+
class WorkerPool extends piscina_1.Piscina {
|
|
13
|
+
constructor(options) {
|
|
14
|
+
const piscinaOptions = {
|
|
15
|
+
minThreads: 1,
|
|
16
|
+
idleTimeout: 1000,
|
|
17
|
+
recordTiming: false,
|
|
18
|
+
...options,
|
|
19
|
+
};
|
|
20
|
+
super(piscinaOptions);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.WorkerPool = WorkerPool;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { Compiler, RspackPluginInstance } from '@rspack/core';
|
|
9
|
+
export declare class TransferSizePlugin implements RspackPluginInstance {
|
|
10
|
+
apply(compiler: Compiler): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=transfer-size-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfer-size-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/transfer-size-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAO9D,qBAAa,kBAAmB,YAAW,oBAAoB;IAC7D,KAAK,CAAC,QAAQ,EAAE,QAAQ;CA8CzB"}
|