@rolldown/browser 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.
Files changed (51) hide show
  1. package/dist/cli.mjs +96 -1069
  2. package/dist/config.d.mts +2 -2
  3. package/dist/config.mjs +4 -4
  4. package/dist/experimental-index.browser.mjs +493 -7
  5. package/dist/experimental-index.d.mts +43 -5
  6. package/dist/experimental-index.mjs +32 -9
  7. package/dist/filter-index.d.mts +2 -2
  8. package/dist/filter-index.mjs +1 -1
  9. package/dist/index.browser.mjs +1 -1
  10. package/dist/index.d.mts +3 -3
  11. package/dist/index.mjs +3 -3
  12. package/dist/parallel-plugin-worker.mjs +4 -5
  13. package/dist/parallel-plugin.d.mts +2 -2
  14. package/dist/parse-ast-index.d.mts +1 -1
  15. package/dist/parse-ast-index.mjs +1 -1
  16. package/dist/rolldown-binding.wasi-browser.js +1 -0
  17. package/dist/rolldown-binding.wasi.cjs +1 -0
  18. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  19. package/dist/shared/{binding-9k0egz6L.d.mts → binding-Cjs27cfu.d.mts} +1 -0
  20. package/dist/shared/{define-config-DhrkZ_o7.d.cts → define-config-DzsPS4fI.d.mts} +8 -8
  21. package/dist/shared/{dist-ByKQkexh.mjs → dist-CHTC3-kR.mjs} +1 -1
  22. package/dist/shared/{load-config-BCjD-AGJ.mjs → load-config-efyGD8HY.mjs} +4 -6
  23. package/dist/{cli.cjs → shared/logger-CiCY7ucm.mjs} +34 -817
  24. package/dist/shared/{parse-ast-index-C_CZT4St.mjs → parse-ast-index-C3TkGcEQ.mjs} +1 -1
  25. package/dist/shared/{prompt-C5jz26Zn.mjs → prompt-D2FxOcB5.mjs} +4 -7
  26. package/dist/shared/{src-B0RCtUy7.mjs → src-kVjGhYdF.mjs} +89 -70
  27. package/dist/{src-C8U06Im1.js → src-C2GHZXDs.js} +88 -70
  28. package/package.json +10 -24
  29. package/dist/cli.d.cts +0 -1
  30. package/dist/config.cjs +0 -12
  31. package/dist/config.d.cts +0 -10
  32. package/dist/experimental-index.cjs +0 -176
  33. package/dist/experimental-index.d.cts +0 -99
  34. package/dist/filter-index.cjs +0 -53
  35. package/dist/filter-index.d.cts +0 -4
  36. package/dist/index.cjs +0 -9
  37. package/dist/index.d.cts +0 -3
  38. package/dist/parallel-plugin-worker.cjs +0 -35
  39. package/dist/parallel-plugin-worker.d.cts +0 -1
  40. package/dist/parallel-plugin.cjs +0 -8
  41. package/dist/parallel-plugin.d.cts +0 -14
  42. package/dist/parse-ast-index.cjs +0 -4
  43. package/dist/parse-ast-index.d.cts +0 -8
  44. package/dist/shared/binding-D13M6Llu.d.cts +0 -1425
  45. package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
  46. package/dist/shared/define-config-DJXaSinS.d.mts +0 -1421
  47. package/dist/shared/dist-CK0hotcm.cjs +0 -240
  48. package/dist/shared/load-config-BJKhRKZL.cjs +0 -130
  49. package/dist/shared/parse-ast-index-J0xVKZRe.cjs +0 -327
  50. package/dist/shared/prompt-Q05EYrFb.cjs +0 -858
  51. package/dist/shared/src-Bd4BGX4v.cjs +0 -4788
@@ -1,6 +1,7 @@
1
- import { PluginDriver, assetPlugin, buildImportAnalysisPlugin, createBuiltinPlugin, createBundlerImpl, createBundlerOptions, dynamicImportVarsPlugin, esmExternalRequirePlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/src-B0RCtUy7.mjs";
2
- import "./shared/parse-ast-index-C_CZT4St.mjs";
3
- import "./shared/dist-ByKQkexh.mjs";
1
+ 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-kVjGhYdF.mjs";
2
+ import "./shared/parse-ast-index-C3TkGcEQ.mjs";
3
+ import "./shared/dist-CHTC3-kR.mjs";
4
+ import { logger } from "./shared/logger-CiCY7ucm.mjs";
4
5
  import { BindingBundler, BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
5
6
  import { pathToFileURL } from "node:url";
6
7
 
@@ -13,8 +14,14 @@ var DevEngine = class DevEngine {
13
14
  const options = await createBundlerOptions(inputOptions, outputOptions, false);
14
15
  const bindingDevOptions = {
15
16
  onHmrUpdates: devOptions.onHmrUpdates,
16
- usePolling: devOptions.usePolling,
17
- pollInterval: devOptions.pollInterval
17
+ watch: devOptions.watch && {
18
+ usePolling: devOptions.watch.usePolling,
19
+ pollInterval: devOptions.watch.pollInterval,
20
+ useDebounce: devOptions.watch.useDebounce,
21
+ debounceDuration: devOptions.watch.debounceDuration,
22
+ compareContentsForPolling: devOptions.watch.compareContentsForPolling,
23
+ debounceTickRate: devOptions.watch.debounceTickRate
24
+ }
18
25
  };
19
26
  const inner = new BindingDevEngine(options.bundlerOptions, bindingDevOptions);
20
27
  return new DevEngine(inner);
@@ -36,6 +43,16 @@ var DevEngine = class DevEngine {
36
43
  async ensureLatestBuild() {
37
44
  await this.#inner.ensureLatestBuild();
38
45
  }
46
+ /**
47
+ * Returns true if a new build is scheduled.
48
+ */
49
+ async scheduleBuildIfStale() {
50
+ const scheduled = await this.#inner.scheduleBuildIfStale();
51
+ if (scheduled) {
52
+ scheduled.wait().catch(() => {});
53
+ return scheduled.alreadyScheduled() ? "alreadyScheduled" : "scheduled";
54
+ }
55
+ }
39
56
  async invalidate(file, firstInvalidatedBy) {
40
57
  return this.#inner.invalidate(file, firstInvalidatedBy);
41
58
  }
@@ -74,7 +91,7 @@ function defineParallelPlugin(pluginPath) {
74
91
  //#endregion
75
92
  //#region src/builtin-plugin/alias-plugin.ts
76
93
  function aliasPlugin(config) {
77
- return createBuiltinPlugin("builtin:alias", config);
94
+ return new BuiltinPlugin("builtin:alias", config);
78
95
  }
79
96
 
80
97
  //#endregion
@@ -102,10 +119,16 @@ function aliasPlugin(config) {
102
119
  * ```
103
120
  */
104
121
  function replacePlugin(values = {}, options = {}) {
122
+ let hasNonStringValues = false;
105
123
  Object.keys(values).forEach((key) => {
106
- values[key] = values[key].toString();
124
+ const value = values[key];
125
+ if (typeof value !== "string") {
126
+ hasNonStringValues = true;
127
+ values[key] = String(value);
128
+ }
107
129
  });
108
- return createBuiltinPlugin("builtin:replace", {
130
+ 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.");
131
+ return new BuiltinPlugin("builtin:replace", {
109
132
  ...options,
110
133
  values
111
134
  });
@@ -121,7 +144,7 @@ function transformPlugin(config) {
121
144
  jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
122
145
  jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude)
123
146
  };
124
- return createBuiltinPlugin("builtin:transform", config);
147
+ return new BuiltinPlugin("builtin:transform", config);
125
148
  }
126
149
 
127
150
  //#endregion
@@ -1,4 +1,4 @@
1
- import "./shared/binding-9k0egz6L.mjs";
2
- import { withFilter } from "./shared/define-config-DJXaSinS.mjs";
1
+ import "./shared/binding-Cjs27cfu.mjs";
2
+ import { withFilter } from "./shared/define-config-DzsPS4fI.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 };
@@ -1,4 +1,4 @@
1
- import { and, arraify, code, exclude, id, include, isPromiseLike, moduleType, not, or, queries, query } from "./shared/dist-ByKQkexh.mjs";
1
+ import { and, arraify, code, exclude, id, include, isPromiseLike, moduleType, not, or, queries, query } from "./shared/dist-CHTC3-kR.mjs";
2
2
 
3
3
  //#region src/plugin/with-filter.ts
4
4
  function withFilterImpl(pluginOption, filterObjectList) {
@@ -1,3 +1,3 @@
1
- import { VERSION, build, defineConfig, rolldown, watch } from "./src-C8U06Im1.js";
1
+ import { VERSION, build, defineConfig, rolldown, watch } from "./src-C2GHZXDs.js";
2
2
 
3
3
  export { VERSION, build, defineConfig, rolldown, watch };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { PreRenderedChunk } from "./shared/binding-9k0egz6L.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, 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-DJXaSinS.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, 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-DzsPS4fI.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 { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-B0RCtUy7.mjs";
2
- import "./shared/parse-ast-index-C_CZT4St.mjs";
3
- import "./shared/dist-ByKQkexh.mjs";
1
+ import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-kVjGhYdF.mjs";
2
+ import "./shared/parse-ast-index-C3TkGcEQ.mjs";
3
+ import "./shared/dist-CHTC3-kR.mjs";
4
4
 
5
5
  export { VERSION, build, defineConfig, rolldown, watch };
@@ -1,6 +1,6 @@
1
- import { PluginContextData, bindingifyPlugin } from "./shared/src-B0RCtUy7.mjs";
2
- import "./shared/parse-ast-index-C_CZT4St.mjs";
3
- import "./shared/dist-ByKQkexh.mjs";
1
+ import { PluginContextData, bindingifyPlugin } from "./shared/src-kVjGhYdF.mjs";
2
+ import "./shared/parse-ast-index-C3TkGcEQ.mjs";
3
+ import "./shared/dist-CHTC3-kR.mjs";
4
4
  import { parentPort, workerData } from "node:worker_threads";
5
5
  import { registerPlugins } from "./rolldown-binding.wasi.cjs";
6
6
 
@@ -9,8 +9,7 @@ const { registryId, pluginInfos, threadNumber } = workerData;
9
9
  (async () => {
10
10
  try {
11
11
  const plugins = await Promise.all(pluginInfos.map(async (pluginInfo) => {
12
- const pluginModule = await import(pluginInfo.fileUrl);
13
- const definePluginImpl = pluginModule.default;
12
+ const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
14
13
  const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
15
14
  return {
16
15
  index: pluginInfo.index,
@@ -1,5 +1,5 @@
1
- import "./shared/binding-9k0egz6L.mjs";
2
- import { MaybePromise, Plugin } from "./shared/define-config-DJXaSinS.mjs";
1
+ import "./shared/binding-Cjs27cfu.mjs";
2
+ import { MaybePromise, Plugin } from "./shared/define-config-DzsPS4fI.mjs";
3
3
 
4
4
  //#region src/plugin/parallel-plugin-implementation.d.ts
5
5
  type ParallelPluginImplementation = Plugin;
@@ -1,4 +1,4 @@
1
- import { ParseResult, ParserOptions } from "./shared/binding-9k0egz6L.mjs";
1
+ import { ParseResult, ParserOptions } from "./shared/binding-Cjs27cfu.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
 
4
4
  //#region src/parse-ast-index.d.ts
@@ -1,3 +1,3 @@
1
- import { parseAst, parseAstAsync } from "./shared/parse-ast-index-C_CZT4St.mjs";
1
+ import { parseAst, parseAstAsync } from "./shared/parse-ast-index-C3TkGcEQ.mjs";
2
2
 
3
3
  export { parseAst, parseAstAsync };
@@ -103,6 +103,7 @@ export const BindingWatcher = __napiModule.exports.BindingWatcher
103
103
  export const BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
104
104
  export const BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
105
105
  export const ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
106
+ export const ScheduledBuild = __napiModule.exports.ScheduledBuild
106
107
  export const TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
107
108
  export const BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
108
109
  export const BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
@@ -148,6 +148,7 @@ module.exports.BindingWatcher = __napiModule.exports.BindingWatcher
148
148
  module.exports.BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
149
149
  module.exports.BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
150
150
  module.exports.ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
151
+ module.exports.ScheduledBuild = __napiModule.exports.ScheduledBuild
151
152
  module.exports.TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
152
153
  module.exports.BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
153
154
  module.exports.BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
@@ -1364,6 +1364,7 @@ interface BindingReporterPluginConfig {
1364
1364
  assetsDir: string;
1365
1365
  chunkLimit: number;
1366
1366
  shouldLogInfo: boolean;
1367
+ warnLargeChunks: boolean;
1367
1368
  reportCompressedSize: boolean;
1368
1369
  }
1369
1370
  interface BindingTransformHookExtraArgs {
@@ -1,4 +1,4 @@
1
- import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-D13M6Llu.cjs";
1
+ import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-Cjs27cfu.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
4
4
 
@@ -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" | "codegen" | "sourcemap">;
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 };
@@ -19,7 +19,7 @@ function unsupported(info) {
19
19
  function noop(..._args) {}
20
20
 
21
21
  //#endregion
22
- //#region ../pluginutils/dist/index.js
22
+ //#region ../pluginutils/dist/index.mjs
23
23
  var And = class {
24
24
  kind;
25
25
  args;
@@ -1,4 +1,4 @@
1
- import { rolldown } from "./src-B0RCtUy7.mjs";
1
+ import { rolldown } from "./src-kVjGhYdF.mjs";
2
2
  import path from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import { readdir } from "node:fs/promises";
@@ -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: injectValues + 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 result = await bundle.write({
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 = [