@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
@@ -186,7 +186,7 @@ function augmentCodeLocation(properties, pos, source, id) {
186
186
  }
187
187
 
188
188
  //#endregion
189
- //#region ../../node_modules/.pnpm/oxc-parser@0.82.3/node_modules/oxc-parser/wrap.mjs
189
+ //#region ../../node_modules/.pnpm/oxc-parser@0.87.0/node_modules/oxc-parser/wrap.mjs
190
190
  function wrap$1(result) {
191
191
  let program, module, comments, errors;
192
192
  return {
@@ -137,8 +137,7 @@ function requirePicocolors() {
137
137
  picocolors.exports.createColors = createColors;
138
138
  return picocolors.exports;
139
139
  }
140
- var picocolorsExports = /* @__PURE__ */ requirePicocolors();
141
- const e = /* @__PURE__ */ getDefaultExportFromCjs(picocolorsExports);
140
+ const e = /* @__PURE__ */ getDefaultExportFromCjs(/* @__PURE__ */ requirePicocolors());
142
141
  function J({ onlyFirst: t = false } = {}) {
143
142
  const F$1 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
144
143
  return new RegExp(F$1, t ? void 0 : "g");
@@ -596,12 +595,10 @@ let wD = class extends x {
596
595
  return this.options[this.cursor].value;
597
596
  }
598
597
  toggleAll() {
599
- const u$1 = this.value.length === this.options.length;
600
- this.value = u$1 ? [] : this.options.map((F$1) => F$1.value);
598
+ this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
601
599
  }
602
600
  toggleValue() {
603
- const u$1 = this.value.includes(this._value);
604
- this.value = u$1 ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
601
+ this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
605
602
  }
606
603
  };
607
604
  var SD = Object.defineProperty, $D = (t, u$1, F$1) => u$1 in t ? SD(t, u$1, {
@@ -811,7 +808,7 @@ async function prompt(message, opts = {}) {
811
808
  if (Error.captureStackTrace) Error.captureStackTrace(error, prompt);
812
809
  throw error;
813
810
  }
814
- case "undefined": return void 0;
811
+ case "undefined": return;
815
812
  case "null": return null;
816
813
  case "symbol": return kCancel;
817
814
  default:
@@ -1,5 +1,5 @@
1
- import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-C_CZT4St.mjs";
2
- import { and, arraify, code, exclude, id, include, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-ByKQkexh.mjs";
1
+ import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-C3TkGcEQ.mjs";
2
+ import { and, arraify, code, exclude, id, include, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-CHTC3-kR.mjs";
3
3
  import { Worker } from "node:worker_threads";
4
4
  import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
5
5
  import path from "node:path";
@@ -34,25 +34,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
 
35
35
  //#endregion
36
36
  //#region package.json
37
- var version = "1.0.0-beta.35";
37
+ var version = "1.0.0-beta.37";
38
38
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
39
39
 
40
40
  //#endregion
41
41
  //#region src/builtin-plugin/utils.ts
42
- const BuiltinClassSymbol = Symbol.for("__RolldownBuiltinPlugin__");
43
42
  var BuiltinPlugin = class {
44
43
  constructor(name, _options) {
45
44
  this.name = name;
46
45
  this._options = _options;
47
- this[BuiltinClassSymbol] = true;
48
46
  }
49
47
  };
50
- function isBuiltinPlugin(obj) {
51
- return obj && obj[BuiltinClassSymbol] === true;
52
- }
53
- function createBuiltinPlugin(name, options) {
54
- return new BuiltinPlugin(name, options);
55
- }
56
48
  function makeBuiltinPluginCallable(plugin) {
57
49
  let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
58
50
  const wrappedPlugin = plugin;
@@ -110,8 +102,7 @@ function getLogHandler(level, code$1, logger, pluginName, logLevel) {
110
102
  function getLogger(plugins, onLog, logLevel, watchMode) {
111
103
  const minimalPriority = logLevelPriority[logLevel];
112
104
  const logger = (level, log, skipped = /* @__PURE__ */ new Set()) => {
113
- const logPriority = logLevelPriority[level];
114
- if (logPriority < minimalPriority) return;
105
+ if (logLevelPriority[level] < minimalPriority) return;
115
106
  for (const plugin of getSortedPlugins("onLog", plugins)) {
116
107
  if (skipped.has(plugin)) continue;
117
108
  const { onLog: pluginOnLog } = plugin;
@@ -120,8 +111,7 @@ function getLogger(plugins, onLog, logLevel, watchMode) {
120
111
  if (logLevelPriority[level$1] < minimalPriority) return () => {};
121
112
  return (log$1) => logger(level$1, normalizeLog(log$1), new Set(skipped).add(plugin));
122
113
  };
123
- const handler = "handler" in pluginOnLog ? pluginOnLog.handler : pluginOnLog;
124
- if (handler.call({
114
+ if (("handler" in pluginOnLog ? pluginOnLog.handler : pluginOnLog).call({
125
115
  debug: getLogHandler$1(LOG_LEVEL_DEBUG),
126
116
  error: (log$1) => error(normalizeLog(log$1)),
127
117
  info: getLogHandler$1(LOG_LEVEL_INFO),
@@ -203,7 +193,7 @@ function normalizeHook(hook) {
203
193
  //#endregion
204
194
  //#region src/utils/normalize-string-or-regex.ts
205
195
  function normalizedStringOrRegex(pattern) {
206
- if (!pattern) return void 0;
196
+ if (!pattern) return;
207
197
  if (!isReadonlyArray(pattern)) return [pattern];
208
198
  return pattern;
209
199
  }
@@ -214,59 +204,59 @@ function isReadonlyArray(input) {
214
204
  //#endregion
215
205
  //#region src/builtin-plugin/constructors.ts
216
206
  function modulePreloadPolyfillPlugin(config) {
217
- return createBuiltinPlugin("builtin:module-preload-polyfill", config);
207
+ return new BuiltinPlugin("builtin:module-preload-polyfill", config);
218
208
  }
219
209
  function dynamicImportVarsPlugin(config) {
220
210
  if (config) {
221
211
  config.include = normalizedStringOrRegex(config.include);
222
212
  config.exclude = normalizedStringOrRegex(config.exclude);
223
213
  }
224
- return createBuiltinPlugin("builtin:dynamic-import-vars", config);
214
+ return new BuiltinPlugin("builtin:dynamic-import-vars", config);
225
215
  }
226
216
  function importGlobPlugin(config) {
227
- return createBuiltinPlugin("builtin:import-glob", config);
217
+ return new BuiltinPlugin("builtin:import-glob", config);
228
218
  }
229
219
  function reporterPlugin(config) {
230
- return createBuiltinPlugin("builtin:reporter", config);
220
+ return new BuiltinPlugin("builtin:reporter", config);
231
221
  }
232
222
  function manifestPlugin(config) {
233
- return createBuiltinPlugin("builtin:manifest", config);
223
+ return new BuiltinPlugin("builtin:manifest", config);
234
224
  }
235
225
  function wasmHelperPlugin(config) {
236
- return createBuiltinPlugin("builtin:wasm-helper", config);
226
+ return new BuiltinPlugin("builtin:wasm-helper", config);
237
227
  }
238
228
  function wasmFallbackPlugin() {
239
- const builtinPlugin = createBuiltinPlugin("builtin:wasm-fallback");
229
+ const builtinPlugin = new BuiltinPlugin("builtin:wasm-fallback");
240
230
  return makeBuiltinPluginCallable(builtinPlugin);
241
231
  }
242
232
  function loadFallbackPlugin() {
243
- return createBuiltinPlugin("builtin:load-fallback");
233
+ return new BuiltinPlugin("builtin:load-fallback");
244
234
  }
245
235
  function jsonPlugin(config) {
246
- const builtinPlugin = createBuiltinPlugin("builtin:json", config);
236
+ const builtinPlugin = new BuiltinPlugin("builtin:json", config);
247
237
  return makeBuiltinPluginCallable(builtinPlugin);
248
238
  }
249
239
  function buildImportAnalysisPlugin(config) {
250
- return createBuiltinPlugin("builtin:build-import-analysis", config);
240
+ return new BuiltinPlugin("builtin:build-import-analysis", config);
251
241
  }
252
242
  function viteResolvePlugin(config) {
253
- const builtinPlugin = createBuiltinPlugin("builtin:vite-resolve", config);
243
+ const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
254
244
  return makeBuiltinPluginCallable(builtinPlugin);
255
245
  }
256
246
  function isolatedDeclarationPlugin(config) {
257
- return createBuiltinPlugin("builtin:isolated-declaration", config);
247
+ return new BuiltinPlugin("builtin:isolated-declaration", config);
258
248
  }
259
249
  function assetPlugin(config) {
260
- return createBuiltinPlugin("builtin:asset", config);
250
+ return new BuiltinPlugin("builtin:asset", config);
261
251
  }
262
252
  function webWorkerPostPlugin() {
263
- return createBuiltinPlugin("builtin:web-worker-post");
253
+ return new BuiltinPlugin("builtin:web-worker-post");
264
254
  }
265
255
  function oxcRuntimePlugin(config) {
266
- return createBuiltinPlugin("builtin:oxc-runtime", config);
256
+ return new BuiltinPlugin("builtin:oxc-runtime", config);
267
257
  }
268
258
  function esmExternalRequirePlugin(config) {
269
- return createBuiltinPlugin("builtin:esm-external-require", config);
259
+ return new BuiltinPlugin("builtin:esm-external-require", config);
270
260
  }
271
261
 
272
262
  //#endregion
@@ -360,7 +350,7 @@ function checkOutputPluginOption(plugins, onLog) {
360
350
  function normalizePlugins(plugins, anonymousPrefix) {
361
351
  for (const [index, plugin] of plugins.entries()) {
362
352
  if ("_parallel" in plugin) continue;
363
- if (isBuiltinPlugin(plugin)) continue;
353
+ if (plugin instanceof BuiltinPlugin) continue;
364
354
  if (!plugin.name) plugin.name = `${anonymousPrefix}${index + 1}`;
365
355
  }
366
356
  return plugins;
@@ -427,9 +417,9 @@ var PluginDriver = class {
427
417
  };
428
418
  function getObjectPlugins(plugins) {
429
419
  return plugins.filter((plugin) => {
430
- if (!plugin) return void 0;
431
- if ("_parallel" in plugin) return void 0;
432
- if (isBuiltinPlugin(plugin)) return void 0;
420
+ if (!plugin) return;
421
+ if ("_parallel" in plugin) return;
422
+ if (plugin instanceof BuiltinPlugin) return;
433
423
  return plugin;
434
424
  });
435
425
  }
@@ -2078,10 +2068,43 @@ const ChecksOptionsSchema = strictObject({
2078
2068
  configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict")),
2079
2069
  preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warning when detecting prefer builtin feature"))
2080
2070
  });
2071
+ const CompressOptionsKeepNamesSchema = strictObject({
2072
+ function: optional(boolean()),
2073
+ class: optional(boolean())
2074
+ });
2075
+ const CompressOptionsSchema = strictObject({
2076
+ target: optional(union([
2077
+ literal("esnext"),
2078
+ literal("es2015"),
2079
+ literal("es2016"),
2080
+ literal("es2017"),
2081
+ literal("es2018"),
2082
+ literal("es2019"),
2083
+ literal("es2020"),
2084
+ literal("es2021"),
2085
+ literal("es2022"),
2086
+ literal("es2023"),
2087
+ literal("es2024")
2088
+ ])),
2089
+ dropConsole: optional(boolean()),
2090
+ dropDebugger: optional(boolean()),
2091
+ keepNames: optional(CompressOptionsKeepNamesSchema),
2092
+ unused: optional(union([boolean(), literal("keep_assign")]))
2093
+ });
2094
+ const MangleOptionsKeepNamesSchema = strictObject({
2095
+ function: optional(boolean()),
2096
+ class: optional(boolean())
2097
+ });
2098
+ const MangleOptionsSchema = strictObject({
2099
+ toplevel: optional(boolean()),
2100
+ keepNames: optional(union([boolean(), MangleOptionsKeepNamesSchema])),
2101
+ debug: optional(boolean())
2102
+ });
2103
+ const CodegenOptionsSchema = strictObject({ removeWhitespace: optional(boolean()) });
2081
2104
  const MinifyOptionsSchema = strictObject({
2082
- mangle: optional(boolean()),
2083
- compress: optional(boolean()),
2084
- removeWhitespace: optional(boolean())
2105
+ compress: optional(union([boolean(), CompressOptionsSchema])),
2106
+ mangle: optional(union([boolean(), MangleOptionsSchema])),
2107
+ codegen: optional(union([boolean(), CodegenOptionsSchema]))
2085
2108
  });
2086
2109
  const ResolveOptionsSchema = strictObject({
2087
2110
  alias: optional(record(string(), union([string(), array(string())]))),
@@ -2355,8 +2378,7 @@ const CliOptionsSchema = strictObject({
2355
2378
  function validateCliOptions(options) {
2356
2379
  let parsed = safeParse(CliOptionsSchema, options);
2357
2380
  return [parsed.output, parsed.issues?.map((issue) => {
2358
- const option = issue.path?.map((pathItem) => pathItem.key).join(" ");
2359
- return `Invalid value for option ${option}: ${issue.message}`;
2381
+ return `Invalid value for option ${issue.path?.map((pathItem) => pathItem.key).join(" ")}: ${issue.message}`;
2360
2382
  })];
2361
2383
  }
2362
2384
  const inputHelperMsgRecord = {
@@ -2547,7 +2569,7 @@ function generateAtomMatcher(kind, matcher) {
2547
2569
  return kind === "code" ? code(matcher) : id(matcher);
2548
2570
  }
2549
2571
  function transformFilterMatcherToFilterExprs(filterOption) {
2550
- if (!filterOption) return void 0;
2572
+ if (!filterOption) return;
2551
2573
  if (Array.isArray(filterOption)) return filterOption;
2552
2574
  const { id: id$1, code: code$1, moduleType: moduleType$1 } = filterOption;
2553
2575
  let ret = [];
@@ -2645,24 +2667,24 @@ function bindingifyFilterExprImpl(expr, list) {
2645
2667
  }
2646
2668
  }
2647
2669
  function bindingifyResolveIdFilter(filterOption) {
2648
- if (!filterOption) return void 0;
2670
+ if (!filterOption) return;
2649
2671
  if (Array.isArray(filterOption)) return { value: filterOption.map(bindingifyFilterExpr) };
2650
2672
  return filterOption.id ? bindingifyGeneralHookFilter("id", filterOption.id) : void 0;
2651
2673
  }
2652
2674
  function bindingifyLoadFilter(filterOption) {
2653
- if (!filterOption) return void 0;
2675
+ if (!filterOption) return;
2654
2676
  if (Array.isArray(filterOption)) return { value: filterOption.map(bindingifyFilterExpr) };
2655
2677
  return filterOption.id ? bindingifyGeneralHookFilter("id", filterOption.id) : void 0;
2656
2678
  }
2657
2679
  function bindingifyTransformFilter(filterOption) {
2658
- if (!filterOption) return void 0;
2680
+ if (!filterOption) return;
2659
2681
  let filterExprs = transformFilterMatcherToFilterExprs(filterOption);
2660
2682
  let ret = [];
2661
2683
  if (filterExprs) ret = filterExprs.map(bindingifyFilterExpr);
2662
2684
  return { value: ret.length > 0 ? ret : void 0 };
2663
2685
  }
2664
2686
  function bindingifyRenderChunkFilter(filterOption) {
2665
- if (!filterOption) return void 0;
2687
+ if (!filterOption) return;
2666
2688
  if (Array.isArray(filterOption)) return { value: filterOption.map(bindingifyFilterExpr) };
2667
2689
  return filterOption.code ? bindingifyGeneralHookFilter("code", filterOption.code) : void 0;
2668
2690
  }
@@ -2677,7 +2699,7 @@ function bindingPluginOrder(order) {
2677
2699
  case "post": return BindingPluginOrder.Post;
2678
2700
  case "pre": return BindingPluginOrder.Pre;
2679
2701
  case null:
2680
- case void 0: return void 0;
2702
+ case void 0: return;
2681
2703
  default: throw new Error(`Unknown plugin order: ${order}`);
2682
2704
  }
2683
2705
  }
@@ -2844,6 +2866,9 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
2844
2866
  getCombinedSourcemap() {
2845
2867
  return JSON.parse(this.inner.getCombinedSourcemap());
2846
2868
  }
2869
+ addWatchFile(id$1) {
2870
+ this.inner.addWatchFile(id$1);
2871
+ }
2847
2872
  };
2848
2873
 
2849
2874
  //#endregion
@@ -2943,7 +2968,7 @@ function bindingifyTransform(args$1) {
2943
2968
  return {
2944
2969
  plugin: async (ctx, code$1, id$1, meta$1) => {
2945
2970
  const ret = await handler.call(new TransformPluginContextImpl(args$1.outputOptions, ctx.inner(), args$1.plugin, args$1.pluginContextData, ctx, id$1, code$1, args$1.onLog, args$1.logLevel, args$1.watchMode), code$1, id$1, meta$1);
2946
- if (ret == null) return void 0;
2971
+ if (ret == null) return;
2947
2972
  if (typeof ret === "string") return { code: ret };
2948
2973
  let moduleOption = args$1.pluginContextData.updateModuleOption(id$1, {
2949
2974
  meta: ret.meta ?? {},
@@ -3077,9 +3102,8 @@ function transformChunkModules(modules) {
3077
3102
  //#endregion
3078
3103
  //#region src/utils/transform-to-rollup-output.ts
3079
3104
  function transformToRollupSourceMap(map) {
3080
- const parsed = JSON.parse(map);
3081
3105
  const obj = {
3082
- ...parsed,
3106
+ ...JSON.parse(map),
3083
3107
  toString() {
3084
3108
  return JSON.stringify(obj);
3085
3109
  },
@@ -3621,13 +3645,10 @@ var ChunkingContextImpl = class {
3621
3645
  }
3622
3646
  getModuleInfo(moduleId) {
3623
3647
  const bindingInfo = this.context.getModuleInfo(moduleId);
3624
- if (bindingInfo) {
3625
- const info = transformModuleInfo(bindingInfo, {
3626
- moduleSideEffects: null,
3627
- meta: {}
3628
- });
3629
- return info;
3630
- }
3648
+ if (bindingInfo) return transformModuleInfo(bindingInfo, {
3649
+ moduleSideEffects: null,
3650
+ meta: {}
3651
+ });
3631
3652
  return null;
3632
3653
  }
3633
3654
  };
@@ -3700,7 +3721,7 @@ function bindingifySourcemap(sourcemap) {
3700
3721
  case true: return "file";
3701
3722
  case "inline": return "inline";
3702
3723
  case false:
3703
- case void 0: return void 0;
3724
+ case void 0: return;
3704
3725
  case "hidden": return "hidden";
3705
3726
  default: throw new Error(`unknown sourcemap: ${sourcemap}`);
3706
3727
  }
@@ -3726,7 +3747,7 @@ function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
3726
3747
  else if (manualChunks != null) advancedChunks = { groups: [{ name(moduleId, ctx) {
3727
3748
  return manualChunks(moduleId, { getModuleInfo: (id$1) => ctx.getModuleInfo(id$1) });
3728
3749
  } }] };
3729
- if (advancedChunks == null) return void 0;
3750
+ if (advancedChunks == null) return;
3730
3751
  const { groups,...restAdvancedChunks } = advancedChunks;
3731
3752
  return {
3732
3753
  ...restAdvancedChunks,
@@ -3930,8 +3951,7 @@ var PluginContextData = class {
3930
3951
  return info;
3931
3952
  }
3932
3953
  getModuleIds(context) {
3933
- const moduleIds = context.getModuleIds();
3934
- return moduleIds.values();
3954
+ return context.getModuleIds().values();
3935
3955
  }
3936
3956
  saveResolveOptions(options) {
3937
3957
  const index = this.resolveOptionsMap.size;
@@ -3974,8 +3994,8 @@ var PluginContextData = class {
3974
3994
  function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
3975
3995
  const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
3976
3996
  const plugins = rawPlugins.map((plugin) => {
3977
- if ("_parallel" in plugin) return void 0;
3978
- if (isBuiltinPlugin(plugin)) return bindingifyBuiltInPlugin(plugin);
3997
+ if ("_parallel" in plugin) return;
3998
+ if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
3979
3999
  return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
3980
4000
  });
3981
4001
  const { jsx, transform } = bindingifyJsx(onLog, inputOptions.jsx, inputOptions.transform);
@@ -4029,7 +4049,7 @@ function bindingifyHmr(hmr) {
4029
4049
  }
4030
4050
  function bindingifyAttachDebugInfo(attachDebugInfo) {
4031
4051
  switch (attachDebugInfo) {
4032
- case void 0: return void 0;
4052
+ case void 0: return;
4033
4053
  case "full": return BindingAttachDebugInfo.Full;
4034
4054
  case "simple": return BindingAttachDebugInfo.Simple;
4035
4055
  case "none": return BindingAttachDebugInfo.None;
@@ -4184,7 +4204,7 @@ function bindingifyWatch(watch$1) {
4184
4204
  };
4185
4205
  }
4186
4206
  function bindingifyTreeshakeOptions(config) {
4187
- if (config === false) return void 0;
4207
+ if (config === false) return;
4188
4208
  if (config === true || config === void 0) return { moduleSideEffects: true };
4189
4209
  let normalizedConfig = {
4190
4210
  moduleSideEffects: true,
@@ -4230,7 +4250,7 @@ function bindingifyMakeAbsoluteExternalsRelative(makeAbsoluteExternalsRelative)
4230
4250
  };
4231
4251
  }
4232
4252
  function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
4233
- if (preserveEntrySignatures == void 0) return void 0;
4253
+ if (preserveEntrySignatures == void 0) return;
4234
4254
  else if (typeof preserveEntrySignatures === "string") return {
4235
4255
  type: "String",
4236
4256
  field0: preserveEntrySignatures
@@ -4253,7 +4273,7 @@ async function initializeParallelPlugins(plugins) {
4253
4273
  options
4254
4274
  });
4255
4275
  }
4256
- if (pluginInfos.length <= 0) return void 0;
4276
+ if (pluginInfos.length <= 0) return;
4257
4277
  const count = availableParallelism();
4258
4278
  const parallelJsPluginRegistry = new ParallelJsPluginRegistry(count);
4259
4279
  const registryId = parallelJsPluginRegistry.id;
@@ -4562,8 +4582,7 @@ async function createWatcher(emitter, input) {
4562
4582
  })).flat());
4563
4583
  const notifyOptions = getValidNotifyOption(bundlerOptions);
4564
4584
  const bindingWatcher = new BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
4565
- const watcher = new Watcher(emitter, bindingWatcher, bundlerOptions.map((option) => option.stopWorkers));
4566
- watcher.start();
4585
+ new Watcher(emitter, bindingWatcher, bundlerOptions.map((option) => option.stopWorkers)).start();
4567
4586
  }
4568
4587
  function getValidNotifyOption(bundlerOptions) {
4569
4588
  let result;
@@ -4595,4 +4614,4 @@ function defineConfig(config) {
4595
4614
  const VERSION = version;
4596
4615
 
4597
4616
  //#endregion
4598
- export { PluginContextData, PluginDriver, VERSION, __commonJS, __toESM, ansis_default, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, createBuiltinPlugin, createBundlerImpl, createBundlerOptions, defineConfig, description$1 as description, dynamicImportVarsPlugin, esmExternalRequirePlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
4617
+ export { BuiltinPlugin, PluginContextData, PluginDriver, VERSION, __commonJS, __toESM, ansis_default, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, createBundlerImpl, createBundlerOptions, defineConfig, description$1 as description, dynamicImportVarsPlugin, esmExternalRequirePlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };