rolldown 1.0.0-beta.23 → 1.0.0-beta.25

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 (36) hide show
  1. package/dist/cli.cjs +7 -7
  2. package/dist/cli.mjs +7 -7
  3. package/dist/config.cjs +3 -3
  4. package/dist/config.d.cts +2 -2
  5. package/dist/config.d.mts +2 -2
  6. package/dist/config.mjs +3 -3
  7. package/dist/experimental-index.cjs +2 -2
  8. package/dist/experimental-index.d.cts +2 -4
  9. package/dist/experimental-index.d.mts +2 -4
  10. package/dist/experimental-index.mjs +2 -2
  11. package/dist/experimental-runtime-types.d.ts +3 -2
  12. package/dist/filter-index.d.cts +2 -2
  13. package/dist/filter-index.d.mts +2 -2
  14. package/dist/index.cjs +2 -2
  15. package/dist/index.d.cts +3 -3
  16. package/dist/index.d.mts +3 -3
  17. package/dist/index.mjs +2 -2
  18. package/dist/parallel-plugin-worker.cjs +2 -2
  19. package/dist/parallel-plugin-worker.mjs +2 -2
  20. package/dist/parallel-plugin.d.cts +2 -2
  21. package/dist/parallel-plugin.d.mts +2 -2
  22. package/dist/parse-ast-index.cjs +1 -1
  23. package/dist/parse-ast-index.d.cts +1 -2
  24. package/dist/parse-ast-index.d.mts +1 -2
  25. package/dist/parse-ast-index.mjs +1 -1
  26. package/dist/shared/{binding-CMKStSph.d.cts → binding-B9-3a5q4.d.cts} +0 -10
  27. package/dist/shared/{binding-DB58iXP8.d.mts → binding-DQYRWAqj.d.mts} +0 -10
  28. package/dist/shared/{define-config-BRkYSF9E.d.cts → define-config-DM79zlkB.d.mts} +37 -32
  29. package/dist/shared/{define-config-CyRbZDRR.d.mts → define-config-ZN70csxk.d.cts} +37 -32
  30. package/dist/shared/{load-config-n-iiDvYj.cjs → load-config-CTkl_gvX.cjs} +1 -1
  31. package/dist/shared/{load-config-CTdjFUJH.mjs → load-config-FeIDZeND.mjs} +1 -1
  32. package/dist/shared/{parse-ast-index-DDMiEgyY.cjs → parse-ast-index-BZPHquvf.cjs} +17 -5
  33. package/dist/shared/{parse-ast-index-DmWy-n6o.mjs → parse-ast-index-BztFsVUE.mjs} +10 -4
  34. package/dist/shared/{src-DgdMNl-3.mjs → src-BS7SHs-K.mjs} +106 -63
  35. package/dist/shared/{src-D6QrbVqq.cjs → src-CKVDAG8j.cjs} +106 -63
  36. package/package.json +19 -19
@@ -1,4 +1,4 @@
1
- import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-DmWy-n6o.mjs";
1
+ import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-BztFsVUE.mjs";
2
2
  import { arraify, noop, unimplemented, unreachable, unsupported } from "./misc-CQeo-AFx.mjs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
@@ -8,9 +8,20 @@ import os from "node:os";
8
8
  import { Worker } from "node:worker_threads";
9
9
 
10
10
  //#region package.json
11
- var version = "1.0.0-beta.23";
11
+ var version = "1.0.0-beta.25";
12
12
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
13
13
 
14
+ //#endregion
15
+ //#region src/utils/normalize-string-or-regex.ts
16
+ function normalizedStringOrRegex(pattern) {
17
+ if (!pattern) return void 0;
18
+ if (!isReadonlyArray(pattern)) return [pattern];
19
+ return pattern;
20
+ }
21
+ function isReadonlyArray(input) {
22
+ return Array.isArray(input);
23
+ }
24
+
14
25
  //#endregion
15
26
  //#region src/builtin-plugin/utils.ts
16
27
  function makeBuiltinPluginCallable(plugin) {
@@ -40,6 +51,10 @@ function modulePreloadPolyfillPlugin(config) {
40
51
  return new BuiltinPlugin("builtin:module-preload-polyfill", config);
41
52
  }
42
53
  function dynamicImportVarsPlugin(config) {
54
+ if (config) {
55
+ config.include = normalizedStringOrRegex(config.include);
56
+ config.exclude = normalizedStringOrRegex(config.exclude);
57
+ }
43
58
  return new BuiltinPlugin("builtin:dynamic-import-vars", config);
44
59
  }
45
60
  function importGlobPlugin(config) {
@@ -1983,7 +1998,8 @@ const ResolveOptionsSchema = strictObject({
1983
1998
  mainFiles: optional(array(string())),
1984
1999
  modules: optional(array(string())),
1985
2000
  symlinks: optional(boolean()),
1986
- tsconfigFilename: optional(string())
2001
+ tsconfigFilename: optional(string()),
2002
+ yarnPnp: optional(boolean())
1987
2003
  });
1988
2004
  const TreeshakingOptionsSchema = union([boolean(), looseObject({
1989
2005
  annotations: optional(boolean()),
@@ -1991,6 +2007,7 @@ const TreeshakingOptionsSchema = union([boolean(), looseObject({
1991
2007
  unknownGlobalSideEffects: optional(boolean()),
1992
2008
  commonjs: optional(boolean())
1993
2009
  })]);
2010
+ const OptimizationOptionsSchema = strictObject({ inlineConst: pipe(optional(boolean()), description("Enable crossmodule constant inlining")) });
1994
2011
  const OnLogSchema = pipe(function_(), args(tuple([
1995
2012
  LogLevelSchema,
1996
2013
  RollupLogSchema,
@@ -2016,6 +2033,7 @@ const InputOptionsSchema = strictObject({
2016
2033
  ])), description(`Platform for which the code should be generated (node, ${colors.underline("browser")}, neutral)`)),
2017
2034
  shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
2018
2035
  treeshake: optional(TreeshakingOptionsSchema),
2036
+ optimization: optional(OptimizationOptionsSchema),
2019
2037
  logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${colors.dim("silent")}, ${colors.underline(colors.gray("info"))}, debug, ${colors.yellow("warn")})`)),
2020
2038
  onLog: optional(OnLogSchema),
2021
2039
  onwarn: optional(OnwarnSchema),
@@ -2031,7 +2049,8 @@ const InputOptionsSchema = strictObject({
2031
2049
  literal("none"),
2032
2050
  literal("simple"),
2033
2051
  literal("full")
2034
- ]))
2052
+ ])),
2053
+ chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")]))
2035
2054
  })),
2036
2055
  define: pipe(optional(record(string(), string())), description("Define global variables")),
2037
2056
  inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
@@ -2172,7 +2191,8 @@ const OutputOptionsSchema = strictObject({
2172
2191
  }, () => `The 'true' value is not supported`)),
2173
2192
  preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
2174
2193
  preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
2175
- virtualDirname: optional(string())
2194
+ virtualDirname: optional(string()),
2195
+ minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
2176
2196
  });
2177
2197
  const getAddonDescription = (placement, wrapper) => {
2178
2198
  return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
@@ -2341,19 +2361,6 @@ function transformModuleInfo(info, option) {
2341
2361
  };
2342
2362
  }
2343
2363
 
2344
- //#endregion
2345
- //#region src/utils/transform-side-effects.ts
2346
- function bindingifySideEffects(sideEffects) {
2347
- switch (sideEffects) {
2348
- case true: return BindingHookSideEffects.True;
2349
- case false: return BindingHookSideEffects.False;
2350
- case "no-treeshake": return BindingHookSideEffects.NoTreeshake;
2351
- case null:
2352
- case void 0: return void 0;
2353
- default: throw new Error(`Unexpected side effects: ${sideEffects}`);
2354
- }
2355
- }
2356
-
2357
2364
  //#endregion
2358
2365
  //#region src/utils/transform-sourcemap.ts
2359
2366
  function isEmptySourcemapFiled(array$1) {
@@ -2370,7 +2377,7 @@ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
2370
2377
  }
2371
2378
 
2372
2379
  //#endregion
2373
- //#region ../../node_modules/.pnpm/remeda@2.23.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
2380
+ //#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
2374
2381
  function u$1(o, n, a) {
2375
2382
  let t = (r) => o(r, ...n);
2376
2383
  return a === void 0 ? t : Object.assign(t, {
@@ -2380,7 +2387,7 @@ function u$1(o, n, a) {
2380
2387
  }
2381
2388
 
2382
2389
  //#endregion
2383
- //#region ../../node_modules/.pnpm/remeda@2.23.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
2390
+ //#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
2384
2391
  function u(r, n, o) {
2385
2392
  let a = r.length - n.length;
2386
2393
  if (a === 0) return r(...n);
@@ -2389,7 +2396,7 @@ function u(r, n, o) {
2389
2396
  }
2390
2397
 
2391
2398
  //#endregion
2392
- //#region ../../node_modules/.pnpm/remeda@2.23.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
2399
+ //#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
2393
2400
  function d(...r) {
2394
2401
  return u(i, r);
2395
2402
  }
@@ -2596,7 +2603,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2596
2603
  });
2597
2604
  data.loadModulePromiseMap.set(id, promise$1);
2598
2605
  try {
2599
- await context.load(id, bindingifySideEffects(options.moduleSideEffects));
2606
+ await context.load(id, options.moduleSideEffects ?? void 0);
2600
2607
  } catch (e) {
2601
2608
  data.loadModulePromiseMap.delete(id);
2602
2609
  data.loadModulePromiseResolveFnMap.delete(id);
@@ -2616,6 +2623,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2616
2623
  }, void 0);
2617
2624
  const res = await this.context.resolve(source, importer, {
2618
2625
  custom: receipt,
2626
+ isEntry: options?.isEntry,
2619
2627
  skipSelf: options?.skipSelf,
2620
2628
  vitePluginCustom
2621
2629
  });
@@ -2625,7 +2633,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2625
2633
  return {
2626
2634
  ...res,
2627
2635
  external: res.external === "relative" ? unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
2628
- ...info
2636
+ ...info,
2637
+ moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
2629
2638
  };
2630
2639
  }
2631
2640
  emitFile = (file) => {
@@ -2749,7 +2758,7 @@ function bindingifyResolveId(args$1) {
2749
2758
  id: ret.id,
2750
2759
  external: ret.external,
2751
2760
  normalizeExternalId: false,
2752
- sideEffects: bindingifySideEffects(exist.moduleSideEffects)
2761
+ moduleSideEffects: exist.moduleSideEffects ?? void 0
2753
2762
  };
2754
2763
  },
2755
2764
  meta: bindingifyPluginHookMeta(meta),
@@ -2773,7 +2782,7 @@ function bindingifyResolveDynamicImport(args$1) {
2773
2782
  id: ret.id,
2774
2783
  external: ret.external
2775
2784
  };
2776
- if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
2785
+ if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
2777
2786
  args$1.pluginContextData.updateModuleOption(ret.id, {
2778
2787
  meta: ret.meta || {},
2779
2788
  moduleSideEffects: ret.moduleSideEffects || null,
@@ -2801,7 +2810,7 @@ function bindingifyTransform(args$1) {
2801
2810
  return {
2802
2811
  code: ret.code,
2803
2812
  map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code, ret.map)),
2804
- sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects),
2813
+ moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
2805
2814
  moduleType: ret.moduleType
2806
2815
  };
2807
2816
  },
@@ -2828,7 +2837,7 @@ function bindingifyLoad(args$1) {
2828
2837
  code: ret.code,
2829
2838
  map: bindingifySourcemap$1(map),
2830
2839
  moduleType: ret.moduleType,
2831
- sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects)
2840
+ moduleSideEffects: moduleOption.moduleSideEffects ?? void 0
2832
2841
  };
2833
2842
  },
2834
2843
  meta: bindingifyPluginHookMeta(meta),
@@ -3482,7 +3491,7 @@ var ChunkingContextImpl = class {
3482
3491
  //#endregion
3483
3492
  //#region src/utils/bindingify-output-options.ts
3484
3493
  function bindingifyOutputOptions(outputOptions) {
3485
- const { dir, format, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks } = outputOptions;
3494
+ const { dir, format, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
3486
3495
  const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
3487
3496
  return {
3488
3497
  dir,
@@ -3517,7 +3526,9 @@ function bindingifyOutputOptions(outputOptions) {
3517
3526
  preserveModules,
3518
3527
  virtualDirname,
3519
3528
  legalComments,
3520
- preserveModulesRoot
3529
+ preserveModulesRoot,
3530
+ topLevelVar,
3531
+ minifyInternalExports: outputOptions.minifyInternalExports
3521
3532
  };
3522
3533
  }
3523
3534
  function bindingifyAddon(configAddon) {
@@ -3686,6 +3697,12 @@ var NormalizedOutputOptionsImpl = class {
3686
3697
  get virtualDirname() {
3687
3698
  return this.inner.virtualDirname;
3688
3699
  }
3700
+ get topLevelVar() {
3701
+ return this.inner.topLevelVar ?? false;
3702
+ }
3703
+ get minifyInternalExports() {
3704
+ return this.inner.minifyInternalExports ?? false;
3705
+ }
3689
3706
  };
3690
3707
  function normalizeAddon(value) {
3691
3708
  if (typeof value === "function") return value;
@@ -3796,17 +3813,6 @@ var PluginContextData = class {
3796
3813
  }
3797
3814
  };
3798
3815
 
3799
- //#endregion
3800
- //#region src/utils/normalize-string-or-regex.ts
3801
- function normalizedStringOrRegex(pattern) {
3802
- if (!pattern) return void 0;
3803
- if (!isReadonlyArray(pattern)) return [pattern];
3804
- return pattern;
3805
- }
3806
- function isReadonlyArray(input) {
3807
- return Array.isArray(input);
3808
- }
3809
-
3810
3816
  //#endregion
3811
3817
  //#region src/utils/bindingify-input-options.ts
3812
3818
  function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
@@ -3816,8 +3822,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3816
3822
  if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
3817
3823
  return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
3818
3824
  });
3819
- const { jsx, jsxTransform } = bindingifyJsx(inputOptions.jsx);
3820
- const transform = inputOptions.transform || jsxTransform;
3825
+ const { jsx, transform } = bindingifyJsx(onLog, inputOptions.jsx, inputOptions.transform);
3821
3826
  return {
3822
3827
  input: bindingifyInput(inputOptions.input),
3823
3828
  plugins,
@@ -3832,14 +3837,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3832
3837
  moduleTypes: inputOptions.moduleTypes,
3833
3838
  define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
3834
3839
  inject: bindingifyInject(inputOptions.inject),
3835
- experimental: {
3836
- strictExecutionOrder: inputOptions.experimental?.strictExecutionOrder,
3837
- disableLiveBindings: inputOptions.experimental?.disableLiveBindings,
3838
- viteMode: inputOptions.experimental?.viteMode,
3839
- resolveNewUrlToAsset: inputOptions.experimental?.resolveNewUrlToAsset,
3840
- hmr: bindingifyHmr(inputOptions.experimental?.hmr),
3841
- attachDebugInfo: bindingifyAttachDebugInfo(inputOptions.experimental?.attachDebugInfo)
3842
- },
3840
+ experimental: bindingifyExperimental(inputOptions.experimental),
3843
3841
  profilerNames: inputOptions?.profilerNames,
3844
3842
  jsx,
3845
3843
  transform,
@@ -3852,7 +3850,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3852
3850
  pluginContextData.moduleOptionMap.forEach((value, key) => {
3853
3851
  if (value.invalidate) ret.push({
3854
3852
  id: key,
3855
- sideEffects: bindingifySideEffects(value.moduleSideEffects)
3853
+ sideEffects: value.moduleSideEffects ?? void 0
3856
3854
  });
3857
3855
  });
3858
3856
  return ret;
@@ -3861,7 +3859,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3861
3859
  debug: inputOptions.debug,
3862
3860
  invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
3863
3861
  markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
3864
- preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures)
3862
+ preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
3863
+ optimization: inputOptions.optimization
3865
3864
  };
3866
3865
  }
3867
3866
  function bindingifyHmr(hmr) {
@@ -3893,7 +3892,29 @@ function bindingifyExternal(external) {
3893
3892
  };
3894
3893
  }
3895
3894
  }
3895
+ function bindingifyExperimental(experimental) {
3896
+ let chunkModulesOrder = BindingChunkModuleOrderBy.ExecOrder;
3897
+ if (experimental?.chunkModulesOrder) switch (experimental.chunkModulesOrder) {
3898
+ case "exec-order":
3899
+ chunkModulesOrder = BindingChunkModuleOrderBy.ExecOrder;
3900
+ break;
3901
+ case "module-id":
3902
+ chunkModulesOrder = BindingChunkModuleOrderBy.ModuleId;
3903
+ break;
3904
+ default: throw new Error(`Unexpected chunkModulesOrder: ${experimental.chunkModulesOrder}`);
3905
+ }
3906
+ return {
3907
+ strictExecutionOrder: experimental?.strictExecutionOrder,
3908
+ disableLiveBindings: experimental?.disableLiveBindings,
3909
+ viteMode: experimental?.viteMode,
3910
+ resolveNewUrlToAsset: experimental?.resolveNewUrlToAsset,
3911
+ hmr: bindingifyHmr(experimental?.hmr),
3912
+ attachDebugInfo: bindingifyAttachDebugInfo(experimental?.attachDebugInfo),
3913
+ chunkModulesOrder
3914
+ };
3915
+ }
3896
3916
  function bindingifyResolve(resolve) {
3917
+ const yarnPnp = !!process.versions.pnp;
3897
3918
  if (resolve) {
3898
3919
  const { alias, extensionAlias,...rest } = resolve;
3899
3920
  return {
@@ -3905,9 +3926,10 @@ function bindingifyResolve(resolve) {
3905
3926
  target: name,
3906
3927
  replacements: value
3907
3928
  })) : void 0,
3929
+ yarnPnp,
3908
3930
  ...rest
3909
3931
  };
3910
- }
3932
+ } else return { yarnPnp };
3911
3933
  }
3912
3934
  function bindingifyInject(inject) {
3913
3935
  if (inject) return Object.entries(inject).map(([alias, item]) => {
@@ -3951,24 +3973,45 @@ function bindingifyInput(input) {
3951
3973
  };
3952
3974
  });
3953
3975
  }
3954
- function bindingifyJsx(input) {
3976
+ function bindingifyJsx(onLog, input, transform) {
3977
+ if (transform?.jsx) {
3978
+ if (input !== void 0) onLog(LOG_LEVEL_WARN, logDuplicateJsxConfig());
3979
+ return { transform };
3980
+ }
3955
3981
  if (typeof input === "object") {
3956
- if (input.mode === "preserve") return { jsx: BindingJsx.Preserve };
3982
+ if (input.mode === "preserve") return {
3983
+ jsx: BindingJsx.Preserve,
3984
+ transform
3985
+ };
3957
3986
  const mode = input.mode ?? "automatic";
3958
- return { jsxTransform: { jsx: {
3987
+ transform ??= {};
3988
+ transform.jsx = {
3959
3989
  runtime: mode,
3960
3990
  pragma: input.factory,
3961
3991
  pragmaFrag: input.fragment,
3962
3992
  importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0
3963
- } } };
3993
+ };
3994
+ return { transform };
3964
3995
  }
3996
+ let jsx;
3965
3997
  switch (input) {
3966
- case false: return { jsx: BindingJsx.Disable };
3967
- case "react": return { jsx: BindingJsx.React };
3968
- case "react-jsx": return { jsx: BindingJsx.ReactJsx };
3969
- case "preserve": return { jsx: BindingJsx.Preserve };
3970
- default: return { jsx: void 0 };
3998
+ case false:
3999
+ jsx = BindingJsx.Disable;
4000
+ break;
4001
+ case "react":
4002
+ jsx = BindingJsx.React;
4003
+ break;
4004
+ case "react-jsx":
4005
+ jsx = BindingJsx.ReactJsx;
4006
+ break;
4007
+ case "preserve":
4008
+ jsx = BindingJsx.Preserve;
4009
+ break;
3971
4010
  }
4011
+ return {
4012
+ jsx,
4013
+ transform
4014
+ };
3972
4015
  }
3973
4016
  function bindingifyWatch(watch$1) {
3974
4017
  if (watch$1) return {
@@ -4140,7 +4183,7 @@ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose)
4140
4183
  function transformHmrPatchOutput(output) {
4141
4184
  handleHmrPatchOutputErrors(output);
4142
4185
  const { patch } = output;
4143
- return patch;
4186
+ return patch ?? void 0;
4144
4187
  }
4145
4188
  function handleHmrPatchOutputErrors(output) {
4146
4189
  const rawErrors = output.errors;