@angular/build 22.2.0 → 22.3.0-next.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/builders.json +5 -0
- package/package.json +19 -18
- package/src/builders/karma/schema.d.ts +4 -4
- package/src/builders/karma/schema.json +2 -2
- package/src/builders/library/builder.d.ts +19 -0
- package/src/builders/library/builder.js +279 -0
- package/src/builders/library/builder.js.map +1 -0
- package/src/builders/library/index.d.ts +13 -0
- package/src/builders/library/index.js +17 -0
- package/src/builders/library/index.js.map +1 -0
- package/src/builders/library/options.d.ts +11 -0
- package/src/builders/library/options.js +116 -0
- package/src/builders/library/options.js.map +1 -0
- package/src/builders/library/pipeline/assets.d.ts +29 -0
- package/src/builders/library/pipeline/assets.js +106 -0
- package/src/builders/library/pipeline/assets.js.map +1 -0
- package/src/builders/library/pipeline/build-action.d.ts +35 -0
- package/src/builders/library/pipeline/build-action.js +169 -0
- package/src/builders/library/pipeline/build-action.js.map +1 -0
- package/src/builders/library/pipeline/bundler.d.ts +42 -0
- package/src/builders/library/pipeline/bundler.js +278 -0
- package/src/builders/library/pipeline/bundler.js.map +1 -0
- package/src/builders/library/pipeline/compilation.d.ts +39 -0
- package/src/builders/library/pipeline/compilation.js +197 -0
- package/src/builders/library/pipeline/compilation.js.map +1 -0
- package/src/builders/library/pipeline/entry-points.d.ts +34 -0
- package/src/builders/library/pipeline/entry-points.js +194 -0
- package/src/builders/library/pipeline/entry-points.js.map +1 -0
- package/src/builders/library/pipeline/package-manifests.d.ts +17 -0
- package/src/builders/library/pipeline/package-manifests.js +119 -0
- package/src/builders/library/pipeline/package-manifests.js.map +1 -0
- package/src/builders/library/pipeline/stylesheet-bundler.d.ts +19 -0
- package/src/builders/library/pipeline/stylesheet-bundler.js +39 -0
- package/src/builders/library/pipeline/stylesheet-bundler.js.map +1 -0
- package/src/builders/library/pipeline/types.d.ts +54 -0
- package/src/builders/library/pipeline/utils.d.ts +69 -0
- package/src/builders/library/pipeline/utils.js +73 -0
- package/src/builders/library/pipeline/utils.js.map +1 -0
- package/src/builders/library/schema.d.ts +149 -0
- package/src/builders/library/schema.js +26 -0
- package/src/builders/library/schema.js.map +1 -0
- package/src/builders/library/schema.json +168 -0
- package/src/builders/library/types.d.ts +125 -0
- package/src/builders/library/types.js +10 -0
- package/src/builders/library/types.js.map +1 -0
- package/src/builders/unit-test/builder.js +24 -2
- package/src/builders/unit-test/builder.js.map +1 -1
- package/src/builders/unit-test/options.d.ts +1 -0
- package/src/builders/unit-test/options.js +2 -1
- package/src/builders/unit-test/options.js.map +1 -1
- package/src/builders/unit-test/runners/api.d.ts +1 -1
- package/src/builders/unit-test/runners/karma/executor.js +1 -1
- package/src/builders/unit-test/runners/karma/executor.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/build-options.d.ts +8 -2
- package/src/builders/unit-test/runners/vitest/build-options.js +26 -45
- package/src/builders/unit-test/runners/vitest/build-options.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/executor.js +6 -1
- package/src/builders/unit-test/runners/vitest/executor.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/index.js +2 -2
- package/src/builders/unit-test/runners/vitest/index.js.map +1 -1
- package/src/builders/unit-test/schema.d.ts +10 -3
- package/src/builders/unit-test/schema.js.map +1 -1
- package/src/builders/unit-test/schema.json +10 -2
- package/src/tools/angular/compilation/angular-compilation.d.ts +2 -1
- package/src/tools/angular/compilation/angular-compilation.js.map +1 -1
- package/src/tools/angular/compilation/aot-compilation.d.ts +1 -1
- package/src/tools/angular/compilation/aot-compilation.js +20 -11
- package/src/tools/angular/compilation/aot-compilation.js.map +1 -1
- package/src/tools/angular/compilation/compiler-options.d.ts +4 -1
- package/src/tools/angular/compilation/compiler-options.js +24 -7
- package/src/tools/angular/compilation/compiler-options.js.map +1 -1
- package/src/tools/angular/compilation/jit-compilation.d.ts +1 -1
- package/src/tools/angular/compilation/jit-compilation.js +2 -2
- package/src/tools/angular/compilation/jit-compilation.js.map +1 -1
- package/src/tools/angular/compilation/parallel-compilation.d.ts +1 -1
- package/src/tools/angular/compilation/parallel-compilation.js +2 -1
- package/src/tools/angular/compilation/parallel-compilation.js.map +1 -1
- package/src/tools/angular/compilation/parallel-worker.d.ts +1 -0
- package/src/tools/angular/compilation/parallel-worker.js +2 -1
- package/src/tools/angular/compilation/parallel-worker.js.map +1 -1
- package/src/tools/angular/compilation/typescript-compilation.d.ts +1 -1
- package/src/tools/angular/compilation/typescript-compilation.js +2 -2
- package/src/tools/angular/compilation/typescript-compilation.js.map +1 -1
- package/src/tools/angular/linker/oxc-linker.js +28 -4
- package/src/tools/angular/linker/oxc-linker.js.map +1 -1
- package/src/tools/esbuild/stylesheets/stylesheet-cache-key.d.ts +1 -0
- package/src/tools/esbuild/stylesheets/stylesheet-cache-key.js +2 -0
- package/src/tools/esbuild/stylesheets/stylesheet-cache-key.js.map +1 -1
- package/src/tools/i18n/i18n-inliner-worker.js +45 -31
- package/src/tools/i18n/i18n-inliner-worker.js.map +1 -1
- package/src/tools/i18n/i18n-inliner.js +33 -7
- package/src/tools/i18n/i18n-inliner.js.map +1 -1
- package/src/tools/javascript-transformer/javascript-transformer-worker.js +3 -2
- package/src/tools/javascript-transformer/javascript-transformer-worker.js.map +1 -1
- package/src/tools/vite/middlewares/assets-middleware.js +1 -1
- package/src/tools/vite/middlewares/assets-middleware.js.map +1 -1
- package/src/tools/vite/middlewares/ssr-middleware.d.ts +2 -2
- package/src/tools/vite/middlewares/ssr-middleware.js +5 -3
- package/src/tools/vite/middlewares/ssr-middleware.js.map +1 -1
- package/src/tools/vite/plugins/setup-middlewares-plugin.js +2 -2
- package/src/tools/vite/plugins/setup-middlewares-plugin.js.map +1 -1
- package/src/utils/index-file/auto-csp.js +4 -2
- package/src/utils/index-file/auto-csp.js.map +1 -1
- package/src/utils/normalize-cache.js +7 -2
- package/src/utils/normalize-cache.js.map +1 -1
- package/src/utils/resolve-assets.d.ts +4 -0
- package/src/utils/resolve-assets.js +7 -3
- package/src/utils/resolve-assets.js.map +1 -1
- package/src/utils/version.js +1 -1
- package/src/utils/watcher.d.ts +7 -0
- package/src/utils/watcher.js +162 -15
- package/src/utils/watcher.js.map +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.collectAssetsToEmit = collectAssetsToEmit;
|
|
14
|
+
exports.checkAssetChanges = checkAssetChanges;
|
|
15
|
+
const node_fs_1 = require("node:fs");
|
|
16
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
17
|
+
const picomatch_1 = __importDefault(require("picomatch"));
|
|
18
|
+
const path_1 = require("../../../utils/path");
|
|
19
|
+
const resolve_assets_1 = require("../../../utils/resolve-assets");
|
|
20
|
+
const utils_1 = require("./utils");
|
|
21
|
+
/**
|
|
22
|
+
* Resolves and collects configured library assets to be emitted to disk,
|
|
23
|
+
* and registers their source paths with the watch set.
|
|
24
|
+
*
|
|
25
|
+
* @param assets The normalized asset patterns.
|
|
26
|
+
* @param workspaceRoot The workspace root directory path.
|
|
27
|
+
* @param allWatchedFiles Set collecting all watched file paths for watch mode.
|
|
28
|
+
* @param modifiedFiles Optional set of modified file paths for incremental copying in watch mode.
|
|
29
|
+
* @returns An array of disk file emission descriptors.
|
|
30
|
+
*/
|
|
31
|
+
async function collectAssetsToEmit(assets, workspaceRoot, allWatchedFiles, modifiedFiles) {
|
|
32
|
+
if (assets.length === 0) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
if (modifiedFiles) {
|
|
36
|
+
if (modifiedFiles.size === 0) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
const matchers = createAssetMatchers(assets, workspaceRoot);
|
|
40
|
+
const filesToEmit = [];
|
|
41
|
+
for (const file of modifiedFiles) {
|
|
42
|
+
const resolvedFile = node_path_1.default.isAbsolute(file) ? file : node_path_1.default.resolve(workspaceRoot, file);
|
|
43
|
+
const posixFile = (0, path_1.toPosixPath)(resolvedFile);
|
|
44
|
+
for (const { asset, posixInputPrefix, isMatch } of matchers) {
|
|
45
|
+
if (!posixFile.startsWith(posixInputPrefix)) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const relative = posixFile.slice(posixInputPrefix.length);
|
|
49
|
+
if (!isMatch(relative)) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if ((0, node_fs_1.statSync)(resolvedFile, { throwIfNoEntry: false })?.isFile()) {
|
|
53
|
+
filesToEmit.push((0, utils_1.createDiskOutputFile)(resolvedFile, node_path_1.default.join(asset.output, relative)));
|
|
54
|
+
allWatchedFiles.add(posixFile);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return filesToEmit;
|
|
59
|
+
}
|
|
60
|
+
const resolvedAssets = await (0, resolve_assets_1.resolveAssets)(assets, workspaceRoot);
|
|
61
|
+
const filesToEmit = [];
|
|
62
|
+
for (const { source, destination } of resolvedAssets) {
|
|
63
|
+
filesToEmit.push((0, utils_1.createDiskOutputFile)(source, destination));
|
|
64
|
+
allWatchedFiles.add((0, path_1.toPosixPath)(source));
|
|
65
|
+
}
|
|
66
|
+
return filesToEmit;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Checks whether any configured library assets were modified.
|
|
70
|
+
*
|
|
71
|
+
* @param assets The normalized asset patterns.
|
|
72
|
+
* @param workspaceRoot The workspace root directory path.
|
|
73
|
+
* @param changedFiles Set of changed file paths.
|
|
74
|
+
* @returns True if any asset file was modified.
|
|
75
|
+
*/
|
|
76
|
+
function checkAssetChanges(assets, workspaceRoot, changedFiles) {
|
|
77
|
+
if (assets.length === 0 || changedFiles.size === 0) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
const matchers = createAssetMatchers(assets, workspaceRoot);
|
|
81
|
+
for (const file of changedFiles) {
|
|
82
|
+
const resolvedFile = node_path_1.default.isAbsolute(file) ? file : node_path_1.default.resolve(workspaceRoot, file);
|
|
83
|
+
const posixFile = (0, path_1.toPosixPath)(resolvedFile);
|
|
84
|
+
for (const { posixInputPrefix, isMatch } of matchers) {
|
|
85
|
+
if (posixFile.startsWith(posixInputPrefix)) {
|
|
86
|
+
const relative = posixFile.slice(posixInputPrefix.length);
|
|
87
|
+
if (isMatch(relative)) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
function createAssetMatchers(assets, workspaceRoot) {
|
|
96
|
+
return assets.map((asset) => {
|
|
97
|
+
const absInput = node_path_1.default.resolve(workspaceRoot, asset.input);
|
|
98
|
+
const posixInput = (0, path_1.toPosixPath)(absInput).replace(/\/+$/, '');
|
|
99
|
+
const isMatch = (0, picomatch_1.default)(asset.glob, {
|
|
100
|
+
dot: true,
|
|
101
|
+
ignore: [...resolve_assets_1.DEFAULT_ASSET_IGNORE, ...(asset.ignore ?? [])],
|
|
102
|
+
});
|
|
103
|
+
return { asset, posixInputPrefix: `${posixInput}/`, isMatch };
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["assets.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAoBH,kDAmDC;AAUD,8CA0BC;AAzGD,qCAAmC;AACnC,0DAA6B;AAC7B,0DAAkC;AAClC,8CAAkD;AAClD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rD,IAAI,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBAC3C,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBAC1D,IAAI,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACtB,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,mBAAmB,CAAC,MAA0C,EAAE,aAAqB;IAC5F,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,MAAM,QAAQ,GAAG,mBAAI,CAAC,OAAO,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1D,MAAM,UAAU,GAAG,IAAA,kBAAW,EAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAA,mBAAS,EAAC,KAAK,CAAC,IAAI,EAAE;YACpC,GAAG,EAAE,IAAI;YACT,MAAM,EAAE,CAAC,GAAG,qCAAoB,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;SAC3D,CAAC,CAAC;QAEH,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,UAAU,GAAG,EAAE,OAAO,EAAE,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { BuilderContext } from '@angular-devkit/architect';
|
|
9
|
+
import type { NormalizedLibraryOptions, SingleBuildState } from '../types';
|
|
10
|
+
import type { createComponentStylesheetBundlerForLibrary } from './stylesheet-bundler';
|
|
11
|
+
/**
|
|
12
|
+
* Creates a fresh {@link SingleBuildState} instance.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createSingleBuildState(): SingleBuildState;
|
|
15
|
+
/**
|
|
16
|
+
* Context required to execute a single library build iteration.
|
|
17
|
+
*/
|
|
18
|
+
export interface BuildActionContext {
|
|
19
|
+
options: NormalizedLibraryOptions;
|
|
20
|
+
context: BuilderContext;
|
|
21
|
+
stylesheetBundler: ReturnType<typeof createComponentStylesheetBundlerForLibrary>;
|
|
22
|
+
isWatchMode: boolean;
|
|
23
|
+
allWatchedFiles: Set<string>;
|
|
24
|
+
buildState: SingleBuildState;
|
|
25
|
+
modifiedFiles?: Set<string>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Executes a single iteration of the library build pipeline, including
|
|
29
|
+
* single-program Angular compilation, parallel typechecking, 2-instance Rolldown bundling,
|
|
30
|
+
* manifest generation, and asset copying.
|
|
31
|
+
*
|
|
32
|
+
* @param actionContext The build action state and configuration.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildAction(actionContext: BuildActionContext): Promise<void>;
|
|
35
|
+
export declare function hasModifiedWatchedFile(modifiedFiles: ReadonlySet<string>, allWatchedFiles: ReadonlySet<string>, posixPackageJsonPath: string): boolean;
|
|
@@ -0,0 +1,169 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.createSingleBuildState = createSingleBuildState;
|
|
14
|
+
exports.buildAction = buildAction;
|
|
15
|
+
exports.hasModifiedWatchedFile = hasModifiedWatchedFile;
|
|
16
|
+
const promises_1 = require("node:fs/promises");
|
|
17
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
18
|
+
const utils_1 = require("../../../tools/esbuild/utils");
|
|
19
|
+
const path_1 = require("../../../utils/path");
|
|
20
|
+
const assets_1 = require("./assets");
|
|
21
|
+
const bundler_1 = require("./bundler");
|
|
22
|
+
const compilation_1 = require("./compilation");
|
|
23
|
+
const package_manifests_1 = require("./package-manifests");
|
|
24
|
+
/**
|
|
25
|
+
* Creates a fresh {@link SingleBuildState} instance.
|
|
26
|
+
*/
|
|
27
|
+
function createSingleBuildState() {
|
|
28
|
+
return {
|
|
29
|
+
previousBundleResults: new Map(),
|
|
30
|
+
pendingChangedEsmFiles: new Set(),
|
|
31
|
+
pendingChangedDtsFiles: new Set(),
|
|
32
|
+
directoryExists: new Set(),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Executes a single iteration of the library build pipeline, including
|
|
37
|
+
* single-program Angular compilation, parallel typechecking, 2-instance Rolldown bundling,
|
|
38
|
+
* manifest generation, and asset copying.
|
|
39
|
+
*
|
|
40
|
+
* @param actionContext The build action state and configuration.
|
|
41
|
+
*/
|
|
42
|
+
async function buildAction(actionContext) {
|
|
43
|
+
const { options, context, stylesheetBundler, isWatchMode, allWatchedFiles, buildState, modifiedFiles, } = actionContext;
|
|
44
|
+
const posixPackageJsonPath = (0, path_1.toPosixPath)(options.packageJsonPath);
|
|
45
|
+
const { pendingChangedEsmFiles, pendingChangedDtsFiles, directoryExists } = buildState;
|
|
46
|
+
if (!modifiedFiles || modifiedFiles.has(posixPackageJsonPath)) {
|
|
47
|
+
buildState.hasEmittedManifests = false;
|
|
48
|
+
}
|
|
49
|
+
const shouldCompileEntryPoints = !modifiedFiles ||
|
|
50
|
+
!buildState.singleProgramCache ||
|
|
51
|
+
buildState.hasCompilationError ||
|
|
52
|
+
buildState.hasEntryPointsChanges ||
|
|
53
|
+
pendingChangedEsmFiles.size > 0 ||
|
|
54
|
+
pendingChangedDtsFiles.size > 0 ||
|
|
55
|
+
hasModifiedWatchedFile(modifiedFiles, allWatchedFiles, posixPackageJsonPath);
|
|
56
|
+
const shouldGenerateManifests = !buildState.hasEmittedManifests;
|
|
57
|
+
if (shouldGenerateManifests) {
|
|
58
|
+
verifyAllowedDependencies(options);
|
|
59
|
+
}
|
|
60
|
+
const filesToEmit = [];
|
|
61
|
+
if (shouldCompileEntryPoints) {
|
|
62
|
+
buildState.hasCompilationError = true;
|
|
63
|
+
buildState.hasEntryPointsChanges = false;
|
|
64
|
+
const { esmFiles, dtsFiles, changedEsmFiles, changedDtsFiles, referencedFiles, cache, diagnosePromise, } = await (0, compilation_1.compileLibrary)(options.entryPoints.values(), options, stylesheetBundler, buildState.singleProgramCache, modifiedFiles);
|
|
65
|
+
buildState.singleProgramCache = cache;
|
|
66
|
+
for (const file of referencedFiles) {
|
|
67
|
+
allWatchedFiles.add(file);
|
|
68
|
+
}
|
|
69
|
+
for (const file of changedEsmFiles) {
|
|
70
|
+
pendingChangedEsmFiles.add(file);
|
|
71
|
+
}
|
|
72
|
+
for (const file of changedDtsFiles) {
|
|
73
|
+
pendingChangedDtsFiles.add(file);
|
|
74
|
+
}
|
|
75
|
+
const itemsToBundle = [];
|
|
76
|
+
for (const entryPoint of options.entryPoints.values()) {
|
|
77
|
+
const previousBundleResult = buildState.previousBundleResults.get(entryPoint.name);
|
|
78
|
+
const hasEsmChanges = !previousBundleResult ||
|
|
79
|
+
hasEntryPointChanges(previousBundleResult.esmModuleIds, pendingChangedEsmFiles);
|
|
80
|
+
const hasDtsChanges = !previousBundleResult ||
|
|
81
|
+
hasEntryPointChanges(previousBundleResult.dtsModuleIds, pendingChangedDtsFiles);
|
|
82
|
+
if (hasEsmChanges || hasDtsChanges) {
|
|
83
|
+
context.logger.info(`Compiling ${entryPoint.displayName}...`);
|
|
84
|
+
itemsToBundle.push({
|
|
85
|
+
entryPoint,
|
|
86
|
+
hasEsmChanges,
|
|
87
|
+
hasDtsChanges,
|
|
88
|
+
previousBundleResult,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
let bundleOutput;
|
|
93
|
+
let warnings;
|
|
94
|
+
try {
|
|
95
|
+
[bundleOutput, warnings] = await Promise.all([
|
|
96
|
+
(0, bundler_1.bundleEntryPoints)(itemsToBundle, esmFiles, dtsFiles, options),
|
|
97
|
+
diagnosePromise,
|
|
98
|
+
]);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
// Prioritize TypeScript/Angular diagnostic errors over secondary bundler failures.
|
|
102
|
+
await diagnosePromise;
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
buildState.hasCompilationError = false;
|
|
106
|
+
pendingChangedEsmFiles.clear();
|
|
107
|
+
pendingChangedDtsFiles.clear();
|
|
108
|
+
for (const warning of warnings) {
|
|
109
|
+
context.logger.warn(warning);
|
|
110
|
+
}
|
|
111
|
+
filesToEmit.push(...bundleOutput.filesToEmit);
|
|
112
|
+
for (const [name, bundleResult] of bundleOutput.bundleResults) {
|
|
113
|
+
buildState.previousBundleResults.set(name, bundleResult);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (shouldGenerateManifests) {
|
|
117
|
+
filesToEmit.push(...(0, package_manifests_1.generatePackageManifests)(options, isWatchMode));
|
|
118
|
+
}
|
|
119
|
+
filesToEmit.push(...(await (0, assets_1.collectAssetsToEmit)(options.assets, options.workspaceRoot, allWatchedFiles, buildState.hasEmittedAssets ? modifiedFiles : undefined)));
|
|
120
|
+
await (0, utils_1.emitFilesToDisk)(filesToEmit, async (file) => {
|
|
121
|
+
const fullFilePath = node_path_1.default.join(options.outputPath, file.path);
|
|
122
|
+
const fileBasePath = node_path_1.default.dirname(fullFilePath);
|
|
123
|
+
if (fileBasePath && !directoryExists.has(fileBasePath)) {
|
|
124
|
+
await (0, promises_1.mkdir)(fileBasePath, { recursive: true });
|
|
125
|
+
directoryExists.add(fileBasePath);
|
|
126
|
+
}
|
|
127
|
+
if (file.type === 'memory') {
|
|
128
|
+
await (0, promises_1.writeFile)(fullFilePath, file.contents);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
await (0, promises_1.copyFile)(file.source, fullFilePath, promises_1.constants.COPYFILE_FICLONE);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
buildState.hasEmittedManifests = true;
|
|
135
|
+
buildState.hasEmittedAssets = true;
|
|
136
|
+
}
|
|
137
|
+
function hasModifiedWatchedFile(modifiedFiles, allWatchedFiles, posixPackageJsonPath) {
|
|
138
|
+
for (const file of modifiedFiles) {
|
|
139
|
+
if (file !== posixPackageJsonPath && allWatchedFiles.has(file)) {
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
function hasEntryPointChanges(moduleIds, changedFiles) {
|
|
146
|
+
if (changedFiles.size === 0) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
for (const file of changedFiles) {
|
|
150
|
+
if (moduleIds.has(file)) {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
function verifyAllowedDependencies(options) {
|
|
157
|
+
const { packageJson, allowedNonPeerDependencies } = options;
|
|
158
|
+
const dependencies = {
|
|
159
|
+
...(packageJson.dependencies ?? {}),
|
|
160
|
+
...(packageJson.optionalDependencies ?? {}),
|
|
161
|
+
};
|
|
162
|
+
for (const dep of Object.keys(dependencies)) {
|
|
163
|
+
if (!allowedNonPeerDependencies.some((regex) => regex.test(dep))) {
|
|
164
|
+
throw new Error(`Dependency '${dep}' must be explicitly allowed using the 'allowedNonPeerDependencies' option, ` +
|
|
165
|
+
`or moved to 'peerDependencies' in 'package.json'.`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=build-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-action.js","sourceRoot":"","sources":["build-action.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAkBH,wDAOC;AAsBD,kCAiJC;AAED,wDAYC;AA3MD,+CAAyE;AACzE,0DAA6B;AAC7B,wDAA+D;AAC/D,8CAAkD;AAElD,qCAA+C;AAC/C,uCAA0E;AAC1E,+CAA+C;AAC/C,2DAA+D;AAI/D;;GAEG;AACH,SAAgB,sBAAsB;IACpC,OAAO;QACL,qBAAqB,EAAE,IAAI,GAAG,EAAE;QAChC,sBAAsB,EAAE,IAAI,GAAG,EAAE;QACjC,sBAAsB,EAAE,IAAI,GAAG,EAAE;QACjC,eAAe,EAAE,IAAI,GAAG,EAAE;KAC3B,CAAC;AACJ,CAAC;AAeD;;;;;;GAMG;AACI,KAAK,UAAU,WAAW,CAAC,aAAiC;IACjE,MAAM,EACJ,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,UAAU,EACV,aAAa,GACd,GAAG,aAAa,CAAC;IAElB,MAAM,oBAAoB,GAAG,IAAA,kBAAW,EAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAClE,MAAM,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC;IAEvF,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC9D,UAAU,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACzC,CAAC;IAED,MAAM,wBAAwB,GAC5B,CAAC,aAAa;QACd,CAAC,UAAU,CAAC,kBAAkB;QAC9B,UAAU,CAAC,mBAAmB;QAC9B,UAAU,CAAC,qBAAqB;QAChC,sBAAsB,CAAC,IAAI,GAAG,CAAC;QAC/B,sBAAsB,CAAC,IAAI,GA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@ -0,0 +1,42 @@
|
|
|
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 { BundleResult, NormalizedEntryPoint, NormalizedLibraryOptions } from '../types';
|
|
9
|
+
import { type MemoryOutputFile } from './utils';
|
|
10
|
+
/**
|
|
11
|
+
* Output of the entry point bundling process.
|
|
12
|
+
*/
|
|
13
|
+
export interface BundleEntryPointsOutput {
|
|
14
|
+
/** In-memory files produced by bundling to be written to disk. */
|
|
15
|
+
filesToEmit: MemoryOutputFile[];
|
|
16
|
+
/** Map of entry point names to their bundle results containing bundled module IDs. */
|
|
17
|
+
bundleResults: Map<string, BundleResult>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Input state for an individual entry point to be bundled.
|
|
21
|
+
*/
|
|
22
|
+
export interface BundleEntryPointInput {
|
|
23
|
+
/** The normalized entry point to bundle. */
|
|
24
|
+
entryPoint: NormalizedEntryPoint;
|
|
25
|
+
/** Whether the entry point has changed ESM files requiring rebundling. */
|
|
26
|
+
hasEsmChanges: boolean;
|
|
27
|
+
/** Whether the entry point has changed TypeScript declaration files requiring rebundling. */
|
|
28
|
+
hasDtsChanges: boolean;
|
|
29
|
+
/** The previous bundle result from a prior build iteration, if available. */
|
|
30
|
+
previousBundleResult?: BundleResult;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Bundles the compiled in-memory JavaScript and declaration files for all dirty entry points
|
|
34
|
+
* using at most 2 Rolldown instances total (1 for all .mjs bundles, 1 for all .d.ts bundles).
|
|
35
|
+
*
|
|
36
|
+
* @param items The collection of entry point inputs with change statuses.
|
|
37
|
+
* @param esmFiles Map of virtual ESM output file paths to their content.
|
|
38
|
+
* @param dtsFiles Map of virtual TypeScript declaration file paths to their content.
|
|
39
|
+
* @param options The normalized library builder options.
|
|
40
|
+
* @returns A promise resolving to the bundled output files and bundle cache results.
|
|
41
|
+
*/
|
|
42
|
+
export declare function bundleEntryPoints(items: readonly BundleEntryPointInput[], esmFiles: ReadonlyMap<string, string>, dtsFiles: ReadonlyMap<string, string>, options: NormalizedLibraryOptions): Promise<BundleEntryPointsOutput>;
|
|
@@ -0,0 +1,278 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.bundleEntryPoints = bundleEntryPoints;
|
|
14
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
15
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
16
|
+
const rolldown_1 = require("rolldown");
|
|
17
|
+
const rolldown_plugin_dts_1 = require("rolldown-plugin-dts");
|
|
18
|
+
const path_1 = require("../../../utils/path");
|
|
19
|
+
const utils_1 = require("./utils");
|
|
20
|
+
const ESM_EXTENSIONS = ['.js', '.mjs', '/index.js', '/index.mjs'];
|
|
21
|
+
const DTS_EXTENSIONS = ['.d.ts', '.d.mts', '/index.d.ts', '/index.d.mts'];
|
|
22
|
+
/**
|
|
23
|
+
* Bundles the compiled in-memory JavaScript and declaration files for all dirty entry points
|
|
24
|
+
* using at most 2 Rolldown instances total (1 for all .mjs bundles, 1 for all .d.ts bundles).
|
|
25
|
+
*
|
|
26
|
+
* @param items The collection of entry point inputs with change statuses.
|
|
27
|
+
* @param esmFiles Map of virtual ESM output file paths to their content.
|
|
28
|
+
* @param dtsFiles Map of virtual TypeScript declaration file paths to their content.
|
|
29
|
+
* @param options The normalized library builder options.
|
|
30
|
+
* @returns A promise resolving to the bundled output files and bundle cache results.
|
|
31
|
+
*/
|
|
32
|
+
async function bundleEntryPoints(items, esmFiles, dtsFiles, options) {
|
|
33
|
+
const bundleResults = new Map();
|
|
34
|
+
if (items.length === 0) {
|
|
35
|
+
return { filesToEmit: [], bundleResults };
|
|
36
|
+
}
|
|
37
|
+
const esmEntryPoints = [];
|
|
38
|
+
const dtsEntryPoints = [];
|
|
39
|
+
for (const item of items) {
|
|
40
|
+
if (item.hasEsmChanges || !item.previousBundleResult) {
|
|
41
|
+
esmEntryPoints.push(item.entryPoint);
|
|
42
|
+
}
|
|
43
|
+
if (item.hasDtsChanges || !item.previousBundleResult) {
|
|
44
|
+
dtsEntryPoints.push(item.entryPoint);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const [esmOutput, dtsOutput] = await Promise.all([
|
|
48
|
+
bundleAllEsm(esmEntryPoints, esmFiles, options),
|
|
49
|
+
bundleAllDts(dtsEntryPoints, dtsFiles, options),
|
|
50
|
+
]);
|
|
51
|
+
for (const { entryPoint, previousBundleResult } of items) {
|
|
52
|
+
const { bundleName, name } = entryPoint;
|
|
53
|
+
bundleResults.set(name, {
|
|
54
|
+
esmModuleIds: esmOutput.moduleIdsByBundle.get(bundleName) ??
|
|
55
|
+
previousBundleResult?.esmModuleIds ??
|
|
56
|
+
new Set(),
|
|
57
|
+
dtsModuleIds: dtsOutput.moduleIdsByBundle.get(bundleName) ??
|
|
58
|
+
previousBundleResult?.dtsModuleIds ??
|
|
59
|
+
new Set(),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
filesToEmit: [...esmOutput.filesToEmit, ...dtsOutput.filesToEmit],
|
|
64
|
+
bundleResults,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Generates the Rolldown input mapping object from the specified entry points.
|
|
69
|
+
*
|
|
70
|
+
* @param entryPoints The entry points to include in the bundle input map.
|
|
71
|
+
* @param dtsMode Whether the input map is for declaration files (.d.ts) rather than ESM files (.js).
|
|
72
|
+
* @returns A record mapping bundle names to virtual entry file paths.
|
|
73
|
+
*/
|
|
74
|
+
function resolveEntryInputMap(entryPoints, dtsMode) {
|
|
75
|
+
const input = {};
|
|
76
|
+
for (const { bundleName, entryFilePath } of entryPoints) {
|
|
77
|
+
const posixPath = (0, path_1.toPosixPath)(entryFilePath);
|
|
78
|
+
input[bundleName] = dtsMode
|
|
79
|
+
? posixPath.replace(/\.([cm]?ts)$/, '.d.$1')
|
|
80
|
+
: posixPath.replace(/\.([cm]?)ts$/, '.$1js');
|
|
81
|
+
}
|
|
82
|
+
return input;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Creates a Rolldown plugin that loads modules from an in-memory file map
|
|
86
|
+
* and prevents illegal cross-entry-point sibling imports.
|
|
87
|
+
*
|
|
88
|
+
* @param files Map of virtual file paths to their content.
|
|
89
|
+
* @param extensions Candidate extensions to probe when resolving extensionless module specifiers.
|
|
90
|
+
* @param includeMap Whether source map files should also be loaded from the memory map.
|
|
91
|
+
* @returns A Rolldown plugin instance.
|
|
92
|
+
*/
|
|
93
|
+
function createMemoryFileLoaderPlugin(files, extensions, includeMap) {
|
|
94
|
+
return {
|
|
95
|
+
name: 'memory-file-loader',
|
|
96
|
+
resolveId: {
|
|
97
|
+
order: 'pre',
|
|
98
|
+
handler(id, importer) {
|
|
99
|
+
if (id[0] === '\0') {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
if (!importer) {
|
|
103
|
+
return files.has(id) ? { id, external: false } : undefined;
|
|
104
|
+
}
|
|
105
|
+
if (id[0] !== '.' && !node_path_1.default.isAbsolute(id)) {
|
|
106
|
+
return { id, external: true };
|
|
107
|
+
}
|
|
108
|
+
const posixId = (0, path_1.toPosixPath)(id);
|
|
109
|
+
const importerPosix = (0, path_1.toPosixPath)(importer);
|
|
110
|
+
const resolved = posixId[0] === '.'
|
|
111
|
+
? node_path_1.default.posix.join(node_path_1.default.posix.dirname(importerPosix), posixId)
|
|
112
|
+
: posixId;
|
|
113
|
+
let resolvedCandidate;
|
|
114
|
+
if (files.has(resolved)) {
|
|
115
|
+
resolvedCandidate = resolved;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
const base = resolved.replace(/\.[cm]?js$/, '');
|
|
119
|
+
for (const ext of extensions) {
|
|
120
|
+
const candidate = base + ext;
|
|
121
|
+
if (files.has(candidate)) {
|
|
122
|
+
resolvedCandidate = candidate;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (resolvedCandidate) {
|
|
128
|
+
return { id: resolvedCandidate, external: false };
|
|
129
|
+
}
|
|
130
|
+
return undefined;
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
load(id) {
|
|
134
|
+
const code = files.get(id);
|
|
135
|
+
if (code === undefined) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
code,
|
|
140
|
+
map: includeMap ? files.get(`${id}.map`) : undefined,
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Processes Rolldown output assets and chunks, extracting emitted files and computing
|
|
147
|
+
* the transitive set of module IDs belonging to each entry point bundle.
|
|
148
|
+
*
|
|
149
|
+
* @param output The array of output chunks and assets from Rolldown.
|
|
150
|
+
* @param dir The destination output directory prefix.
|
|
151
|
+
* @returns The processed multi-bundle output.
|
|
152
|
+
*/
|
|
153
|
+
function processRolldownOutput(output, dir) {
|
|
154
|
+
const filesToEmit = [];
|
|
155
|
+
const moduleIdsByBundle = new Map();
|
|
156
|
+
const chunksByFileName = new Map();
|
|
157
|
+
const entryChunks = [];
|
|
158
|
+
for (const item of output) {
|
|
159
|
+
filesToEmit.push((0, utils_1.createMemoryOutputFile)(node_path_1.default.posix.join(dir, item.fileName), item.type === 'chunk' ? item.code : item.source));
|
|
160
|
+
if (item.type === 'chunk') {
|
|
161
|
+
chunksByFileName.set(item.fileName, item);
|
|
162
|
+
if (item.isEntry) {
|
|
163
|
+
entryChunks.push(item);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
for (const entryChunk of entryChunks) {
|
|
168
|
+
const modSet = new Set();
|
|
169
|
+
moduleIdsByBundle.set(entryChunk.name, modSet);
|
|
170
|
+
const visited = new Set();
|
|
171
|
+
const queue = [entryChunk];
|
|
172
|
+
while (queue.length) {
|
|
173
|
+
const chunk = queue.pop();
|
|
174
|
+
if (!chunk) {
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
if (visited.has(chunk)) {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
visited.add(chunk);
|
|
181
|
+
for (const modId of chunk.moduleIds) {
|
|
182
|
+
if (modId[0] !== '\0') {
|
|
183
|
+
modSet.add((0, path_1.toPosixPath)(modId));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
for (const depFile of [...chunk.imports, ...chunk.dynamicImports]) {
|
|
187
|
+
const depChunk = chunksByFileName.get(depFile);
|
|
188
|
+
if (depChunk && !visited.has(depChunk)) {
|
|
189
|
+
queue.push(depChunk);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return { filesToEmit, moduleIdsByBundle };
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Executes a Rolldown bundle build across all provided entry inputs.
|
|
198
|
+
*
|
|
199
|
+
* @param input Map of bundle names to virtual entry file paths.
|
|
200
|
+
* @param plugins Rolldown plugins to use during bundling.
|
|
201
|
+
* @param preserveSymlinks Whether to preserve symlinks during module resolution.
|
|
202
|
+
* @param extension Output file extension ('mjs' or 'd.ts').
|
|
203
|
+
* @param sourcemap Whether to emit sourcemaps.
|
|
204
|
+
* @param findEntryPoint Lookup function to resolve chunk entry point ownership.
|
|
205
|
+
* @returns A promise resolving to the multi-bundle output.
|
|
206
|
+
*/
|
|
207
|
+
async function executeMultiBundle(input, plugins, preserveSymlinks, extension, sourcemap) {
|
|
208
|
+
const isDts = extension === 'd.ts';
|
|
209
|
+
const dir = isDts ? utils_1.TYPES_OUTPUT_DIR : utils_1.FESM_OUTPUT_DIR;
|
|
210
|
+
const bundle = await (0, rolldown_1.rolldown)({
|
|
211
|
+
context: 'this',
|
|
212
|
+
input,
|
|
213
|
+
plugins,
|
|
214
|
+
treeshake: false,
|
|
215
|
+
resolve: { symlinks: !preserveSymlinks },
|
|
216
|
+
checks: { circularDependency: false },
|
|
217
|
+
experimental: {
|
|
218
|
+
attachDebugInfo: 'none',
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
try {
|
|
222
|
+
const { output } = await bundle.generate({
|
|
223
|
+
format: 'es',
|
|
224
|
+
dir,
|
|
225
|
+
entryFileNames: `[name].${extension}`,
|
|
226
|
+
chunkFileNames: `[name]-[hash].${extension}`,
|
|
227
|
+
sourcemap,
|
|
228
|
+
hoistTransitiveImports: false,
|
|
229
|
+
comments: { jsdoc: isDts, legal: true, annotation: true },
|
|
230
|
+
});
|
|
231
|
+
return processRolldownOutput(output, dir);
|
|
232
|
+
}
|
|
233
|
+
finally {
|
|
234
|
+
await bundle.close();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Bundles JavaScript ESM output files for all provided entry points.
|
|
239
|
+
*
|
|
240
|
+
* @param entryPoints The entry points to bundle.
|
|
241
|
+
* @param esmFiles Map of virtual ESM output file paths to contents.
|
|
242
|
+
* @param options The normalized library options.
|
|
243
|
+
* @returns A promise resolving to the multi-bundle output.
|
|
244
|
+
*/
|
|
245
|
+
async function bundleAllEsm(entryPoints, esmFiles, options) {
|
|
246
|
+
if (entryPoints.length === 0) {
|
|
247
|
+
return { filesToEmit: [], moduleIdsByBundle: new Map() };
|
|
248
|
+
}
|
|
249
|
+
return executeMultiBundle(resolveEntryInputMap(entryPoints, false), [createMemoryFileLoaderPlugin(esmFiles, ESM_EXTENSIONS, true)], options.preserveSymlinks, 'mjs', true);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Bundles TypeScript declaration (.d.ts) output files for all provided entry points.
|
|
253
|
+
*
|
|
254
|
+
* @param entryPoints The entry points to bundle.
|
|
255
|
+
* @param dtsFiles Map of virtual declaration output file paths to contents.
|
|
256
|
+
* @param options The normalized library options.
|
|
257
|
+
* @returns A promise resolving to the multi-bundle output.
|
|
258
|
+
*/
|
|
259
|
+
async function bundleAllDts(entryPoints, dtsFiles, options) {
|
|
260
|
+
if (entryPoints.length === 0) {
|
|
261
|
+
return { filesToEmit: [], moduleIdsByBundle: new Map() };
|
|
262
|
+
}
|
|
263
|
+
const dtsSourcemap = options.declarationMap;
|
|
264
|
+
// Filter out `rolldown-plugin-dts:resolver` because all `.d.ts` files are already emitted
|
|
265
|
+
// in-memory by the Angular/TypeScript compilation and resolved via `createMemoryFileLoaderPlugin`.
|
|
266
|
+
// The default `rolldown-plugin-dts:resolver` plugin performs filesystem resolution (`oxc-resolver`)
|
|
267
|
+
// and calls `this.load()` on on-disk `.ts` source files, which is unnecessary and causes a
|
|
268
|
+
// significant performance regression across multi-entry builds.
|
|
269
|
+
const rawDtsPlugins = (0, rolldown_plugin_dts_1.dts)({
|
|
270
|
+
dtsInput: true,
|
|
271
|
+
tsconfig: false,
|
|
272
|
+
sourcemap: dtsSourcemap,
|
|
273
|
+
});
|
|
274
|
+
const dtsPlugins = rawDtsPlugins.filter((plugin) => plugin.name !== 'rolldown-plugin-dts:resolver');
|
|
275
|
+
(0, node_assert_1.default)(dtsPlugins.length < rawDtsPlugins.length, 'Expected "rolldown-plugin-dts:resolver" plugin to be present in rolldown-plugin-dts.');
|
|
276
|
+
return executeMultiBundle(resolveEntryInputMap(entryPoints, true), [createMemoryFileLoaderPlugin(dtsFiles, DTS_EXTENSIONS, dtsSourcemap), ...dtsPlugins], options.preserveSymlinks, 'd.ts', dtsSourcemap);
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=bundler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["bundler.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAyEH,8CA8CC;AArHD,8DAAiC;AACjC,0DAA6B;AAC7B,uCAMkB;AAClB,6DAA0C;AAC1C,8CAAkD;AAElD,mCAKiB;AA8BjB,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,CAAU,CAAC;AAC3E,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,CAAU,CAAC;AAanF;;;;;;;;;GASG;AACI,KAAK,UAAU,iBAAiB,CACrC,KAAuC,EACvC,QAAqC,EACrC,QAAqC,EACrC,OAAiC;IAEjC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAwB,CAAC;IACtD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC;IAC5C,CAAC;IAED,MAAM,cAAc,GAA2B,EAAE,CAAC;IAClD,MAAM,cAAc,GAA2B,EAAE,CAAC;IAElD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YACrD,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YACrD,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IAED,MAAM,CAAC,SAAS,EAAE,S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