rolldown 1.0.0-beta.35 → 1.0.0-beta.37
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 +95 -1068
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/experimental-index.d.mts +43 -5
- package/dist/experimental-index.mjs +31 -8
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.mjs +3 -4
- 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-9k0egz6L.d.mts → binding-Cjs27cfu.d.mts} +1 -0
- package/dist/shared/{define-config-DhrkZ_o7.d.cts → define-config-CV3aiNwN.d.mts} +9 -9
- package/dist/shared/{load-config-C93_L4MP.mjs → load-config-BOVuTpJm.mjs} +4 -6
- package/dist/{cli.cjs → shared/logger-CiCY7ucm.mjs} +44 -829
- package/dist/shared/parse-ast-index-B5HcAOhq.mjs +10847 -0
- package/dist/shared/{prompt-C5jz26Zn.mjs → prompt-D2FxOcB5.mjs} +4 -7
- package/dist/shared/{src-D954P1TH.mjs → src-BtNlw_84.mjs} +88 -69
- package/package.json +32 -46
- package/dist/cli.d.cts +0 -1
- package/dist/config.cjs +0 -12
- package/dist/config.d.cts +0 -10
- package/dist/experimental-index.cjs +0 -154
- package/dist/experimental-index.d.cts +0 -99
- package/dist/filter-index.cjs +0 -106
- package/dist/filter-index.d.cts +0 -4
- package/dist/index.cjs +0 -9
- package/dist/index.d.cts +0 -3
- package/dist/parallel-plugin-worker.cjs +0 -33
- package/dist/parallel-plugin-worker.d.cts +0 -1
- package/dist/parallel-plugin.cjs +0 -8
- package/dist/parallel-plugin.d.cts +0 -14
- package/dist/parse-ast-index.cjs +0 -4
- package/dist/parse-ast-index.d.cts +0 -8
- package/dist/shared/binding-D13M6Llu.d.cts +0 -1425
- package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
- package/dist/shared/define-config-3arq8OPE.d.mts +0 -1421
- package/dist/shared/load-config-S_ofSLrj.cjs +0 -130
- package/dist/shared/misc-DksvspN4.cjs +0 -58
- package/dist/shared/parse-ast-index-BadydpMA.mjs +0 -725
- package/dist/shared/parse-ast-index-cePJvlvW.cjs +0 -871
- package/dist/shared/prompt-Q05EYrFb.cjs +0 -858
- package/dist/shared/src-BBMxhaqf.cjs +0 -4673
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-Cjs27cfu.mjs";
|
|
2
|
+
import { ConfigExport, defineConfig } from "./shared/define-config-CV3aiNwN.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-B5HcAOhq.mjs";
|
|
2
|
+
import { defineConfig, version } from "./shared/src-BtNlw_84.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
|
-
import { loadConfig } from "./shared/load-config-
|
|
4
|
+
import { loadConfig } from "./shared/load-config-BOVuTpJm.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/config.ts
|
|
7
7
|
const VERSION = version;
|
|
@@ -1,11 +1,45 @@
|
|
|
1
|
-
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHmrUpdate, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, 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, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHmrUpdate, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-Cjs27cfu.mjs";
|
|
2
|
+
import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-CV3aiNwN.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/dev/dev-options.d.ts
|
|
5
|
-
interface
|
|
6
|
-
|
|
5
|
+
interface DevWatchOptions {
|
|
6
|
+
/**
|
|
7
|
+
* If `true`, use polling instead of native file system events for watching.
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
7
10
|
usePolling?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Poll interval in milliseconds (only used when usePolling is true).
|
|
13
|
+
* @default 100
|
|
14
|
+
*/
|
|
8
15
|
pollInterval?: number;
|
|
16
|
+
/**
|
|
17
|
+
* If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
useDebounce?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Debounce duration in milliseconds (only used when useDebounce is true).
|
|
23
|
+
* @default 10
|
|
24
|
+
*/
|
|
25
|
+
debounceDuration?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to compare file contents for poll-based watchers (only used when usePolling is true).
|
|
28
|
+
* When enabled, poll watchers will check file contents to determine if they actually changed.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
compareContentsForPolling?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
|
|
34
|
+
* Controls how frequently the debouncer checks for events to process.
|
|
35
|
+
* When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
|
|
36
|
+
* @default undefined (auto-select)
|
|
37
|
+
*/
|
|
38
|
+
debounceTickRate?: number;
|
|
39
|
+
}
|
|
40
|
+
interface DevOptions {
|
|
41
|
+
onHmrUpdates?: (updates: BindingHmrUpdate[], changedFiles: string[]) => void | Promise<void>;
|
|
42
|
+
watch?: DevWatchOptions;
|
|
9
43
|
}
|
|
10
44
|
//#endregion
|
|
11
45
|
//#region src/api/dev/dev-engine.d.ts
|
|
@@ -16,6 +50,10 @@ declare class DevEngine {
|
|
|
16
50
|
run(): Promise<void>;
|
|
17
51
|
ensureCurrentBuildFinish(): Promise<void>;
|
|
18
52
|
ensureLatestBuild(): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Returns true if a new build is scheduled.
|
|
55
|
+
*/
|
|
56
|
+
scheduleBuildIfStale(): Promise<"scheduled" | "alreadyScheduled" | undefined>;
|
|
19
57
|
invalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrUpdate>;
|
|
20
58
|
}
|
|
21
59
|
//#endregion
|
|
@@ -96,4 +134,4 @@ type TransformPluginConfig = Omit<BindingTransformPluginConfig, "include" | "exc
|
|
|
96
134
|
};
|
|
97
135
|
declare function transformPlugin(config?: TransformPluginConfig): BuiltinPlugin;
|
|
98
136
|
//#endregion
|
|
99
|
-
export { DevEngine, type DevOptions, 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, replacePlugin, reporterPlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
137
|
+
export { 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, replacePlugin, reporterPlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { BindingBundler, BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/parse-ast-index-
|
|
2
|
-
import { PluginDriver, assetPlugin, buildImportAnalysisPlugin,
|
|
1
|
+
import { BindingBundler, BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/parse-ast-index-B5HcAOhq.mjs";
|
|
2
|
+
import { BuiltinPlugin, PluginDriver, assetPlugin, buildImportAnalysisPlugin, createBundlerImpl, createBundlerOptions, dynamicImportVarsPlugin, esmExternalRequirePlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/src-BtNlw_84.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
|
+
import { logger } from "./shared/logger-CiCY7ucm.mjs";
|
|
4
5
|
import { pathToFileURL } from "node:url";
|
|
5
6
|
|
|
6
7
|
//#region src/api/dev/dev-engine.ts
|
|
@@ -12,8 +13,14 @@ var DevEngine = class DevEngine {
|
|
|
12
13
|
const options = await createBundlerOptions(inputOptions, outputOptions, false);
|
|
13
14
|
const bindingDevOptions = {
|
|
14
15
|
onHmrUpdates: devOptions.onHmrUpdates,
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
watch: devOptions.watch && {
|
|
17
|
+
usePolling: devOptions.watch.usePolling,
|
|
18
|
+
pollInterval: devOptions.watch.pollInterval,
|
|
19
|
+
useDebounce: devOptions.watch.useDebounce,
|
|
20
|
+
debounceDuration: devOptions.watch.debounceDuration,
|
|
21
|
+
compareContentsForPolling: devOptions.watch.compareContentsForPolling,
|
|
22
|
+
debounceTickRate: devOptions.watch.debounceTickRate
|
|
23
|
+
}
|
|
17
24
|
};
|
|
18
25
|
const inner = new BindingDevEngine(options.bundlerOptions, bindingDevOptions);
|
|
19
26
|
return new DevEngine(inner);
|
|
@@ -35,6 +42,16 @@ var DevEngine = class DevEngine {
|
|
|
35
42
|
async ensureLatestBuild() {
|
|
36
43
|
await this.#inner.ensureLatestBuild();
|
|
37
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns true if a new build is scheduled.
|
|
47
|
+
*/
|
|
48
|
+
async scheduleBuildIfStale() {
|
|
49
|
+
const scheduled = await this.#inner.scheduleBuildIfStale();
|
|
50
|
+
if (scheduled) {
|
|
51
|
+
scheduled.wait().catch(() => {});
|
|
52
|
+
return scheduled.alreadyScheduled() ? "alreadyScheduled" : "scheduled";
|
|
53
|
+
}
|
|
54
|
+
}
|
|
38
55
|
async invalidate(file, firstInvalidatedBy) {
|
|
39
56
|
return this.#inner.invalidate(file, firstInvalidatedBy);
|
|
40
57
|
}
|
|
@@ -73,7 +90,7 @@ function defineParallelPlugin(pluginPath) {
|
|
|
73
90
|
//#endregion
|
|
74
91
|
//#region src/builtin-plugin/alias-plugin.ts
|
|
75
92
|
function aliasPlugin(config) {
|
|
76
|
-
return
|
|
93
|
+
return new BuiltinPlugin("builtin:alias", config);
|
|
77
94
|
}
|
|
78
95
|
|
|
79
96
|
//#endregion
|
|
@@ -101,10 +118,16 @@ function aliasPlugin(config) {
|
|
|
101
118
|
* ```
|
|
102
119
|
*/
|
|
103
120
|
function replacePlugin(values = {}, options = {}) {
|
|
121
|
+
let hasNonStringValues = false;
|
|
104
122
|
Object.keys(values).forEach((key) => {
|
|
105
|
-
|
|
123
|
+
const value = values[key];
|
|
124
|
+
if (typeof value !== "string") {
|
|
125
|
+
hasNonStringValues = true;
|
|
126
|
+
values[key] = String(value);
|
|
127
|
+
}
|
|
106
128
|
});
|
|
107
|
-
|
|
129
|
+
if (hasNonStringValues) logger.warn("Some values provided to `replacePlugin` are not strings. They will be converted to strings, but for better performance consider converting them manually.");
|
|
130
|
+
return new BuiltinPlugin("builtin:replace", {
|
|
108
131
|
...options,
|
|
109
132
|
values
|
|
110
133
|
});
|
|
@@ -120,7 +143,7 @@ function transformPlugin(config) {
|
|
|
120
143
|
jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
|
|
121
144
|
jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude)
|
|
122
145
|
};
|
|
123
|
-
return
|
|
146
|
+
return new BuiltinPlugin("builtin:transform", config);
|
|
124
147
|
}
|
|
125
148
|
|
|
126
149
|
//#endregion
|
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-Cjs27cfu.mjs";
|
|
2
|
+
import { withFilter } from "./shared/define-config-CV3aiNwN.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, 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, 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-
|
|
3
|
-
export { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, 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, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
|
1
|
+
import { PreRenderedChunk } from "./shared/binding-Cjs27cfu.mjs";
|
|
2
|
+
import { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, 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-CV3aiNwN.mjs";
|
|
3
|
+
export { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, 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-B5HcAOhq.mjs";
|
|
2
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-BtNlw_84.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-B5HcAOhq.mjs";
|
|
2
|
+
import { PluginContextData, bindingifyPlugin } from "./shared/src-BtNlw_84.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
|
|
@@ -8,8 +8,7 @@ const { registryId, pluginInfos, threadNumber } = workerData;
|
|
|
8
8
|
(async () => {
|
|
9
9
|
try {
|
|
10
10
|
const plugins = await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
11
|
-
const
|
|
12
|
-
const definePluginImpl = pluginModule.default;
|
|
11
|
+
const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
|
|
13
12
|
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
14
13
|
return {
|
|
15
14
|
index: pluginInfo.index,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { MaybePromise, Plugin } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-Cjs27cfu.mjs";
|
|
2
|
+
import { MaybePromise, Plugin } from "./shared/define-config-CV3aiNwN.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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-
|
|
2
|
-
import { Program } from "@oxc-project/types";
|
|
1
|
+
import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-Cjs27cfu.mjs";
|
|
3
2
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
3
|
+
import { Program } from "@oxc-project/types";
|
|
4
4
|
|
|
5
5
|
//#region src/log/logging.d.ts
|
|
6
6
|
type LogLevel = "info" | "debug" | "warn";
|
|
@@ -150,7 +150,7 @@ interface PreRenderedAsset {
|
|
|
150
150
|
}
|
|
151
151
|
type AssetFileNamesFunction = (chunkInfo: PreRenderedAsset) => string;
|
|
152
152
|
type GlobalsFunction = (name: string) => string;
|
|
153
|
-
type MinifyOptions = Omit<MinifyOptions$1, "module" | "
|
|
153
|
+
type MinifyOptions = Omit<MinifyOptions$1, "module" | "sourcemap">;
|
|
154
154
|
interface ChunkingContext {
|
|
155
155
|
getModuleInfo(moduleId: string): ModuleInfo | null;
|
|
156
156
|
}
|
|
@@ -802,6 +802,9 @@ interface OutputBundle {
|
|
|
802
802
|
[fileName: string]: OutputAsset | OutputChunk;
|
|
803
803
|
}
|
|
804
804
|
//#endregion
|
|
805
|
+
//#region src/types/rolldown-options-function.d.ts
|
|
806
|
+
type RolldownOptionsFunction = (commandLineArguments: Record<string, any>) => MaybePromise<RolldownOptions | RolldownOptions[]>;
|
|
807
|
+
//#endregion
|
|
805
808
|
//#region src/types/sourcemap.d.ts
|
|
806
809
|
interface ExistingRawSourceMap {
|
|
807
810
|
file?: string | null;
|
|
@@ -819,15 +822,11 @@ type SourceMapInput = ExistingRawSourceMap | string | null;
|
|
|
819
822
|
declare const VERSION: string;
|
|
820
823
|
//#endregion
|
|
821
824
|
//#region src/builtin-plugin/utils.d.ts
|
|
822
|
-
declare const BuiltinClassSymbol: symbol;
|
|
823
825
|
declare class BuiltinPlugin {
|
|
824
826
|
name: BindingBuiltinPluginName;
|
|
825
827
|
_options?: unknown;
|
|
826
828
|
constructor(name: BindingBuiltinPluginName, _options?: unknown);
|
|
827
829
|
}
|
|
828
|
-
interface BuiltinPlugin {
|
|
829
|
-
[BuiltinClassSymbol]: boolean;
|
|
830
|
-
}
|
|
831
830
|
//#endregion
|
|
832
831
|
//#region src/constants/plugin.d.ts
|
|
833
832
|
declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
|
|
@@ -1411,11 +1410,12 @@ interface RolldownOptions extends InputOptions {
|
|
|
1411
1410
|
/**
|
|
1412
1411
|
* Type for `default export` of `rolldown.config.js` file.
|
|
1413
1412
|
*/
|
|
1414
|
-
type ConfigExport = RolldownOptions | RolldownOptions[];
|
|
1413
|
+
type ConfigExport = RolldownOptions | RolldownOptions[] | RolldownOptionsFunction;
|
|
1415
1414
|
//#endregion
|
|
1416
1415
|
//#region src/utils/define-config.d.ts
|
|
1417
1416
|
declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
1418
1417
|
declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
1418
|
+
declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
|
|
1419
1419
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
1420
1420
|
//#endregion
|
|
1421
|
-
export { type AddonFunction, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, BuiltinPlugin, type ChunkFileNamesFunction, type ChunkingContext, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedFile, type ExistingRawSourceMap, type ExternalOption, type FunctionPluginHooks, type GeneralHookFilter, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, MaybePromise, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PreRenderedAsset, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownFileStats, type RolldownFsModule, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RollupError, type RollupLog, type RollupLogWithString, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, StringOrRegExp, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherOptions, build, defineConfig, defineParallelPlugin, rolldown, watch, withFilter };
|
|
1421
|
+
export { type AddonFunction, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, BuiltinPlugin, type ChunkFileNamesFunction, type ChunkingContext, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedFile, type ExistingRawSourceMap, type ExternalOption, type FunctionPluginHooks, type GeneralHookFilter, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, MaybePromise, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PreRenderedAsset, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownFileStats, type RolldownFsModule, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RollupError, type RollupLog, type RollupLogWithString, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, StringOrRegExp, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherOptions, build, defineConfig, defineParallelPlugin, rolldown, watch, withFilter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rolldown } from "./src-
|
|
1
|
+
import { rolldown } from "./src-BtNlw_84.mjs";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
@@ -28,9 +28,8 @@ async function bundleTsConfig(configFile, isEsm) {
|
|
|
28
28
|
transform: {
|
|
29
29
|
filter: { id: /\.[cm]?[jt]s$/ },
|
|
30
30
|
async handler(code, id) {
|
|
31
|
-
const injectValues = `const ${dirnameVarName} = ${JSON.stringify(path.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify(pathToFileURL(id).href)};`;
|
|
32
31
|
return {
|
|
33
|
-
code:
|
|
32
|
+
code: `const ${dirnameVarName} = ${JSON.stringify(path.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify(pathToFileURL(id).href)};` + code,
|
|
34
33
|
map: null
|
|
35
34
|
};
|
|
36
35
|
}
|
|
@@ -38,13 +37,12 @@ async function bundleTsConfig(configFile, isEsm) {
|
|
|
38
37
|
}]
|
|
39
38
|
});
|
|
40
39
|
const outputDir = path.dirname(configFile);
|
|
41
|
-
const
|
|
40
|
+
const fileName = (await bundle.write({
|
|
42
41
|
dir: outputDir,
|
|
43
42
|
format: isEsm ? "esm" : "cjs",
|
|
44
43
|
sourcemap: "inline",
|
|
45
44
|
entryFileNames: `rolldown.config.[hash]${path.extname(configFile).replace("ts", "js")}`
|
|
46
|
-
});
|
|
47
|
-
const fileName = result.output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
|
45
|
+
})).output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
|
48
46
|
return path.join(outputDir, fileName);
|
|
49
47
|
}
|
|
50
48
|
const SUPPORTED_JS_CONFIG_FORMATS = [
|