@rolldown/browser 1.0.0-beta.43 → 1.0.0-beta.44

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 (30) hide show
  1. package/dist/cli-setup.d.mts +1 -0
  2. package/dist/cli-setup.mjs +16 -0
  3. package/dist/cli.mjs +1048 -75
  4. package/dist/config.d.mts +2 -2
  5. package/dist/config.mjs +4 -4
  6. package/dist/experimental-index.browser.mjs +33 -452
  7. package/dist/experimental-index.d.mts +20 -5
  8. package/dist/experimental-index.mjs +38 -15
  9. package/dist/filter-index.d.mts +2 -2
  10. package/dist/filter-index.mjs +1 -1
  11. package/dist/index.browser.mjs +1 -1
  12. package/dist/index.d.mts +2 -2
  13. package/dist/index.mjs +3 -3
  14. package/dist/parallel-plugin-worker.mjs +3 -3
  15. package/dist/parallel-plugin.d.mts +2 -2
  16. package/dist/parse-ast-index.d.mts +1 -1
  17. package/dist/parse-ast-index.mjs +1 -1
  18. package/dist/rolldown-binding.wasi-browser.js +1 -1
  19. package/dist/rolldown-binding.wasi.cjs +1 -1
  20. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  21. package/dist/shared/{binding-BkaKdpud.d.mts → binding-0m41EAn-.d.mts} +89 -14
  22. package/dist/shared/{define-config-D5LB7YAC.d.mts → define-config-BbwLmCDX.d.mts} +193 -87
  23. package/dist/shared/{dist-CU0dSkK2.mjs → dist-DNFKY37q.mjs} +1 -1
  24. package/dist/shared/{load-config-DBsf9ada.mjs → load-config-B3FsKQ_6.mjs} +2 -2
  25. package/dist/shared/{parse-ast-index-Gktxd-oi.mjs → parse-ast-index-Ck5SwMSC.mjs} +37 -6
  26. package/dist/shared/{prompt-B4e-jZUR.mjs → prompt-BDwA3jSr.mjs} +1 -1
  27. package/dist/shared/{src-Dqrw8WuH.mjs → src-BnIhK3nA.mjs} +184 -324
  28. package/dist/{src-DXN0YLUN.js → src-CIeG_TGR.js} +393 -503
  29. package/package.json +1 -1
  30. package/dist/shared/logger-B83ocDok.mjs +0 -985
@@ -1,37 +1,11 @@
1
- import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-Gktxd-oi.mjs";
2
- import { and, arraify, code, exclude, id, include, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-CU0dSkK2.mjs";
1
+ import { a as logCycleLoading, c as logDeprecatedInject, d as logInputHookInOutputPlugin, f as logInvalidLogPosition, h as styleText, i as error, l as logDeprecatedKeepNames, m as logPluginError, o as logDeprecatedDefine, p as logMultiplyNotifyOption, r as augmentCodeLocation, s as logDeprecatedDropLabels, t as parseAst, u as logDeprecatedProfilerNames } from "./parse-ast-index-Ck5SwMSC.mjs";
2
+ import { a as include, c as or, d as arraify, g as unsupported, h as unreachable, i as id, m as unimplemented, n as code, o as moduleType, p as noop, r as exclude, t as and } from "./dist-DNFKY37q.mjs";
3
3
  import { Worker, isMainThread } from "node:worker_threads";
4
- import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingMagicString, BindingMagicString as BindingMagicString$1, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, initTraceSubscriber, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
4
+ import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingMagicString as BindingMagicString$1, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, initTraceSubscriber, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
5
5
  import path from "node:path";
6
6
  import fsp from "node:fs/promises";
7
7
  import os from "node:os";
8
8
 
9
- //#region rolldown:runtime
10
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __commonJS = (cb, mod) => function() {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
- };
19
- var __copyProps = (to, from, except, desc) => {
20
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i$1 = 0, n$2 = keys.length, key; i$1 < n$2; i$1++) {
21
- key = keys[i$1];
22
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
23
- get: ((k) => from[k]).bind(null, key),
24
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
25
- });
26
- }
27
- return to;
28
- };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
- value: mod,
31
- enumerable: true
32
- }) : target, mod));
33
-
34
- //#endregion
35
9
  //#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
36
10
  /**
37
11
  * This is not the set of all possible signals.
@@ -95,12 +69,12 @@ var Emitter = class {
95
69
  }
96
70
  removeListener(ev, fn) {
97
71
  const list = this.listeners[ev];
98
- const i$1 = list.indexOf(fn);
72
+ const i = list.indexOf(fn);
99
73
  /* c8 ignore start */
100
- if (i$1 === -1) return;
74
+ if (i === -1) return;
101
75
  /* c8 ignore stop */
102
- if (i$1 === 0 && list.length === 1) list.length = 0;
103
- else list.splice(i$1, 1);
76
+ if (i === 0 && list.length === 1) list.length = 0;
77
+ else list.splice(i, 1);
104
78
  }
105
79
  emit(ev, code$1, signal) {
106
80
  if (this.emitted[ev]) return false;
@@ -150,15 +124,15 @@ var SignalExit = class extends SignalExitBase {
150
124
  const listeners = this.#process.listeners(sig);
151
125
  let { count } = this.#emitter;
152
126
  /* c8 ignore start */
153
- const p$1 = process$2;
154
- if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count += p$1.__signal_exit_emitter__.count;
127
+ const p = process$2;
128
+ if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
155
129
  /* c8 ignore stop */
156
130
  if (listeners.length === count) {
157
131
  this.unload();
158
132
  const ret = this.#emitter.emit("exit", null, sig);
159
133
  /* c8 ignore start */
160
- const s$1 = sig === "SIGHUP" ? this.#hupSig : sig;
161
- if (!ret) process$2.kill(process$2.pid, s$1);
134
+ const s = sig === "SIGHUP" ? this.#hupSig : sig;
135
+ if (!ret) process$2.kill(process$2.pid, s);
162
136
  }
163
137
  };
164
138
  this.#originalProcessReallyExit = process$2.reallyExit;
@@ -184,8 +158,8 @@ var SignalExit = class extends SignalExitBase {
184
158
  const fn = this.#sigListeners[sig];
185
159
  if (fn) this.#process.on(sig, fn);
186
160
  } catch (_) {}
187
- this.#process.emit = (ev, ...a$2) => {
188
- return this.#processEmit(ev, ...a$2);
161
+ this.#process.emit = (ev, ...a) => {
162
+ return this.#processEmit(ev, ...a);
189
163
  };
190
164
  this.#process.reallyExit = (code$1) => {
191
165
  return this.#processReallyExit(code$1);
@@ -243,7 +217,7 @@ if (isMainThread) {
243
217
 
244
218
  //#endregion
245
219
  //#region package.json
246
- var version = "1.0.0-beta.43";
220
+ var version = "1.0.0-beta.44";
247
221
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
248
222
 
249
223
  //#endregion
@@ -260,9 +234,9 @@ function makeBuiltinPluginCallable(plugin) {
260
234
  for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
261
235
  try {
262
236
  return await callablePlugin[key](...args$1);
263
- } catch (e$2) {
264
- if (e$2 instanceof Error && !e$2.stack?.includes("at ")) Error.captureStackTrace(e$2, wrappedPlugin[key]);
265
- return error(logPluginError(e$2, plugin.name, {
237
+ } catch (e$1) {
238
+ if (e$1 instanceof Error && !e$1.stack?.includes("at ")) Error.captureStackTrace(e$1, wrappedPlugin[key]);
239
+ return error(logPluginError(e$1, plugin.name, {
266
240
  hook: key,
267
241
  id: key === "transform" ? args$1[2] : void 0
268
242
  }));
@@ -517,8 +491,8 @@ var MinimalPluginContextImpl = class {
517
491
  watchMode
518
492
  };
519
493
  }
520
- error(e$2) {
521
- return error(logPluginError(normalizeLog(e$2), this.pluginName, { hook: this.hookName }));
494
+ error(e$1) {
495
+ return error(logPluginError(normalizeLog(e$1), this.pluginName, { hook: this.hookName }));
522
496
  }
523
497
  };
524
498
 
@@ -589,117 +563,6 @@ function getSortedPlugins(hookName, plugins) {
589
563
  ];
590
564
  }
591
565
 
592
- //#endregion
593
- //#region ../../node_modules/.pnpm/ansis@4.2.0/node_modules/ansis/index.cjs
594
- var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis@4.2.0/node_modules/ansis/index.cjs": ((exports, module) => {
595
- let e$1, t$2, r, { defineProperty: l, setPrototypeOf: n$1, create: o, keys: s } = Object, i = "", { round: c, max: a$1 } = Math, p = (e$2) => {
596
- let t$3 = /([a-f\d]{3,6})/i.exec(e$2)?.[1], r$1 = t$3?.length, l$1 = parseInt(6 ^ r$1 ? 3 ^ r$1 ? "0" : t$3[0] + t$3[0] + t$3[1] + t$3[1] + t$3[2] + t$3[2] : t$3, 16);
597
- return [
598
- l$1 >> 16 & 255,
599
- l$1 >> 8 & 255,
600
- 255 & l$1
601
- ];
602
- }, u = (e$2, t$3, r$1) => e$2 ^ t$3 || t$3 ^ r$1 ? 16 + 36 * c(e$2 / 51) + 6 * c(t$3 / 51) + c(r$1 / 51) : 8 > e$2 ? 16 : e$2 > 248 ? 231 : c(24 * (e$2 - 8) / 247) + 232, d = (e$2) => {
603
- let t$3, r$1, l$1, n$2, o$1;
604
- return 8 > e$2 ? 30 + e$2 : 16 > e$2 ? e$2 - 8 + 90 : (232 > e$2 ? (o$1 = (e$2 -= 16) % 36, t$3 = (e$2 / 36 | 0) / 5, r$1 = (o$1 / 6 | 0) / 5, l$1 = o$1 % 6 / 5) : t$3 = r$1 = l$1 = (10 * (e$2 - 232) + 8) / 255, n$2 = 2 * a$1(t$3, r$1, l$1), n$2 ? 30 + (c(l$1) << 2 | c(r$1) << 1 | c(t$3)) + (2 ^ n$2 ? 0 : 60) : 30);
605
- }, f = (() => {
606
- let r$1 = (e$2) => o$1.some(((t$3) => e$2.test(t$3))), l$1 = globalThis, n$2 = l$1.process ?? {}, o$1 = n$2.argv ?? [], i$1 = n$2.env ?? {}, c$1 = -1;
607
- try {
608
- e$1 = "," + s(i$1).join(",");
609
- } catch (e$2) {
610
- i$1 = {}, c$1 = 0;
611
- }
612
- let a$2 = "FORCE_COLOR", p$1 = {
613
- false: 0,
614
- 0: 0,
615
- 1: 1,
616
- 2: 2,
617
- 3: 3
618
- }[i$1[a$2]] ?? -1, u$1 = a$2 in i$1 && p$1 || r$1(/^--color=?(true|always)?$/);
619
- return u$1 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, l$2, n$3) => (t$2 = r$2.TERM, {
620
- "24bit": 3,
621
- truecolor: 3,
622
- ansi256: 2,
623
- ansi: 1
624
- }[r$2.COLORTERM] || (r$2.CI ? /,GITHUB/.test(e$1) ? 3 : 1 : l$2 && "dumb" !== t$2 ? n$3 ? 3 : /-256/.test(t$2) ? 2 : 1 : 0)))(i$1, !!i$1.PM2_HOME || i$1.NEXT_RUNTIME?.includes("edge") || !!n$2.stdout?.isTTY, "win32" === n$2.platform)), !p$1 || i$1.NO_COLOR || r$1(/^--(no-color|color=(false|never))$/) ? 0 : l$1.window?.chrome || u$1 && !c$1 ? 3 : c$1;
625
- })(), g = {
626
- open: i,
627
- close: i
628
- }, h = 39, b = 49, O = {}, m = ({ p: e$2 }, { open: t$3, close: l$1 }) => {
629
- let o$1 = (e$3, ...r$1) => {
630
- if (!e$3) {
631
- if (t$3 && t$3 === l$1) return t$3;
632
- if ((e$3 ?? i) === i) return i;
633
- }
634
- let n$2, s$2 = e$3.raw ? String.raw({ raw: e$3 }, ...r$1) : i + e$3, c$2 = o$1.p, a$2 = c$2.o, p$1 = c$2.c;
635
- if (s$2.includes("\x1B")) for (; c$2; c$2 = c$2.p) {
636
- let { open: e$4, close: t$4 } = c$2, r$2 = t$4.length, l$2 = i, o$2 = 0;
637
- if (r$2) for (; ~(n$2 = s$2.indexOf(t$4, o$2)); o$2 = n$2 + r$2) l$2 += s$2.slice(o$2, n$2) + e$4;
638
- s$2 = l$2 + s$2.slice(o$2);
639
- }
640
- return a$2 + (s$2.includes("\n") ? s$2.replace(/(\r?\n)/g, p$1 + "$1" + a$2) : s$2) + p$1;
641
- }, s$1 = t$3, c$1 = l$1;
642
- return e$2 && (s$1 = e$2.o + t$3, c$1 = l$1 + e$2.c), n$1(o$1, r), o$1.p = {
643
- open: t$3,
644
- close: l$1,
645
- o: s$1,
646
- c: c$1,
647
- p: e$2
648
- }, o$1.open = s$1, o$1.close = c$1, o$1;
649
- };
650
- const w = new function e$2(t$3 = f) {
651
- let s$1 = {
652
- Ansis: e$2,
653
- level: t$3,
654
- isSupported: () => a$2,
655
- strip: (e$3) => e$3.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
656
- extend(e$3) {
657
- for (let t$4 in e$3) {
658
- let r$1 = e$3[t$4], l$1 = (typeof r$1)[0];
659
- "s" === l$1 ? (c$1(t$4, T(...p(r$1))), c$1(_(t$4), v(...p(r$1)))) : c$1(t$4, r$1, "f" === l$1);
660
- }
661
- return r = o({}, O), n$1(s$1, r), s$1;
662
- }
663
- }, c$1 = (e$3, t$4, r$1) => {
664
- O[e$3] = { get() {
665
- let n$2 = r$1 ? (...e$4) => m(this, t$4(...e$4)) : m(this, t$4);
666
- return l(this, e$3, { value: n$2 }), n$2;
667
- } };
668
- }, a$2 = t$3 > 0, w$1 = (e$3, t$4) => a$2 ? {
669
- open: `[${e$3}m`,
670
- close: `[${t$4}m`
671
- } : g, y = (e$3) => (t$4) => e$3(...p(t$4)), R = (e$3, t$4) => (r$1, l$1, n$2) => w$1(`${e$3}8;2;${r$1};${l$1};${n$2}`, t$4), $ = (e$3, t$4) => (r$1, l$1, n$2) => w$1(((e$4, t$5, r$2) => d(u(e$4, t$5, r$2)))(r$1, l$1, n$2) + e$3, t$4), x = (e$3) => (t$4, r$1, l$1) => e$3(u(t$4, r$1, l$1)), T = R(3, h), v = R(4, b), C = (e$3) => w$1("38;5;" + e$3, h), E = (e$3) => w$1("48;5;" + e$3, b);
672
- 2 === t$3 ? (T = x(C), v = x(E)) : 1 === t$3 && (T = $(0, h), v = $(10, b), C = (e$3) => w$1(d(e$3), h), E = (e$3) => w$1(d(e$3) + 10, b));
673
- let M, I = {
674
- fg: C,
675
- bg: E,
676
- rgb: T,
677
- bgRgb: v,
678
- hex: y(T),
679
- bgHex: y(v),
680
- visible: g,
681
- reset: w$1(0, 0),
682
- bold: w$1(1, 22),
683
- dim: w$1(2, 22),
684
- italic: w$1(3, 23),
685
- underline: w$1(4, 24),
686
- inverse: w$1(7, 27),
687
- hidden: w$1(8, 28),
688
- strikethrough: w$1(9, 29)
689
- }, _ = (e$3) => "bg" + e$3[0].toUpperCase() + e$3.slice(1), k = "Bright";
690
- return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e$3, t$4) => {
691
- M = _(e$3), 8 > t$4 ? (I[e$3 + k] = w$1(90 + t$4, h), I[M + k] = w$1(100 + t$4, b)) : t$4 = 60, I[e$3] = w$1(30 + t$4, h), I[M] = w$1(40 + t$4, b);
692
- })), s$1.extend(I);
693
- }();
694
- module.exports = w, w.default = w;
695
- }) });
696
-
697
- //#endregion
698
- //#region ../../node_modules/.pnpm/ansis@4.2.0/node_modules/ansis/index.mjs
699
- var import_ansis = /* @__PURE__ */ __toESM(require_ansis(), 1);
700
- var ansis_default = import_ansis.default;
701
- const { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, bold, dim, italic, underline, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = import_ansis.default;
702
-
703
566
  //#endregion
704
567
  //#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.9.3/node_modules/valibot/dist/index.js
705
568
  var store;
@@ -1815,17 +1678,6 @@ const JsxOptionsSchema = strictObject({
1815
1678
  pragmaFrag: pipe(optional(string()), description("Jsx fragment transformation")),
1816
1679
  refresh: pipe(optional(boolean()), description("Enable react fast refresh"))
1817
1680
  });
1818
- const RollupJsxOptionsSchema = strictObject({
1819
- mode: optional(union([
1820
- literal("classic"),
1821
- literal("automatic"),
1822
- literal("preserve")
1823
- ])),
1824
- factory: optional(string()),
1825
- fragment: optional(string()),
1826
- importSource: optional(string()),
1827
- jsxImportSource: optional(string())
1828
- });
1829
1681
  const HelperModeSchema = union([literal("Runtime"), literal("External")]);
1830
1682
  const DecoratorOptionSchema = object({
1831
1683
  legacy: optional(boolean()),
@@ -1862,7 +1714,10 @@ const TransformOptionsSchema = object({
1862
1714
  helpers: optional(HelpersSchema),
1863
1715
  decorators: optional(DecoratorOptionSchema),
1864
1716
  jsx: optional(union([literal("preserve"), JsxOptionsSchema])),
1865
- target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment"))
1717
+ target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment")),
1718
+ define: optional(record(string(), string())),
1719
+ inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
1720
+ dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names"))
1866
1721
  });
1867
1722
  const WatchOptionsSchema = strictObject({
1868
1723
  chokidar: optional(never(`The "watch.chokidar" option is deprecated, please use "watch.notify" instead of it`)),
@@ -1989,11 +1844,11 @@ const InputOptionsSchema = strictObject({
1989
1844
  literal("browser"),
1990
1845
  literal("neutral"),
1991
1846
  literal("node")
1992
- ])), description(`Platform for which the code should be generated (node, ${ansis_default.underline("browser")}, neutral)`)),
1847
+ ])), description(`Platform for which the code should be generated (node, ${styleText("underline", "browser")}, neutral)`)),
1993
1848
  shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
1994
1849
  treeshake: optional(TreeshakingOptionsSchema),
1995
1850
  optimization: optional(OptimizationOptionsSchema),
1996
- logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${ansis_default.dim("silent")}, ${ansis_default.underline(ansis_default.gray("info"))}, debug, ${ansis_default.yellow("warn")})`)),
1851
+ logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${styleText("dim", "silent")}, ${styleText(["underline", "gray"], "info")}, debug, ${styleText("yellow", "warn")})`)),
1997
1852
  onLog: optional(OnLogSchema),
1998
1853
  onwarn: optional(OnwarnSchema),
1999
1854
  moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
@@ -2021,13 +1876,6 @@ const InputOptionsSchema = strictObject({
2021
1876
  define: pipe(optional(record(string(), string())), description("Define global variables")),
2022
1877
  inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
2023
1878
  profilerNames: optional(boolean()),
2024
- jsx: optional(union([
2025
- literal(false),
2026
- literal("react"),
2027
- literal("react-jsx"),
2028
- literal("preserve"),
2029
- RollupJsxOptionsSchema
2030
- ])),
2031
1879
  transform: optional(TransformOptionsSchema),
2032
1880
  watch: optional(union([WatchOptionsSchema, literal(false)])),
2033
1881
  dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names")),
@@ -2048,12 +1896,6 @@ const InputCliOverrideSchema = strictObject({
2048
1896
  inject: pipe(optional(record(string(), string())), description("Inject import statements on demand")),
2049
1897
  treeshake: pipe(optional(boolean()), description("enable treeshaking")),
2050
1898
  makeAbsoluteExternalsRelative: pipe(optional(boolean()), description("Prevent normalization of external imports")),
2051
- jsx: pipe(optional(union([
2052
- literal(false),
2053
- literal("react"),
2054
- literal("react-jsx"),
2055
- literal("preserve")
2056
- ])), description("Jsx options preset")),
2057
1899
  preserveEntrySignatures: pipe(optional(literal(false)), description("Avoid facade chunks for entry points")),
2058
1900
  context: pipe(optional(string()), description("The entity top-level `this` represents."))
2059
1901
  });
@@ -2109,7 +1951,8 @@ const AdvancedChunksSchema = strictObject({
2109
1951
  const GeneratedCodePresetSchema = union([literal("es5"), literal("es2015")]);
2110
1952
  const GeneratedCodeOptionsSchema = strictObject({
2111
1953
  symbols: pipe(optional(boolean()), description("Whether to use Symbol.toStringTag for namespace objects")),
2112
- preset: GeneratedCodePresetSchema
1954
+ preset: GeneratedCodePresetSchema,
1955
+ profilerNames: pipe(optional(boolean()), description("Whether to add readable names to internal variables for profiling purposes"))
2113
1956
  });
2114
1957
  const OutputOptionsSchema = strictObject({
2115
1958
  dir: pipe(optional(string()), description("Output directory, defaults to `dist` if `file` is not set")),
@@ -2119,18 +1962,18 @@ const OutputOptionsSchema = strictObject({
2119
1962
  literal("named"),
2120
1963
  literal("default"),
2121
1964
  literal("none")
2122
- ])), description(`Specify a export mode (${ansis_default.underline("auto")}, named, default, none)`)),
1965
+ ])), description(`Specify a export mode (${styleText("underline", "auto")}, named, default, none)`)),
2123
1966
  hashCharacters: pipe(optional(union([
2124
1967
  literal("base64"),
2125
1968
  literal("base36"),
2126
1969
  literal("hex")
2127
1970
  ])), description("Use the specified character set for file hashes")),
2128
- format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${ansis_default.underline("esm")}, cjs, and iife)`)),
1971
+ format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${styleText("underline", "esm")}, cjs, and iife)`)),
2129
1972
  sourcemap: pipe(optional(union([
2130
1973
  boolean(),
2131
1974
  literal("inline"),
2132
1975
  literal("hidden")
2133
- ])), description(`Generate sourcemap (\`-s inline\` for inline, or ${ansis_default.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
1976
+ ])), description(`Generate sourcemap (\`-s inline\` for inline, or ${styleText("bold", "pass the `-s` on the last argument if you want to generate `.map` file")})`)),
2134
1977
  sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
2135
1978
  sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
2136
1979
  sourcemapIgnoreList: optional(union([
@@ -2175,10 +2018,12 @@ const OutputOptionsSchema = strictObject({
2175
2018
  preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
2176
2019
  virtualDirname: optional(string()),
2177
2020
  minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports")),
2178
- topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`."))
2021
+ topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`.")),
2022
+ cleanDir: pipe(optional(boolean()), description("Clean output directory before emitting output")),
2023
+ keepNames: pipe(optional(boolean()), description("Keep function and class names after bundling"))
2179
2024
  });
2180
2025
  const getAddonDescription = (placement, wrapper) => {
2181
- return `Code to insert the ${ansis_default.bold(placement)} of the bundled file (${ansis_default.bold(wrapper)} the wrapper function)`;
2026
+ return `Code to insert the ${styleText("bold", placement)} of the bundled file (${styleText("bold", wrapper)} the wrapper function)`;
2182
2027
  };
2183
2028
  const OutputCliOverrideSchema = strictObject({
2184
2029
  assetFileNames: pipe(optional(string()), description("Name pattern for asset files")),
@@ -2237,7 +2082,7 @@ function validateOption(key, options) {
2237
2082
  let issueMsg = issue.message;
2238
2083
  const issuePaths = issue.path.map((path$1) => path$1.key);
2239
2084
  if (issue.type === "union") {
2240
- const subIssue = issue.issues?.find((i$1) => !(i$1.type !== issue.received && i$1.input === issue.input));
2085
+ const subIssue = issue.issues?.find((i) => !(i.type !== issue.received && i.input === issue.input));
2241
2086
  if (subIssue) {
2242
2087
  if (subIssue.path) issuePaths.push(subIssue.path.map((path$1) => path$1.key));
2243
2088
  issueMsg = subIssue.message;
@@ -2269,8 +2114,8 @@ function bindingifySourcemap$1(map) {
2269
2114
  file: map.file ?? void 0,
2270
2115
  mappings: map.mappings,
2271
2116
  sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
2272
- sources: map.sources?.map((s$1) => s$1 ?? void 0),
2273
- sourcesContent: map.sourcesContent?.map((s$1) => s$1 ?? void 0),
2117
+ sources: map.sources?.map((s) => s ?? void 0),
2118
+ sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
2274
2119
  names: map.names,
2275
2120
  x_google_ignoreList: map.x_google_ignoreList,
2276
2121
  debugId: "debugId" in map ? map.debugId : void 0
@@ -2287,23 +2132,23 @@ function normalizeBindingResult(container) {
2287
2132
  if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) return aggregateBindingErrorsIntoJsError(container.errors);
2288
2133
  return container;
2289
2134
  }
2290
- function normalizeBindingError(e$2) {
2291
- return e$2.type === "JsError" ? e$2.field0 : Object.assign(/* @__PURE__ */ new Error(), {
2292
- kind: e$2.field0.kind,
2293
- message: e$2.field0.message,
2135
+ function normalizeBindingError(e$1) {
2136
+ return e$1.type === "JsError" ? e$1.field0 : Object.assign(/* @__PURE__ */ new Error(), {
2137
+ kind: e$1.field0.kind,
2138
+ message: e$1.field0.message,
2294
2139
  stack: void 0
2295
2140
  });
2296
2141
  }
2297
2142
  function aggregateBindingErrorsIntoJsError(rawErrors) {
2298
2143
  const errors = rawErrors.map(normalizeBindingError);
2299
2144
  let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
2300
- for (let i$1 = 0; i$1 < errors.length; i$1++) {
2145
+ for (let i = 0; i < errors.length; i++) {
2301
2146
  summary += "\n";
2302
- if (i$1 >= 5) {
2147
+ if (i >= 5) {
2303
2148
  summary += "...";
2304
2149
  break;
2305
2150
  }
2306
- summary += getErrorMessage(errors[i$1]);
2151
+ summary += getErrorMessage(errors[i]);
2307
2152
  }
2308
2153
  const wrapper = new Error(summary);
2309
2154
  Object.defineProperty(wrapper, "errors", {
@@ -2318,25 +2163,25 @@ function aggregateBindingErrorsIntoJsError(rawErrors) {
2318
2163
  });
2319
2164
  return wrapper;
2320
2165
  }
2321
- function getErrorMessage(e$2) {
2322
- if (Object.hasOwn(e$2, "kind")) return e$2.message;
2323
- let s$1 = "";
2324
- if (e$2.plugin) s$1 += `[plugin ${e$2.plugin}]`;
2325
- const id$1 = e$2.id ?? e$2.loc?.file;
2166
+ function getErrorMessage(e$1) {
2167
+ if (Object.hasOwn(e$1, "kind")) return e$1.message;
2168
+ let s = "";
2169
+ if (e$1.plugin) s += `[plugin ${e$1.plugin}]`;
2170
+ const id$1 = e$1.id ?? e$1.loc?.file;
2326
2171
  if (id$1) {
2327
- s$1 += " " + id$1;
2328
- if (e$2.loc) s$1 += `:${e$2.loc.line}:${e$2.loc.column}`;
2172
+ s += " " + id$1;
2173
+ if (e$1.loc) s += `:${e$1.loc.line}:${e$1.loc.column}`;
2329
2174
  }
2330
- if (s$1) s$1 += "\n";
2331
- const message = `${e$2.name ?? "Error"}: ${e$2.message}`;
2332
- s$1 += message;
2333
- if (e$2.frame) s$1 = joinNewLine(s$1, e$2.frame);
2334
- if (e$2.stack) s$1 = joinNewLine(s$1, e$2.stack.replace(message, ""));
2335
- if (e$2.cause) {
2336
- s$1 = joinNewLine(s$1, "Caused by:");
2337
- s$1 = joinNewLine(s$1, getErrorMessage(e$2.cause).split("\n").map((line) => " " + line).join("\n"));
2175
+ if (s) s += "\n";
2176
+ const message = `${e$1.name ?? "Error"}: ${e$1.message}`;
2177
+ s += message;
2178
+ if (e$1.frame) s = joinNewLine(s, e$1.frame);
2179
+ if (e$1.stack) s = joinNewLine(s, e$1.stack.replace(message, ""));
2180
+ if (e$1.cause) {
2181
+ s = joinNewLine(s, "Caused by:");
2182
+ s = joinNewLine(s, getErrorMessage(e$1.cause).split("\n").map((line) => " " + line).join("\n"));
2338
2183
  }
2339
- return s$1;
2184
+ return s;
2340
2185
  }
2341
2186
  function joinNewLine(s1, s2) {
2342
2187
  return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
@@ -2380,42 +2225,42 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
2380
2225
 
2381
2226
  //#endregion
2382
2227
  //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
2383
- function e(e$2, t$3, n$2) {
2384
- let r$1 = (n$3) => e$2(n$3, ...t$3);
2385
- return n$2 === void 0 ? r$1 : Object.assign(r$1, {
2386
- lazy: n$2,
2387
- lazyArgs: t$3
2228
+ function e(e$1, t$2, n$1) {
2229
+ let r = (n$2) => e$1(n$2, ...t$2);
2230
+ return n$1 === void 0 ? r : Object.assign(r, {
2231
+ lazy: n$1,
2232
+ lazyArgs: t$2
2388
2233
  });
2389
2234
  }
2390
2235
 
2391
2236
  //#endregion
2392
2237
  //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js
2393
- function t(t$3, n$2, r$1) {
2394
- let i$1 = t$3.length - n$2.length;
2395
- if (i$1 === 0) return t$3(...n$2);
2396
- if (i$1 === 1) return e(t$3, n$2, r$1);
2238
+ function t(t$2, n$1, r) {
2239
+ let i = t$2.length - n$1.length;
2240
+ if (i === 0) return t$2(...n$1);
2241
+ if (i === 1) return e(t$2, n$1, r);
2397
2242
  throw Error(`Wrong number of arguments`);
2398
2243
  }
2399
2244
 
2400
2245
  //#endregion
2401
2246
  //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/partition-DAu403JQ.js
2402
- function t$1(...t$3) {
2403
- return t(n, t$3);
2247
+ function t$1(...t$2) {
2248
+ return t(n, t$2);
2404
2249
  }
2405
- const n = (e$2, t$3) => {
2406
- let n$2 = [[], []];
2407
- for (let [r$1, i$1] of e$2.entries()) t$3(i$1, r$1, e$2) ? n$2[0].push(i$1) : n$2[1].push(i$1);
2408
- return n$2;
2250
+ const n = (e$1, t$2) => {
2251
+ let n$1 = [[], []];
2252
+ for (let [r, i] of e$1.entries()) t$2(i, r, e$1) ? n$1[0].push(i) : n$1[1].push(i);
2253
+ return n$1;
2409
2254
  };
2410
2255
 
2411
2256
  //#endregion
2412
2257
  //#region src/plugin/bindingify-hook-filter.ts
2413
2258
  function generalHookFilterMatcherToFilterExprs(matcher, stringKind) {
2414
2259
  if (typeof matcher === "string" || matcher instanceof RegExp) return [include(generateAtomMatcher(stringKind, matcher))];
2415
- if (Array.isArray(matcher)) return matcher.map((m$1) => include(generateAtomMatcher(stringKind, m$1)));
2260
+ if (Array.isArray(matcher)) return matcher.map((m) => include(generateAtomMatcher(stringKind, m)));
2416
2261
  let ret = [];
2417
- if (matcher.exclude) ret.push(...arraify(matcher.exclude).map((m$1) => exclude(generateAtomMatcher(stringKind, m$1))));
2418
- if (matcher.include) ret.push(...arraify(matcher.include).map((m$1) => include(generateAtomMatcher(stringKind, m$1))));
2262
+ if (matcher.exclude) ret.push(...arraify(matcher.exclude).map((m) => exclude(generateAtomMatcher(stringKind, m))));
2263
+ if (matcher.include) ret.push(...arraify(matcher.include).map((m) => include(generateAtomMatcher(stringKind, m))));
2419
2264
  return ret;
2420
2265
  }
2421
2266
  function generateAtomMatcher(kind, matcher) {
@@ -2430,14 +2275,14 @@ function transformFilterMatcherToFilterExprs(filterOption) {
2430
2275
  let idExcludes = [];
2431
2276
  let codeIncludes = [];
2432
2277
  let codeExcludes = [];
2433
- if (id$1) [idIncludes, idExcludes] = t$1(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m$1) => m$1.kind === "include");
2434
- if (code$1) [codeIncludes, codeExcludes] = t$1(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m$1) => m$1.kind === "include");
2278
+ if (id$1) [idIncludes, idExcludes] = t$1(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m) => m.kind === "include");
2279
+ if (code$1) [codeIncludes, codeExcludes] = t$1(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m) => m.kind === "include");
2435
2280
  ret.push(...idExcludes);
2436
2281
  ret.push(...codeExcludes);
2437
2282
  let andExprList = [];
2438
2283
  if (moduleType$1) {
2439
2284
  let moduleTypes = Array.isArray(moduleType$1) ? moduleType$1 : moduleType$1.include ?? [];
2440
- andExprList.push(or(...moduleTypes.map((m$1) => moduleType(m$1))));
2285
+ andExprList.push(or(...moduleTypes.map((m) => moduleType(m))));
2441
2286
  }
2442
2287
  if (idIncludes.length) andExprList.push(or(...idIncludes.map((item) => item.expr)));
2443
2288
  if (codeIncludes.length) andExprList.push(or(...codeIncludes.map((item) => item.expr)));
@@ -2459,7 +2304,7 @@ function bindingifyFilterExprImpl(expr, list) {
2459
2304
  switch (expr.kind) {
2460
2305
  case "and": {
2461
2306
  let args$1 = expr.args;
2462
- for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
2307
+ for (let i = args$1.length - 1; i >= 0; i--) bindingifyFilterExprImpl(args$1[i], list);
2463
2308
  list.push({
2464
2309
  kind: "And",
2465
2310
  payload: args$1.length
@@ -2468,7 +2313,7 @@ function bindingifyFilterExprImpl(expr, list) {
2468
2313
  }
2469
2314
  case "or": {
2470
2315
  let args$1 = expr.args;
2471
- for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
2316
+ for (let i = args$1.length - 1; i >= 0; i--) bindingifyFilterExprImpl(args$1[i], list);
2472
2317
  list.push({
2473
2318
  kind: "Or",
2474
2319
  payload: args$1.length
@@ -2700,12 +2545,12 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
2700
2545
  this.warn = getLogHandler$1(this.warn);
2701
2546
  this.info = getLogHandler$1(this.info);
2702
2547
  }
2703
- error(e$2, pos) {
2704
- if (typeof e$2 === "string") e$2 = { message: e$2 };
2705
- if (pos) augmentCodeLocation(e$2, pos, this.moduleSource, this.moduleId);
2706
- e$2.id = this.moduleId;
2707
- e$2.hook = "transform";
2708
- return error(logPluginError(normalizeLog(e$2), this.pluginName));
2548
+ error(e$1, pos) {
2549
+ if (typeof e$1 === "string") e$1 = { message: e$1 };
2550
+ if (pos) augmentCodeLocation(e$1, pos, this.moduleSource, this.moduleId);
2551
+ e$1.id = this.moduleId;
2552
+ e$1.hook = "transform";
2553
+ return error(logPluginError(normalizeLog(e$1), this.pluginName));
2709
2554
  }
2710
2555
  getCombinedSourcemap() {
2711
2556
  return JSON.parse(this.inner.getCombinedSourcemap());
@@ -2713,8 +2558,8 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
2713
2558
  addWatchFile(id$1) {
2714
2559
  this.inner.addWatchFile(id$1);
2715
2560
  }
2716
- sendMagicString(s$1) {
2717
- this.inner.sendMagicString(s$1);
2561
+ sendMagicString(s) {
2562
+ this.inner.sendMagicString(s);
2718
2563
  }
2719
2564
  };
2720
2565
 
@@ -2970,9 +2815,9 @@ function transformRenderedChunk(chunk) {
2970
2815
  }
2971
2816
  function transformChunkModules(modules) {
2972
2817
  const result = {};
2973
- for (let i$1 = 0; i$1 < modules.values.length; i$1++) {
2974
- let key = modules.keys[i$1];
2975
- const mod = modules.values[i$1];
2818
+ for (let i = 0; i < modules.values.length; i++) {
2819
+ let key = modules.keys[i];
2820
+ const mod = modules.values[i];
2976
2821
  result[key] = transformToRenderedModule(mod);
2977
2822
  }
2978
2823
  return result;
@@ -3024,20 +2869,20 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
3024
2869
  };
3025
2870
  const cache = {};
3026
2871
  return new Proxy(chunk, {
3027
- get(target, p$1) {
3028
- if (p$1 in cache) return cache[p$1];
3029
- const value = target[p$1];
3030
- cache[p$1] = value;
2872
+ get(target, p) {
2873
+ if (p in cache) return cache[p];
2874
+ const value = target[p];
2875
+ cache[p] = value;
3031
2876
  return value;
3032
2877
  },
3033
- set(_target, p$1, newValue) {
3034
- cache[p$1] = newValue;
2878
+ set(_target, p, newValue) {
2879
+ cache[p] = newValue;
3035
2880
  changed?.updated.add(bindingChunk.fileName);
3036
2881
  return true;
3037
2882
  },
3038
- has(target, p$1) {
3039
- if (p$1 in cache) return true;
3040
- return p$1 in target;
2883
+ has(target, p) {
2884
+ if (p in cache) return true;
2885
+ return p in target;
3041
2886
  }
3042
2887
  });
3043
2888
  }
@@ -3055,14 +2900,14 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
3055
2900
  };
3056
2901
  const cache = {};
3057
2902
  return new Proxy(asset, {
3058
- get(target, p$1) {
3059
- if (p$1 in cache) return cache[p$1];
3060
- const value = target[p$1];
3061
- cache[p$1] = value;
2903
+ get(target, p) {
2904
+ if (p in cache) return cache[p];
2905
+ const value = target[p];
2906
+ cache[p] = value;
3062
2907
  return value;
3063
2908
  },
3064
- set(_target, p$1, newValue) {
3065
- cache[p$1] = newValue;
2909
+ set(_target, p, newValue) {
2910
+ cache[p] = newValue;
3066
2911
  changed?.updated.add(bindingAsset.fileName);
3067
2912
  return true;
3068
2913
  }
@@ -3474,8 +3319,8 @@ function wrapHandlers(plugin) {
3474
3319
  if (handler) plugin[hookName] = async (...args$1) => {
3475
3320
  try {
3476
3321
  return await handler(...args$1);
3477
- } catch (e$2) {
3478
- return error(logPluginError(e$2, plugin.name, {
3322
+ } catch (e$1) {
3323
+ return error(logPluginError(e$1, plugin.name, {
3479
3324
  hook: hookName,
3480
3325
  id: hookName === "transform" ? args$1[2] : void 0
3481
3326
  }));
@@ -3746,6 +3591,49 @@ function isReadonlyArray(input) {
3746
3591
  return Array.isArray(input);
3747
3592
  }
3748
3593
 
3594
+ //#endregion
3595
+ //#region src/utils/normalize-transform-options.ts
3596
+ /**
3597
+ * Normalizes transform options by extracting `define`, `inject`, and `dropLabels` separately from OXC transform options.
3598
+ *
3599
+ * Prioritizes values from `transform.define`, `transform.inject`, and `transform.dropLabels` over deprecated top-level options.
3600
+ */
3601
+ function normalizeTransformOptions(inputOptions, onLog) {
3602
+ const transform = inputOptions.transform;
3603
+ let define;
3604
+ if (transform?.define) define = Object.entries(transform.define);
3605
+ else if (inputOptions.define) {
3606
+ onLog(LOG_LEVEL_WARN, logDeprecatedDefine());
3607
+ define = Object.entries(inputOptions.define);
3608
+ }
3609
+ let inject;
3610
+ if (transform?.inject) inject = transform.inject;
3611
+ else if (inputOptions.inject) {
3612
+ onLog(LOG_LEVEL_WARN, logDeprecatedInject());
3613
+ inject = inputOptions.inject;
3614
+ }
3615
+ let dropLabels;
3616
+ if (transform?.dropLabels) dropLabels = transform.dropLabels;
3617
+ else if (inputOptions.dropLabels) {
3618
+ onLog(LOG_LEVEL_WARN, logDeprecatedDropLabels());
3619
+ dropLabels = inputOptions.dropLabels;
3620
+ }
3621
+ let oxcTransformOptions;
3622
+ if (transform) {
3623
+ const { define: _define, inject: _inject, dropLabels: _dropLabels,...rest } = transform;
3624
+ if (Object.keys(rest).length > 0) {
3625
+ if (rest.jsx === false) rest.jsx = "disable";
3626
+ oxcTransformOptions = rest;
3627
+ }
3628
+ }
3629
+ return {
3630
+ define,
3631
+ inject,
3632
+ dropLabels,
3633
+ oxcTransformOptions
3634
+ };
3635
+ }
3636
+
3749
3637
  //#endregion
3750
3638
  //#region src/utils/bindingify-input-options.ts
3751
3639
  function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
@@ -3755,7 +3643,19 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3755
3643
  if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
3756
3644
  return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
3757
3645
  });
3758
- const { jsx, transform } = bindingifyJsx(onLog, inputOptions.jsx, inputOptions.transform);
3646
+ const normalizedTransform = normalizeTransformOptions(inputOptions, onLog);
3647
+ let profilerNames;
3648
+ if (outputOptions.generatedCode?.profilerNames !== void 0) profilerNames = outputOptions.generatedCode.profilerNames;
3649
+ else if (inputOptions.profilerNames !== void 0) {
3650
+ onLog(LOG_LEVEL_WARN, logDeprecatedProfilerNames());
3651
+ profilerNames = inputOptions.profilerNames;
3652
+ }
3653
+ let keepNames;
3654
+ if (outputOptions.keepNames !== void 0) keepNames = outputOptions.keepNames;
3655
+ else if (inputOptions.keepNames !== void 0) {
3656
+ onLog(LOG_LEVEL_WARN, logDeprecatedKeepNames());
3657
+ keepNames = inputOptions.keepNames;
3658
+ }
3759
3659
  return {
3760
3660
  input: bindingifyInput(inputOptions.input),
3761
3661
  plugins,
@@ -3768,15 +3668,14 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3768
3668
  onLog: async (level, log) => onLog(level, log),
3769
3669
  treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
3770
3670
  moduleTypes: inputOptions.moduleTypes,
3771
- define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
3772
- inject: bindingifyInject(inputOptions.inject),
3671
+ define: normalizedTransform.define,
3672
+ inject: bindingifyInject(normalizedTransform.inject),
3773
3673
  experimental: bindingifyExperimental(inputOptions.experimental),
3774
- profilerNames: inputOptions?.profilerNames,
3775
- jsx,
3776
- transform,
3674
+ profilerNames,
3675
+ transform: normalizedTransform.oxcTransformOptions,
3777
3676
  watch: bindingifyWatch(inputOptions.watch),
3778
- dropLabels: inputOptions.dropLabels,
3779
- keepNames: inputOptions.keepNames,
3677
+ dropLabels: normalizedTransform.dropLabels,
3678
+ keepNames,
3780
3679
  checks: inputOptions.checks,
3781
3680
  deferSyncScanData: () => {
3782
3681
  let ret = [];
@@ -3905,46 +3804,6 @@ function bindingifyInput(input) {
3905
3804
  };
3906
3805
  });
3907
3806
  }
3908
- function bindingifyJsx(onLog, input, transform) {
3909
- if (transform?.jsx) {
3910
- if (input !== void 0) onLog(LOG_LEVEL_WARN, logDuplicateJsxConfig());
3911
- return { transform };
3912
- }
3913
- if (typeof input === "object") {
3914
- if (input.mode === "preserve") return {
3915
- jsx: BindingJsx.Preserve,
3916
- transform
3917
- };
3918
- const mode = input.mode ?? "automatic";
3919
- transform ??= {};
3920
- transform.jsx = {
3921
- runtime: mode,
3922
- pragma: input.factory,
3923
- pragmaFrag: input.fragment,
3924
- importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0
3925
- };
3926
- return { transform };
3927
- }
3928
- let jsx;
3929
- switch (input) {
3930
- case false:
3931
- jsx = BindingJsx.Disable;
3932
- break;
3933
- case "react":
3934
- jsx = BindingJsx.React;
3935
- break;
3936
- case "react-jsx":
3937
- jsx = BindingJsx.ReactJsx;
3938
- break;
3939
- case "preserve":
3940
- jsx = BindingJsx.Preserve;
3941
- break;
3942
- }
3943
- return {
3944
- jsx,
3945
- transform
3946
- };
3947
- }
3948
3807
  function bindingifyWatch(watch$1) {
3949
3808
  if (watch$1) return {
3950
3809
  buildDelay: watch$1.buildDelay,
@@ -4031,7 +3890,7 @@ var ChunkingContextImpl = class {
4031
3890
  //#endregion
4032
3891
  //#region src/utils/bindingify-output-options.ts
4033
3892
  function bindingifyOutputOptions(outputOptions) {
4034
- const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
3893
+ const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir } = outputOptions;
4035
3894
  const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
4036
3895
  return {
4037
3896
  dir,
@@ -4071,7 +3930,8 @@ function bindingifyOutputOptions(outputOptions) {
4071
3930
  legalComments,
4072
3931
  preserveModulesRoot,
4073
3932
  topLevelVar,
4074
- minifyInternalExports: outputOptions.minifyInternalExports
3933
+ minifyInternalExports: outputOptions.minifyInternalExports,
3934
+ cleanDir
4075
3935
  };
4076
3936
  }
4077
3937
  function bindingifyAddon(configAddon) {
@@ -4161,7 +4021,7 @@ async function initializeParallelPlugins(plugins) {
4161
4021
  };
4162
4022
  }
4163
4023
  function initializeWorkers(registryId, count, pluginInfos) {
4164
- return Promise.all(Array.from({ length: count }, (_, i$1) => initializeWorker(registryId, pluginInfos, i$1)));
4024
+ return Promise.all(Array.from({ length: count }, (_, i) => initializeWorker(registryId, pluginInfos, i)));
4165
4025
  }
4166
4026
  async function initializeWorker(registryId, pluginInfos, threadNumber) {
4167
4027
  const urlString = import.meta.resolve("#parallel-plugin-worker");
@@ -4181,9 +4041,9 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
4181
4041
  });
4182
4042
  });
4183
4043
  return worker;
4184
- } catch (e$2) {
4044
+ } catch (e$1) {
4185
4045
  worker?.terminate();
4186
- throw e$2;
4046
+ throw e$1;
4187
4047
  }
4188
4048
  }
4189
4049
  const availableParallelism = () => {
@@ -4219,9 +4079,9 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
4219
4079
  onLog,
4220
4080
  stopWorkers: parallelPluginInitResult?.stopWorkers
4221
4081
  };
4222
- } catch (e$2) {
4082
+ } catch (e$1) {
4223
4083
  await parallelPluginInitResult?.stopWorkers();
4224
- throw e$2;
4084
+ throw e$1;
4225
4085
  }
4226
4086
  }
4227
4087
 
@@ -4253,9 +4113,9 @@ var RolldownBuild = class RolldownBuild {
4253
4113
  RolldownBuild.asyncRuntimeShutdown = true;
4254
4114
  }
4255
4115
  };
4256
- } catch (e$2) {
4116
+ } catch (e$1) {
4257
4117
  await option.stopWorkers?.();
4258
- throw e$2;
4118
+ throw e$1;
4259
4119
  }
4260
4120
  }
4261
4121
  async scan() {
@@ -4451,4 +4311,4 @@ function defineConfig(config) {
4451
4311
  const VERSION = version;
4452
4312
 
4453
4313
  //#endregion
4454
- export { BindingMagicString$1 as BindingMagicString, BuiltinPlugin, PluginContextData, PluginDriver, RolldownBuild, VERSION, ansis_default, bindingifyPlugin, build, createBundlerOptions, defineConfig, description$1 as description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, makeBuiltinPluginCallable, normalizeBindingResult, normalizedStringOrRegex, onExit, rolldown, validateCliOptions, version, watch };
4314
+ export { version as C, description$1 as S, getOutputCliKeys as _, build as a, BuiltinPlugin as b, createBundlerOptions as c, bindingifyPlugin as d, transformToRollupOutput as f, getInputCliKeys as g, getCliSchemaInfo as h, watch as i, normalizedStringOrRegex as l, bindingifySourcemap$1 as m, VERSION as n, rolldown as o, normalizeBindingResult as p, defineConfig as r, RolldownBuild as s, BindingMagicString$1 as t, PluginContextData as u, validateCliOptions as v, onExit as w, makeBuiltinPluginCallable as x, PluginDriver as y };