rolldown 1.0.0-beta.41 → 1.0.0-beta.42
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/dist/cli.mjs +16 -8
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/experimental-index.d.mts +12 -3
- package/dist/experimental-index.mjs +14 -16
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.mjs +4 -5
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/shared/{binding-DOpOtI1J.d.mts → binding-CtbNz6TD.d.mts} +26 -10
- package/dist/shared/{define-config-BZ_n3PjJ.d.mts → define-config-C9Rp3knL.d.mts} +1 -1
- package/dist/shared/{load-config-DkgIoWHl.mjs → load-config-a7bPxI7K.mjs} +4 -7
- package/dist/shared/{logger-ClMekpHZ.mjs → logger-B83ocDok.mjs} +6 -9
- package/dist/shared/{parse-ast-index-D2PcAmXE.mjs → parse-ast-index-DHblAIjN.mjs} +97 -127
- package/dist/shared/{prompt-R6XhwkxA.mjs → prompt-B4e-jZUR.mjs} +18 -20
- package/dist/shared/{src-DkvlJJsC.mjs → src-CUdyD4rb.mjs} +33 -38
- package/package.json +20 -21
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./shared/parse-ast-index-
|
|
2
|
-
import { description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, onExit, rolldown, validateCliOptions, version, watch } from "./shared/src-
|
|
1
|
+
import "./shared/parse-ast-index-DHblAIjN.mjs";
|
|
2
|
+
import { description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, onExit, rolldown, validateCliOptions, version, watch } from "./shared/src-CUdyD4rb.mjs";
|
|
3
3
|
import { arraify } from "./shared/misc-CQeo-AFx.mjs";
|
|
4
|
-
import { logger } from "./shared/logger-
|
|
5
|
-
import { loadConfig } from "./shared/load-config-
|
|
4
|
+
import { logger } from "./shared/logger-B83ocDok.mjs";
|
|
5
|
+
import { loadConfig } from "./shared/load-config-a7bPxI7K.mjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import colors from "ansis";
|
|
8
8
|
import { parseArgs } from "node:util";
|
|
@@ -91,13 +91,15 @@ function normalizeCliOptions(cliOptions, positionals) {
|
|
|
91
91
|
watch: options$1.watch ?? false
|
|
92
92
|
};
|
|
93
93
|
if (typeof options$1.config === "string") result.config = options$1.config;
|
|
94
|
+
if (options$1.environment !== void 0) result.environment = options$1.environment;
|
|
94
95
|
const keysOfInput = getInputCliKeys();
|
|
95
96
|
const keysOfOutput = getOutputCliKeys();
|
|
96
97
|
const reservedKeys = [
|
|
97
98
|
"help",
|
|
98
99
|
"version",
|
|
99
100
|
"config",
|
|
100
|
-
"watch"
|
|
101
|
+
"watch",
|
|
102
|
+
"environment"
|
|
101
103
|
];
|
|
102
104
|
for (let [key, value] of Object.entries(options$1)) {
|
|
103
105
|
const [primary] = key.split(".");
|
|
@@ -242,7 +244,7 @@ function getClearScreenFunction(options$1) {
|
|
|
242
244
|
}
|
|
243
245
|
|
|
244
246
|
//#endregion
|
|
245
|
-
//#region \0@oxc-project+runtime@0.
|
|
247
|
+
//#region \0@oxc-project+runtime@0.94.0/helpers/usingCtx.js
|
|
246
248
|
function _usingCtx() {
|
|
247
249
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) {
|
|
248
250
|
var n$1 = Error();
|
|
@@ -413,8 +415,7 @@ async function bundleInner(config, cliOptions) {
|
|
|
413
415
|
}
|
|
414
416
|
function printBundleOutputPretty(output) {
|
|
415
417
|
const outputEntries = collectOutputEntries(output.output);
|
|
416
|
-
|
|
417
|
-
printOutputEntries(outputEntries, outputLayoutSizes, "<DIR>");
|
|
418
|
+
printOutputEntries(outputEntries, collectOutputLayoutAdjustmentSizes(outputEntries), "<DIR>");
|
|
418
419
|
}
|
|
419
420
|
function collectOutputEntries(output) {
|
|
420
421
|
return output.map((chunk) => ({
|
|
@@ -556,6 +557,13 @@ function checkNodeVersion(nodeVersion) {
|
|
|
556
557
|
if (!checkNodeVersion(process$1.versions.node)) logger.warn(`You are using Node.js ${process$1.versions.node}. Rolldown requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.`);
|
|
557
558
|
async function main() {
|
|
558
559
|
const { rawArgs,...cliOptions } = parseCliArguments();
|
|
560
|
+
if (cliOptions.environment) {
|
|
561
|
+
const environment = Array.isArray(cliOptions.environment) ? cliOptions.environment : [cliOptions.environment];
|
|
562
|
+
for (const argument of environment) for (const pair of argument.split(",")) {
|
|
563
|
+
const [key, ...value] = pair.split(":");
|
|
564
|
+
process$1.env[key] = value.length === 0 ? String(true) : value.join(":");
|
|
565
|
+
}
|
|
566
|
+
}
|
|
559
567
|
if (cliOptions.config || cliOptions.config === "") {
|
|
560
568
|
await bundleWithConfig(cliOptions.config, cliOptions, rawArgs);
|
|
561
569
|
return;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { ConfigExport, defineConfig } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-CtbNz6TD.mjs";
|
|
2
|
+
import { ConfigExport, defineConfig } from "./shared/define-config-C9Rp3knL.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/load-config.d.ts
|
|
5
5
|
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
package/dist/config.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./shared/parse-ast-index-
|
|
2
|
-
import { defineConfig, version } from "./shared/src-
|
|
1
|
+
import "./shared/parse-ast-index-DHblAIjN.mjs";
|
|
2
|
+
import { defineConfig, version } from "./shared/src-CUdyD4rb.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
|
-
import { loadConfig } from "./shared/load-config-
|
|
4
|
+
import { loadConfig } from "./shared/load-config-a7bPxI7K.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/config.ts
|
|
7
7
|
const VERSION = version;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReactRefreshWrapperPluginConfig, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-
|
|
2
|
-
import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-
|
|
1
|
+
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReactRefreshWrapperPluginConfig, BindingRebuildStrategy, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-CtbNz6TD.mjs";
|
|
2
|
+
import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-C9Rp3knL.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/dev/dev-options.d.ts
|
|
5
5
|
interface DevWatchOptions {
|
|
@@ -44,6 +44,14 @@ interface DevWatchOptions {
|
|
|
44
44
|
}
|
|
45
45
|
interface DevOptions {
|
|
46
46
|
onHmrUpdates?: (updates: BindingClientHmrUpdate[], changedFiles: string[]) => void | Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Strategy for triggering rebuilds after HMR updates.
|
|
49
|
+
* - `'always'`: Always trigger a rebuild after HMR updates
|
|
50
|
+
* - `'auto'`: Trigger rebuild only if HMR updates contain full reload updates
|
|
51
|
+
* - `'never'`: Never trigger rebuild after HMR updates (default)
|
|
52
|
+
* @default 'auto'
|
|
53
|
+
*/
|
|
54
|
+
rebuildStrategy?: "always" | "auto" | "never";
|
|
47
55
|
watch?: DevWatchOptions;
|
|
48
56
|
}
|
|
49
57
|
//#endregion
|
|
@@ -59,6 +67,7 @@ declare class DevEngine {
|
|
|
59
67
|
invalidate(file: string, firstInvalidatedBy?: string): Promise<BindingClientHmrUpdate[]>;
|
|
60
68
|
registerModules(clientId: string, modules: string[]): void;
|
|
61
69
|
removeClient(clientId: string): void;
|
|
70
|
+
close(): Promise<void>;
|
|
62
71
|
}
|
|
63
72
|
//#endregion
|
|
64
73
|
//#region src/api/dev/index.d.ts
|
|
@@ -143,4 +152,4 @@ type TransformPluginConfig = Omit<BindingTransformPluginConfig, "include" | "exc
|
|
|
143
152
|
};
|
|
144
153
|
declare function transformPlugin(config?: TransformPluginConfig): BuiltinPlugin;
|
|
145
154
|
//#endregion
|
|
146
|
-
export { BindingClientHmrUpdate, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
155
|
+
export { BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BindingClientHmrUpdate, BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/parse-ast-index-
|
|
2
|
-
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./shared/src-
|
|
1
|
+
import { BindingClientHmrUpdate, BindingDevEngine, BindingRebuildStrategy, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/parse-ast-index-DHblAIjN.mjs";
|
|
2
|
+
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./shared/src-CUdyD4rb.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
|
-
import { logger } from "./shared/logger-
|
|
4
|
+
import { logger } from "./shared/logger-B83ocDok.mjs";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
6
|
|
|
7
7
|
//#region src/api/dev/dev-engine.ts
|
|
@@ -13,6 +13,7 @@ var DevEngine = class DevEngine {
|
|
|
13
13
|
const options = await createBundlerOptions(inputOptions, outputOptions, false);
|
|
14
14
|
const bindingDevOptions = {
|
|
15
15
|
onHmrUpdates: devOptions.onHmrUpdates,
|
|
16
|
+
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? BindingRebuildStrategy.Always : devOptions.rebuildStrategy === "auto" ? BindingRebuildStrategy.Auto : BindingRebuildStrategy.Never : void 0,
|
|
16
17
|
watch: devOptions.watch && {
|
|
17
18
|
skipWrite: devOptions.watch.skipWrite,
|
|
18
19
|
usePolling: devOptions.watch.usePolling,
|
|
@@ -23,8 +24,7 @@ var DevEngine = class DevEngine {
|
|
|
23
24
|
debounceTickRate: devOptions.watch.debounceTickRate
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
-
return new DevEngine(inner);
|
|
27
|
+
return new DevEngine(new BindingDevEngine(options.bundlerOptions, bindingDevOptions));
|
|
28
28
|
}
|
|
29
29
|
constructor(inner) {
|
|
30
30
|
this.#inner = inner;
|
|
@@ -55,6 +55,9 @@ var DevEngine = class DevEngine {
|
|
|
55
55
|
removeClient(clientId) {
|
|
56
56
|
this.#inner.removeClient(clientId);
|
|
57
57
|
}
|
|
58
|
+
async close() {
|
|
59
|
+
await this.#inner.close();
|
|
60
|
+
}
|
|
58
61
|
};
|
|
59
62
|
|
|
60
63
|
//#endregion
|
|
@@ -69,8 +72,7 @@ var dev = DevEngine.create;
|
|
|
69
72
|
* Calling this API will only execute the scan stage of rolldown.
|
|
70
73
|
*/
|
|
71
74
|
const scan = async (input) => {
|
|
72
|
-
const
|
|
73
|
-
const build = new RolldownBuild(inputOptions);
|
|
75
|
+
const build = new RolldownBuild(await PluginDriver.callOptionsHook(input));
|
|
74
76
|
try {
|
|
75
77
|
await build.scan();
|
|
76
78
|
} finally {
|
|
@@ -114,22 +116,19 @@ function wasmHelperPlugin(config) {
|
|
|
114
116
|
return new BuiltinPlugin("builtin:wasm-helper", config);
|
|
115
117
|
}
|
|
116
118
|
function wasmFallbackPlugin() {
|
|
117
|
-
|
|
118
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
119
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:wasm-fallback"));
|
|
119
120
|
}
|
|
120
121
|
function loadFallbackPlugin() {
|
|
121
122
|
return new BuiltinPlugin("builtin:load-fallback");
|
|
122
123
|
}
|
|
123
124
|
function jsonPlugin(config) {
|
|
124
|
-
|
|
125
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
125
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:json", config));
|
|
126
126
|
}
|
|
127
127
|
function buildImportAnalysisPlugin(config) {
|
|
128
128
|
return new BuiltinPlugin("builtin:build-import-analysis", config);
|
|
129
129
|
}
|
|
130
130
|
function viteResolvePlugin(config) {
|
|
131
|
-
|
|
132
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
131
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-resolve", config));
|
|
133
132
|
}
|
|
134
133
|
function isolatedDeclarationPlugin(config) {
|
|
135
134
|
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
@@ -148,8 +147,7 @@ function reactRefreshWrapperPlugin(config) {
|
|
|
148
147
|
config.include = normalizedStringOrRegex(config.include);
|
|
149
148
|
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
150
149
|
}
|
|
151
|
-
|
|
152
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
150
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:react-refresh-wrapper", config));
|
|
153
151
|
}
|
|
154
152
|
|
|
155
153
|
//#endregion
|
|
@@ -212,4 +210,4 @@ function transformPlugin(config) {
|
|
|
212
210
|
}
|
|
213
211
|
|
|
214
212
|
//#endregion
|
|
215
|
-
export { BindingClientHmrUpdate, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
213
|
+
export { BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { withFilter } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-CtbNz6TD.mjs";
|
|
2
|
+
import { withFilter } from "./shared/define-config-C9Rp3knL.mjs";
|
|
3
3
|
import { and, code, exclude, id, include, moduleType, not, or, queries, query } from "@rolldown/pluginutils";
|
|
4
4
|
export { and, code, exclude, id, include, moduleType, not, or, queries, query, withFilter };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PreRenderedChunk } from "./shared/binding-
|
|
2
|
-
import { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config-
|
|
1
|
+
import { PreRenderedChunk } from "./shared/binding-CtbNz6TD.mjs";
|
|
2
|
+
import { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config-C9Rp3knL.mjs";
|
|
3
3
|
export { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/parse-ast-index-
|
|
2
|
-
import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-
|
|
1
|
+
import "./shared/parse-ast-index-DHblAIjN.mjs";
|
|
2
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-CUdyD4rb.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
4
|
|
|
5
5
|
export { VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { registerPlugins } from "./shared/parse-ast-index-
|
|
2
|
-
import { PluginContextData, bindingifyPlugin } from "./shared/src-
|
|
1
|
+
import { registerPlugins } from "./shared/parse-ast-index-DHblAIjN.mjs";
|
|
2
|
+
import { PluginContextData, bindingifyPlugin } from "./shared/src-CUdyD4rb.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
|
|
@@ -7,15 +7,14 @@ import { parentPort, workerData } from "node:worker_threads";
|
|
|
7
7
|
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
8
8
|
(async () => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
10
|
+
registerPlugins(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
11
11
|
const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
|
|
12
12
|
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
13
13
|
return {
|
|
14
14
|
index: pluginInfo.index,
|
|
15
15
|
plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, []), [], () => {}, "info", false)
|
|
16
16
|
};
|
|
17
|
-
}));
|
|
18
|
-
registerPlugins(registryId, plugins);
|
|
17
|
+
})));
|
|
19
18
|
parentPort.postMessage({ type: "success" });
|
|
20
19
|
} catch (error) {
|
|
21
20
|
parentPort.postMessage({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { MaybePromise, Plugin } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-CtbNz6TD.mjs";
|
|
2
|
+
import { MaybePromise, Plugin } from "./shared/define-config-C9Rp3knL.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin-implementation.d.ts
|
|
5
5
|
type ParallelPluginImplementation = Plugin;
|
package/dist/parse-ast-index.mjs
CHANGED
|
@@ -4,6 +4,10 @@ import * as _oxc_project_types0 from "@oxc-project/types";
|
|
|
4
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
5
5
|
type VoidNullable<T = void> = T | null | undefined | void;
|
|
6
6
|
type BindingStringOrRegex = string | RegExp;
|
|
7
|
+
type BindingResult<T> = {
|
|
8
|
+
errors: BindingError[];
|
|
9
|
+
isBindingErrors: boolean;
|
|
10
|
+
} | T;
|
|
7
11
|
interface CodegenOptions {
|
|
8
12
|
/**
|
|
9
13
|
* Remove whitespace.
|
|
@@ -1150,12 +1154,12 @@ declare class BindingBundleEndEventData {
|
|
|
1150
1154
|
}
|
|
1151
1155
|
declare class BindingBundleErrorEventData {
|
|
1152
1156
|
get result(): BindingBundlerImpl;
|
|
1153
|
-
get error(): Array<
|
|
1157
|
+
get error(): Array<BindingError>;
|
|
1154
1158
|
}
|
|
1155
1159
|
declare class BindingBundlerImpl {
|
|
1156
|
-
write(): Promise<BindingOutputs
|
|
1157
|
-
generate(): Promise<BindingOutputs
|
|
1158
|
-
scan(): Promise<BindingOutputs
|
|
1160
|
+
write(): Promise<BindingResult<BindingOutputs>>;
|
|
1161
|
+
generate(): Promise<BindingResult<BindingOutputs>>;
|
|
1162
|
+
scan(): Promise<BindingResult<BindingOutputs>>;
|
|
1159
1163
|
close(): Promise<void>;
|
|
1160
1164
|
get closed(): boolean;
|
|
1161
1165
|
getWatchFiles(): Promise<Array<string>>;
|
|
@@ -1191,7 +1195,6 @@ declare class BindingOutputChunk {
|
|
|
1191
1195
|
declare class BindingOutputs {
|
|
1192
1196
|
get chunks(): Array<BindingOutputChunk>;
|
|
1193
1197
|
get assets(): Array<BindingOutputAsset>;
|
|
1194
|
-
get errors(): Array<Error | BindingError>;
|
|
1195
1198
|
}
|
|
1196
1199
|
declare class BindingRenderedChunk {
|
|
1197
1200
|
get name(): string;
|
|
@@ -1248,10 +1251,13 @@ interface BindingDynamicImportVarsPluginConfig {
|
|
|
1248
1251
|
exclude?: Array<BindingStringOrRegex>;
|
|
1249
1252
|
resolver?: (id: string, importer: string) => MaybePromise<string | undefined>;
|
|
1250
1253
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
}
|
|
1254
|
+
type BindingError = {
|
|
1255
|
+
type: 'JsError';
|
|
1256
|
+
field0: Error;
|
|
1257
|
+
} | {
|
|
1258
|
+
type: 'NativeError';
|
|
1259
|
+
field0: NativeError;
|
|
1260
|
+
};
|
|
1255
1261
|
interface BindingEsmExternalRequirePluginConfig {
|
|
1256
1262
|
external: Array<BindingStringOrRegex>;
|
|
1257
1263
|
skipDuplicateCheck?: boolean;
|
|
@@ -1320,6 +1326,11 @@ interface BindingReactRefreshWrapperPluginConfig {
|
|
|
1320
1326
|
jsxImportSource: string;
|
|
1321
1327
|
reactRefreshHost: string;
|
|
1322
1328
|
}
|
|
1329
|
+
declare enum BindingRebuildStrategy {
|
|
1330
|
+
Always = 0,
|
|
1331
|
+
Auto = 1,
|
|
1332
|
+
Never = 2,
|
|
1333
|
+
}
|
|
1323
1334
|
interface BindingRenderBuiltUrlConfig {
|
|
1324
1335
|
ssr: boolean;
|
|
1325
1336
|
type: 'asset' | 'public';
|
|
@@ -1392,6 +1403,11 @@ interface BindingViteResolvePluginResolveOptions {
|
|
|
1392
1403
|
interface BindingWasmHelperPluginConfig {
|
|
1393
1404
|
decodedBase: string;
|
|
1394
1405
|
}
|
|
1406
|
+
/** Error emitted from native side, it only contains kind and message, no stack trace. */
|
|
1407
|
+
interface NativeError {
|
|
1408
|
+
kind: string;
|
|
1409
|
+
message: string;
|
|
1410
|
+
}
|
|
1395
1411
|
interface PreRenderedChunk {
|
|
1396
1412
|
name: string;
|
|
1397
1413
|
isEntry: boolean;
|
|
@@ -1401,4 +1417,4 @@ interface PreRenderedChunk {
|
|
|
1401
1417
|
exports: Array<string>;
|
|
1402
1418
|
}
|
|
1403
1419
|
//#endregion
|
|
1404
|
-
export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReactRefreshWrapperPluginConfig, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, MinifyOptions, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
|
|
1420
|
+
export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReactRefreshWrapperPluginConfig, BindingRebuildStrategy, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, MinifyOptions, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-
|
|
1
|
+
import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-CtbNz6TD.mjs";
|
|
2
2
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
3
3
|
import { Program } from "@oxc-project/types";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rolldown } from "./src-
|
|
1
|
+
import { rolldown } from "./src-CUdyD4rb.mjs";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { readdir } from "node:fs/promises";
|
|
@@ -66,8 +66,7 @@ async function findConfigFileNameInCwd() {
|
|
|
66
66
|
throw new Error("No `rolldown.config` configuration file found.");
|
|
67
67
|
}
|
|
68
68
|
async function loadTsConfig(configFile) {
|
|
69
|
-
const
|
|
70
|
-
const file = await bundleTsConfig(configFile, isEsm);
|
|
69
|
+
const file = await bundleTsConfig(configFile, isFilePathESM(configFile));
|
|
71
70
|
try {
|
|
72
71
|
return (await import(pathToFileURL(file).href)).default;
|
|
73
72
|
} finally {
|
|
@@ -104,10 +103,8 @@ async function loadConfig(configPath) {
|
|
|
104
103
|
const ext = path.extname(configPath = configPath || await findConfigFileNameInCwd());
|
|
105
104
|
try {
|
|
106
105
|
if (SUPPORTED_JS_CONFIG_FORMATS.includes(ext) || process.env.NODE_OPTIONS?.includes("--import=tsx") && SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return (await import(pathToFileURL(configPath).href)).default;
|
|
107
|
-
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext))
|
|
108
|
-
|
|
109
|
-
return await loadTsConfig(rawConfigPath);
|
|
110
|
-
} else throw new Error(`Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${ext}\``);
|
|
106
|
+
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return await loadTsConfig(path.resolve(configPath));
|
|
107
|
+
else throw new Error(`Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${ext}\``);
|
|
111
108
|
} catch (err) {
|
|
112
109
|
throw new Error("Error happened while loading config.", { cause: err });
|
|
113
110
|
}
|
|
@@ -416,11 +416,10 @@ ${indent}`);
|
|
|
416
416
|
return causedPrefix + message + "\n" + stack + causedError;
|
|
417
417
|
}
|
|
418
418
|
formatArgs(args, opts) {
|
|
419
|
-
|
|
419
|
+
return formatWithOptions(opts, ...args.map((arg) => {
|
|
420
420
|
if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
|
|
421
421
|
return arg;
|
|
422
|
-
});
|
|
423
|
-
return formatWithOptions(opts, ..._args);
|
|
422
|
+
}));
|
|
424
423
|
}
|
|
425
424
|
formatDate(date, opts) {
|
|
426
425
|
return opts.date ? date.toLocaleTimeString() : "";
|
|
@@ -442,11 +441,10 @@ ${indent}`);
|
|
|
442
441
|
]);
|
|
443
442
|
}
|
|
444
443
|
log(logObj, ctx) {
|
|
445
|
-
|
|
444
|
+
return writeStream(this.formatLogObj(logObj, {
|
|
446
445
|
columns: ctx.options.stdout.columns || 0,
|
|
447
446
|
...ctx.options.formatOptions
|
|
448
|
-
});
|
|
449
|
-
return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
447
|
+
}) + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
|
|
450
448
|
}
|
|
451
449
|
};
|
|
452
450
|
|
|
@@ -646,8 +644,7 @@ const r = Object.create(null), i = (e) => globalThis.process?.env || import.meta
|
|
|
646
644
|
return i()[s$1] ?? r[s$1];
|
|
647
645
|
},
|
|
648
646
|
has(e, s$1) {
|
|
649
|
-
|
|
650
|
-
return s$1 in E || s$1 in r;
|
|
647
|
+
return s$1 in i() || s$1 in r;
|
|
651
648
|
},
|
|
652
649
|
set(e, s$1, E) {
|
|
653
650
|
const B = i(true);
|
|
@@ -944,7 +941,7 @@ function createConsola(options = {}) {
|
|
|
944
941
|
defaults: { level },
|
|
945
942
|
stdout: process.stdout,
|
|
946
943
|
stderr: process.stderr,
|
|
947
|
-
prompt: (...args) => import("./prompt-
|
|
944
|
+
prompt: (...args) => import("./prompt-B4e-jZUR.mjs").then((m) => m.prompt(...args)),
|
|
948
945
|
reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
949
946
|
...options
|
|
950
947
|
});
|