@rolldown/browser 1.0.0-beta.31-commit.832324a → 1.0.0-beta.33

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 (43) hide show
  1. package/dist/cli.cjs +31 -31
  2. package/dist/cli.d.cts +1 -1
  3. package/dist/cli.d.mts +1 -1
  4. package/dist/cli.mjs +33 -32
  5. package/dist/config.cjs +3 -3
  6. package/dist/config.d.cts +2 -2
  7. package/dist/config.d.mts +2 -2
  8. package/dist/config.mjs +3 -3
  9. package/dist/experimental-index.browser.mjs +1 -1
  10. package/dist/experimental-index.cjs +2 -2
  11. package/dist/experimental-index.d.cts +2 -2
  12. package/dist/experimental-index.d.mts +2 -2
  13. package/dist/experimental-index.mjs +2 -2
  14. package/dist/filter-index.d.cts +2 -2
  15. package/dist/filter-index.d.mts +2 -2
  16. package/dist/index.browser.mjs +1 -1
  17. package/dist/index.cjs +2 -2
  18. package/dist/index.d.cts +2 -2
  19. package/dist/index.d.mts +2 -2
  20. package/dist/index.mjs +2 -2
  21. package/dist/parallel-plugin-worker.cjs +2 -2
  22. package/dist/parallel-plugin-worker.d.cts +1 -1
  23. package/dist/parallel-plugin-worker.d.mts +1 -1
  24. package/dist/parallel-plugin-worker.mjs +4 -3
  25. package/dist/parallel-plugin.d.cts +2 -2
  26. package/dist/parallel-plugin.d.mts +2 -2
  27. package/dist/parse-ast-index.cjs +1 -1
  28. package/dist/parse-ast-index.d.cts +1 -1
  29. package/dist/parse-ast-index.d.mts +1 -1
  30. package/dist/parse-ast-index.mjs +1 -1
  31. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  32. package/dist/shared/{binding-BIqlUgrm.d.cts → binding-CFhvYkVn.d.mts} +4 -3
  33. package/dist/shared/{binding-COE5UL-B.d.mts → binding-DQk9TN_A.d.cts} +4 -3
  34. package/dist/shared/{define-config-DFC0Nu7H.d.cts → define-config-B3QOs3Kt.d.cts} +7 -1
  35. package/dist/shared/{define-config-Cf2D2abn.d.mts → define-config-DyjJkNqG.d.mts} +7 -1
  36. package/dist/shared/{load-config-CoJFc3w2.mjs → load-config-CLPLfZVe.mjs} +1 -1
  37. package/dist/shared/{load-config-Dw0YNzS-.cjs → load-config-xKQFLlGV.cjs} +1 -1
  38. package/dist/shared/{parse-ast-index-CqHkFxPM.mjs → parse-ast-index-BGzB5Bo-.mjs} +1 -1
  39. package/dist/shared/{parse-ast-index-DAsDnaa1.cjs → parse-ast-index-BZfwAN9P.cjs} +1 -1
  40. package/dist/shared/{src-DEIlKgUM.cjs → src-CGziNJPr.cjs} +145 -141
  41. package/dist/shared/{src-38thNb51.mjs → src-CZgQg1yE.mjs} +142 -138
  42. package/dist/{src-jf6KDQ1I.js → src-D_htlJ_o.js} +252 -248
  43. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-CqHkFxPM.mjs";
1
+ import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-BGzB5Bo-.mjs";
2
2
  import { and, arraify, code, exclude, id, include, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-ByKQkexh.mjs";
3
3
  import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
4
4
  import path from "node:path";
@@ -18,8 +18,8 @@ var __commonJS = (cb, mod) => function() {
18
18
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
19
  };
20
20
  var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i$2 = 0, n$1 = keys.length, key; i$2 < n$1; i$2++) {
22
- key = keys[i$2];
21
+ 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++) {
22
+ key = keys[i$1];
23
23
  if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
24
24
  get: ((k) => from[k]).bind(null, key),
25
25
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
@@ -34,7 +34,7 @@ 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.31-commit.832324a";
37
+ var version = "1.0.0-beta.33";
38
38
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
39
39
 
40
40
  //#endregion
@@ -56,9 +56,9 @@ function makeBuiltinPluginCallable(plugin) {
56
56
  for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
57
57
  try {
58
58
  return await callablePlugin[key](...args$1);
59
- } catch (e$1) {
60
- if (e$1 instanceof Error && !e$1.stack?.includes("at ")) Error.captureStackTrace(e$1, wrappedPlugin[key]);
61
- return error(logPluginError(e$1, plugin.name, {
59
+ } catch (e$2) {
60
+ if (e$2 instanceof Error && !e$2.stack?.includes("at ")) Error.captureStackTrace(e$2, wrappedPlugin[key]);
61
+ return error(logPluginError(e$2, plugin.name, {
62
62
  hook: key,
63
63
  id: key === "transform" ? args$1[2] : void 0
64
64
  }));
@@ -377,8 +377,8 @@ var MinimalPluginContextImpl = class {
377
377
  watchMode
378
378
  };
379
379
  }
380
- error(e$1) {
381
- return error(logPluginError(normalizeLog(e$1), this.pluginName, { hook: this.hookName }));
380
+ error(e$2) {
381
+ return error(logPluginError(normalizeLog(e$2), this.pluginName, { hook: this.hookName }));
382
382
  }
383
383
  };
384
384
 
@@ -1833,22 +1833,22 @@ function toJsonSchema(schema, config) {
1833
1833
  //#endregion
1834
1834
  //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs
1835
1835
  var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs": ((exports, module) => {
1836
- let e, t, r, { defineProperty: n, setPrototypeOf: l, create: o, keys: s } = Object, i$1 = "", { round: c, max: a$1 } = Math, p = (e$1) => {
1837
- let t$1 = /([a-f\d]{3,6})/i.exec(e$1)?.[1], r$1 = t$1?.length, n$1 = parseInt(6 ^ r$1 ? 3 ^ r$1 ? "0" : t$1[0] + t$1[0] + t$1[1] + t$1[1] + t$1[2] + t$1[2] : t$1, 16);
1836
+ let e$1, t$2, r, { defineProperty: n$1, setPrototypeOf: l, create: o, keys: s } = Object, i = "", { round: c, max: a$1 } = Math, p = (e$2) => {
1837
+ let t$3 = /([a-f\d]{3,6})/i.exec(e$2)?.[1], r$1 = t$3?.length, n$2 = 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);
1838
1838
  return [
1839
- n$1 >> 16 & 255,
1840
- n$1 >> 8 & 255,
1841
- 255 & n$1
1839
+ n$2 >> 16 & 255,
1840
+ n$2 >> 8 & 255,
1841
+ 255 & n$2
1842
1842
  ];
1843
- }, u$2 = (e$1, t$1, r$1) => e$1 ^ t$1 || t$1 ^ r$1 ? 16 + 36 * c(e$1 / 51) + 6 * c(t$1 / 51) + c(r$1 / 51) : 8 > e$1 ? 16 : e$1 > 248 ? 231 : c(24 * (e$1 - 8) / 247) + 232, d$1 = (e$1) => {
1844
- let t$1, r$1, n$1, l$1, o$1;
1845
- return 8 > e$1 ? 30 + e$1 : 16 > e$1 ? e$1 - 8 + 90 : (232 > e$1 ? (o$1 = (e$1 -= 16) % 36, t$1 = (e$1 / 36 | 0) / 5, r$1 = (o$1 / 6 | 0) / 5, n$1 = o$1 % 6 / 5) : t$1 = r$1 = n$1 = (10 * (e$1 - 232) + 8) / 255, l$1 = 2 * a$1(t$1, r$1, n$1), l$1 ? 30 + (c(n$1) << 2 | c(r$1) << 1 | c(t$1)) + (2 ^ l$1 ? 0 : 60) : 30);
1843
+ }, 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) => {
1844
+ let t$3, r$1, n$2, l$1, o$1;
1845
+ 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, n$2 = o$1 % 6 / 5) : t$3 = r$1 = n$2 = (10 * (e$2 - 232) + 8) / 255, l$1 = 2 * a$1(t$3, r$1, n$2), l$1 ? 30 + (c(n$2) << 2 | c(r$1) << 1 | c(t$3)) + (2 ^ l$1 ? 0 : 60) : 30);
1846
1846
  }, g = (() => {
1847
- let r$1 = (e$1) => o$1.some(((t$1) => e$1.test(t$1))), n$1 = globalThis, l$1 = n$1.process ?? {}, o$1 = l$1.argv ?? [], i$2 = l$1.env ?? {}, c$1 = -1;
1847
+ let r$1 = (e$2) => o$1.some(((t$3) => e$2.test(t$3))), n$2 = globalThis, l$1 = n$2.process ?? {}, o$1 = l$1.argv ?? [], i$1 = l$1.env ?? {}, c$1 = -1;
1848
1848
  try {
1849
- e = "," + s(i$2).join(",");
1850
- } catch (e$1) {
1851
- i$2 = {}, c$1 = 0;
1849
+ e$1 = "," + s(i$1).join(",");
1850
+ } catch (e$2) {
1851
+ i$1 = {}, c$1 = 0;
1852
1852
  }
1853
1853
  let a$2 = "FORCE_COLOR", p$1 = {
1854
1854
  false: 0,
@@ -1856,61 +1856,61 @@ var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis
1856
1856
  1: 1,
1857
1857
  2: 2,
1858
1858
  3: 3
1859
- }[i$2[a$2]] ?? -1, u$3 = a$2 in i$2 && p$1 || r$1(/^--color=?(true|always)?$/);
1860
- return u$3 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, n$2, l$2) => (t = r$2.TERM, {
1859
+ }[i$1[a$2]] ?? -1, u$1 = a$2 in i$1 && p$1 || r$1(/^--color=?(true|always)?$/);
1860
+ return u$1 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, n$3, l$2) => (t$2 = r$2.TERM, {
1861
1861
  "24bit": 3,
1862
1862
  truecolor: 3,
1863
1863
  ansi256: 2,
1864
1864
  ansi: 1
1865
- }[r$2.COLORTERM] || (r$2.CI ? /,GITHUB/.test(e) ? 3 : 1 : n$2 && "dumb" !== t ? l$2 ? 3 : /-256/.test(t) ? 2 : 1 : 0)))(i$2, !!i$2.PM2_HOME || i$2.NEXT_RUNTIME?.includes("edge") || !!l$1.stdout?.isTTY, "win32" === l$1.platform)), !p$1 || i$2.NO_COLOR || r$1(/^--(no-color|color=(false|never))$/) ? 0 : n$1.window?.chrome || u$3 && !c$1 ? 3 : c$1;
1865
+ }[r$2.COLORTERM] || (r$2.CI ? /,GITHUB/.test(e$1) ? 3 : 1 : n$3 && "dumb" !== t$2 ? l$2 ? 3 : /-256/.test(t$2) ? 2 : 1 : 0)))(i$1, !!i$1.PM2_HOME || i$1.NEXT_RUNTIME?.includes("edge") || !!l$1.stdout?.isTTY, "win32" === l$1.platform)), !p$1 || i$1.NO_COLOR || r$1(/^--(no-color|color=(false|never))$/) ? 0 : n$2.window?.chrome || u$1 && !c$1 ? 3 : c$1;
1866
1866
  })(), f = {
1867
- open: i$1,
1868
- close: i$1
1869
- }, h = 39, b = 49, O = {}, m = ({ p: e$1 }, { open: t$1, close: n$1 }) => {
1870
- let o$1 = (e$2, ...r$1) => {
1871
- if (!e$2) {
1872
- if (t$1 && t$1 === n$1) return t$1;
1873
- if ((e$2 ?? i$1) === i$1) return i$1;
1867
+ open: i,
1868
+ close: i
1869
+ }, h = 39, b = 49, O = {}, m = ({ p: e$2 }, { open: t$3, close: n$2 }) => {
1870
+ let o$1 = (e$3, ...r$1) => {
1871
+ if (!e$3) {
1872
+ if (t$3 && t$3 === n$2) return t$3;
1873
+ if ((e$3 ?? i) === i) return i;
1874
1874
  }
1875
- let l$1, s$2 = e$2.raw ? String.raw({ raw: e$2 }, ...r$1) : i$1 + e$2, c$2 = o$1.p, a$2 = c$2.o, p$1 = c$2.c;
1875
+ let l$1, 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;
1876
1876
  if (s$2.includes("\x1B")) for (; c$2; c$2 = c$2.p) {
1877
- let { open: e$3, close: t$2 } = c$2, r$2 = t$2.length, n$2 = i$1, o$2 = 0;
1878
- if (r$2) for (; ~(l$1 = s$2.indexOf(t$2, o$2)); o$2 = l$1 + r$2) n$2 += s$2.slice(o$2, l$1) + e$3;
1879
- s$2 = n$2 + s$2.slice(o$2);
1877
+ let { open: e$4, close: t$4 } = c$2, r$2 = t$4.length, n$3 = i, o$2 = 0;
1878
+ if (r$2) for (; ~(l$1 = s$2.indexOf(t$4, o$2)); o$2 = l$1 + r$2) n$3 += s$2.slice(o$2, l$1) + e$4;
1879
+ s$2 = n$3 + s$2.slice(o$2);
1880
1880
  }
1881
1881
  return a$2 + (s$2.includes("\n") ? s$2.replace(/(\r?\n)/g, p$1 + "$1" + a$2) : s$2) + p$1;
1882
- }, s$1 = t$1, c$1 = n$1;
1883
- return e$1 && (s$1 = e$1.o + t$1, c$1 = n$1 + e$1.c), l(o$1, r), o$1.p = {
1884
- open: t$1,
1885
- close: n$1,
1882
+ }, s$1 = t$3, c$1 = n$2;
1883
+ return e$2 && (s$1 = e$2.o + t$3, c$1 = n$2 + e$2.c), l(o$1, r), o$1.p = {
1884
+ open: t$3,
1885
+ close: n$2,
1886
1886
  o: s$1,
1887
1887
  c: c$1,
1888
- p: e$1
1888
+ p: e$2
1889
1889
  }, o$1.open = s$1, o$1.close = c$1, o$1;
1890
1890
  };
1891
- const w = function(e$1 = g) {
1892
- let t$1 = {
1891
+ const w = function(e$2 = g) {
1892
+ let t$3 = {
1893
1893
  Ansis: w,
1894
- level: e$1,
1894
+ level: e$2,
1895
1895
  isSupported: () => s$1,
1896
- strip: (e$2) => e$2.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i$1),
1897
- extend(e$2) {
1898
- for (let t$2 in e$2) {
1899
- let r$1 = e$2[t$2], l$1 = (typeof r$1)[0], o$1 = "s" === l$1 ? x(...p(r$1)) : r$1;
1900
- O[t$2] = "f" === l$1 ? { get() {
1901
- return (...e$3) => m(this, r$1(...e$3));
1896
+ strip: (e$3) => e$3.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
1897
+ extend(e$3) {
1898
+ for (let t$4 in e$3) {
1899
+ let r$1 = e$3[t$4], l$1 = (typeof r$1)[0], o$1 = "s" === l$1 ? x(...p(r$1)) : r$1;
1900
+ O[t$4] = "f" === l$1 ? { get() {
1901
+ return (...e$4) => m(this, r$1(...e$4));
1902
1902
  } } : { get() {
1903
- let e$3 = m(this, o$1);
1904
- return n(this, t$2, { value: e$3 }), e$3;
1903
+ let e$4 = m(this, o$1);
1904
+ return n$1(this, t$4, { value: e$4 }), e$4;
1905
1905
  } };
1906
1906
  }
1907
- return r = o({}, O), l(t$1, r), t$1;
1907
+ return r = o({}, O), l(t$3, r), t$3;
1908
1908
  }
1909
- }, s$1 = e$1 > 0, c$1 = (e$2, t$2) => s$1 ? {
1910
- open: `[${e$2}m`,
1911
- close: `[${t$2}m`
1912
- } : f, a$2 = (e$2) => (t$2) => e$2(...p(t$2)), y$1 = (e$2, t$2) => (r$1, n$1, l$1) => c$1(`${e$2}8;2;${r$1};${n$1};${l$1}`, t$2), R = (e$2, t$2) => (r$1, n$1, l$1) => c$1(((e$3, t$3, r$2) => d$1(u$2(e$3, t$3, r$2)))(r$1, n$1, l$1) + e$2, t$2), $ = (e$2) => (t$2, r$1, n$1) => e$2(u$2(t$2, r$1, n$1)), x = y$1(3, h), T = y$1(4, b), v = (e$2) => c$1("38;5;" + e$2, h), C = (e$2) => c$1("48;5;" + e$2, b);
1913
- 2 === e$1 ? (x = $(v), T = $(C)) : 1 === e$1 && (x = R(0, h), T = R(10, b), v = (e$2) => c$1(d$1(e$2), h), C = (e$2) => c$1(d$1(e$2) + 10, b));
1909
+ }, s$1 = e$2 > 0, c$1 = (e$3, t$4) => s$1 ? {
1910
+ open: `[${e$3}m`,
1911
+ close: `[${t$4}m`
1912
+ } : f, a$2 = (e$3) => (t$4) => e$3(...p(t$4)), y$1 = (e$3, t$4) => (r$1, n$2, l$1) => c$1(`${e$3}8;2;${r$1};${n$2};${l$1}`, t$4), R = (e$3, t$4) => (r$1, n$2, l$1) => c$1(((e$4, t$5, r$2) => d(u(e$4, t$5, r$2)))(r$1, n$2, l$1) + e$3, t$4), $ = (e$3) => (t$4, r$1, n$2) => e$3(u(t$4, r$1, n$2)), x = y$1(3, h), T = y$1(4, b), v = (e$3) => c$1("38;5;" + e$3, h), C = (e$3) => c$1("48;5;" + e$3, b);
1913
+ 2 === e$2 ? (x = $(v), T = $(C)) : 1 === e$2 && (x = R(0, h), T = R(10, b), v = (e$3) => c$1(d(e$3), h), C = (e$3) => c$1(d(e$3) + 10, b));
1914
1914
  let E, M = {
1915
1915
  fg: v,
1916
1916
  bg: C,
@@ -1928,9 +1928,9 @@ var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis
1928
1928
  hidden: c$1(8, 28),
1929
1929
  strikethrough: c$1(9, 29)
1930
1930
  }, I = "Bright";
1931
- return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e$2, t$2) => {
1932
- E = "bg" + e$2[0].toUpperCase() + e$2.slice(1), 8 > t$2 ? (M[e$2 + I] = c$1(90 + t$2, h), M[E + I] = c$1(100 + t$2, b)) : t$2 = 60, M[e$2] = c$1(30 + t$2, h), M[E] = c$1(40 + t$2, b);
1933
- })), t$1.extend(M);
1931
+ return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e$3, t$4) => {
1932
+ E = "bg" + e$3[0].toUpperCase() + e$3.slice(1), 8 > t$4 ? (M[e$3 + I] = c$1(90 + t$4, h), M[E + I] = c$1(100 + t$4, b)) : t$4 = 60, M[e$3] = c$1(30 + t$4, h), M[E] = c$1(40 + t$4, b);
1933
+ })), t$3.extend(M);
1934
1934
  }, y = new w();
1935
1935
  module.exports = y, y.default = y;
1936
1936
  }) });
@@ -1938,7 +1938,6 @@ var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis
1938
1938
  //#endregion
1939
1939
  //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.mjs
1940
1940
  var import_ansis = /* @__PURE__ */ __toESM(require_ansis(), 1);
1941
- var ansis_default = import_ansis.default;
1942
1941
  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;
1943
1942
 
1944
1943
  //#endregion
@@ -2117,11 +2116,11 @@ const InputOptionsSchema = strictObject({
2117
2116
  literal("browser"),
2118
2117
  literal("neutral"),
2119
2118
  literal("node")
2120
- ])), description(`Platform for which the code should be generated (node, ${ansis_default.underline("browser")}, neutral)`)),
2119
+ ])), description(`Platform for which the code should be generated (node, ${import_ansis.default.underline("browser")}, neutral)`)),
2121
2120
  shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
2122
2121
  treeshake: optional(TreeshakingOptionsSchema),
2123
2122
  optimization: optional(OptimizationOptionsSchema),
2124
- logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${ansis_default.dim("silent")}, ${ansis_default.underline(ansis_default.gray("info"))}, debug, ${ansis_default.yellow("warn")})`)),
2123
+ logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${import_ansis.default.dim("silent")}, ${import_ansis.default.underline(import_ansis.default.gray("info"))}, debug, ${import_ansis.default.yellow("warn")})`)),
2125
2124
  onLog: optional(OnLogSchema),
2126
2125
  onwarn: optional(OnwarnSchema),
2127
2126
  moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
@@ -2239,18 +2238,18 @@ const OutputOptionsSchema = strictObject({
2239
2238
  literal("named"),
2240
2239
  literal("default"),
2241
2240
  literal("none")
2242
- ])), description(`Specify a export mode (${ansis_default.underline("auto")}, named, default, none)`)),
2241
+ ])), description(`Specify a export mode (${import_ansis.default.underline("auto")}, named, default, none)`)),
2243
2242
  hashCharacters: pipe(optional(union([
2244
2243
  literal("base64"),
2245
2244
  literal("base36"),
2246
2245
  literal("hex")
2247
2246
  ])), description("Use the specified character set for file hashes")),
2248
- format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${ansis_default.underline("esm")}, cjs, and iife)`)),
2247
+ format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${import_ansis.default.underline("esm")}, cjs, and iife)`)),
2249
2248
  sourcemap: pipe(optional(union([
2250
2249
  boolean(),
2251
2250
  literal("inline"),
2252
2251
  literal("hidden")
2253
- ])), 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")})`)),
2252
+ ])), description(`Generate sourcemap (\`-s inline\` for inline, or ${import_ansis.default.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
2254
2253
  sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
2255
2254
  sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
2256
2255
  sourcemapIgnoreList: optional(union([boolean(), custom(() => true)])),
@@ -2291,7 +2290,7 @@ const OutputOptionsSchema = strictObject({
2291
2290
  minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
2292
2291
  });
2293
2292
  const getAddonDescription = (placement, wrapper) => {
2294
- return `Code to insert the ${ansis_default.bold(placement)} of the bundled file (${ansis_default.bold(wrapper)} the wrapper function)`;
2293
+ return `Code to insert the ${import_ansis.default.bold(placement)} of the bundled file (${import_ansis.default.bold(wrapper)} the wrapper function)`;
2295
2294
  };
2296
2295
  const OutputCliOverrideSchema = strictObject({
2297
2296
  assetFileNames: pipe(optional(string()), description("Name pattern for asset files")),
@@ -2346,7 +2345,7 @@ function validateOption(key, options) {
2346
2345
  const issuePaths = issue.path.map((path$1) => path$1.key);
2347
2346
  let issueMsg = issue.message;
2348
2347
  if (issue.type === "union") {
2349
- const subIssue = issue.issues?.find((i$2) => !(i$2.type !== issue.received && i$2.input === issue.input));
2348
+ const subIssue = issue.issues?.find((i$1) => !(i$1.type !== issue.received && i$1.input === issue.input));
2350
2349
  if (subIssue) {
2351
2350
  if (subIssue.path) issuePaths.push(subIssue.path.map((path$1) => path$1.key));
2352
2351
  issueMsg = subIssue.message;
@@ -2389,19 +2388,19 @@ function bindingifySourcemap$1(map) {
2389
2388
  //#endregion
2390
2389
  //#region src/utils/error.ts
2391
2390
  function normalizeErrors(rawErrors) {
2392
- const errors = rawErrors.map((e$1) => e$1 instanceof Error ? e$1 : Object.assign(/* @__PURE__ */ new Error(), {
2393
- kind: e$1.kind,
2394
- message: e$1.message,
2391
+ const errors = rawErrors.map((e$2) => e$2 instanceof Error ? e$2 : Object.assign(/* @__PURE__ */ new Error(), {
2392
+ kind: e$2.kind,
2393
+ message: e$2.message,
2395
2394
  stack: void 0
2396
2395
  }));
2397
2396
  let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
2398
- for (let i$2 = 0; i$2 < errors.length; i$2++) {
2397
+ for (let i$1 = 0; i$1 < errors.length; i$1++) {
2399
2398
  summary += "\n";
2400
- if (i$2 >= 5) {
2399
+ if (i$1 >= 5) {
2401
2400
  summary += "...";
2402
2401
  break;
2403
2402
  }
2404
- summary += getErrorMessage(errors[i$2]);
2403
+ summary += getErrorMessage(errors[i$1]);
2405
2404
  }
2406
2405
  const wrapper = new Error(summary);
2407
2406
  Object.defineProperty(wrapper, "errors", {
@@ -2416,20 +2415,20 @@ function normalizeErrors(rawErrors) {
2416
2415
  });
2417
2416
  return wrapper;
2418
2417
  }
2419
- function getErrorMessage(e$1) {
2420
- if (Object.hasOwn(e$1, "kind")) return e$1.message;
2418
+ function getErrorMessage(e$2) {
2419
+ if (Object.hasOwn(e$2, "kind")) return e$2.message;
2421
2420
  let s$1 = "";
2422
- if (e$1.plugin) s$1 += `[plugin ${e$1.plugin}]`;
2423
- const id$1 = e$1.id ?? e$1.loc?.file;
2421
+ if (e$2.plugin) s$1 += `[plugin ${e$2.plugin}]`;
2422
+ const id$1 = e$2.id ?? e$2.loc?.file;
2424
2423
  if (id$1) {
2425
2424
  s$1 += " " + id$1;
2426
- if (e$1.loc) s$1 += `:${e$1.loc.line}:${e$1.loc.column}`;
2425
+ if (e$2.loc) s$1 += `:${e$2.loc.line}:${e$2.loc.column}`;
2427
2426
  }
2428
2427
  if (s$1) s$1 += "\n";
2429
- const message = `${e$1.name ?? "Error"}: ${e$1.message}`;
2428
+ const message = `${e$2.name ?? "Error"}: ${e$2.message}`;
2430
2429
  s$1 += message;
2431
- if (e$1.frame) s$1 = joinNewLine(s$1, e$1.frame);
2432
- if (e$1.stack) s$1 = joinNewLine(s$1, e$1.stack.replace(message, ""));
2430
+ if (e$2.frame) s$1 = joinNewLine(s$1, e$2.frame);
2431
+ if (e$2.stack) s$1 = joinNewLine(s$1, e$2.stack.replace(message, ""));
2433
2432
  return s$1;
2434
2433
  }
2435
2434
  function joinNewLine(s1, s2) {
@@ -2473,33 +2472,33 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
2473
2472
  }
2474
2473
 
2475
2474
  //#endregion
2476
- //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
2477
- function u$1(o$1, n$1, a$2) {
2478
- let t$1 = (r$1) => o$1(r$1, ...n$1);
2479
- return a$2 === void 0 ? t$1 : Object.assign(t$1, {
2480
- lazy: a$2,
2481
- lazyArgs: n$1
2475
+ //#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
2476
+ function e(e$2, t$3, n$2) {
2477
+ let r$1 = (n$3) => e$2(n$3, ...t$3);
2478
+ return n$2 === void 0 ? r$1 : Object.assign(r$1, {
2479
+ lazy: n$2,
2480
+ lazyArgs: t$3
2482
2481
  });
2483
2482
  }
2484
2483
 
2485
2484
  //#endregion
2486
- //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
2487
- function u(r$1, n$1, o$1) {
2488
- let a$2 = r$1.length - n$1.length;
2489
- if (a$2 === 0) return r$1(...n$1);
2490
- if (a$2 === 1) return u$1(r$1, n$1, o$1);
2491
- throw new Error("Wrong number of arguments");
2485
+ //#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/purry-DH9cw9sy.js
2486
+ function t(t$3, n$2, r$1) {
2487
+ let i$1 = t$3.length - n$2.length;
2488
+ if (i$1 === 0) return t$3(...n$2);
2489
+ if (i$1 === 1) return e(t$3, n$2, r$1);
2490
+ throw Error(`Wrong number of arguments`);
2492
2491
  }
2493
2492
 
2494
2493
  //#endregion
2495
- //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
2496
- function d(...r$1) {
2497
- return u(i, r$1);
2498
- }
2499
- var i = (r$1, t$1) => {
2500
- let a$2 = [[], []];
2501
- for (let [o$1, e$1] of r$1.entries()) t$1(e$1, o$1, r$1) ? a$2[0].push(e$1) : a$2[1].push(e$1);
2502
- return a$2;
2494
+ //#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/partition-BJYkp-a7.js
2495
+ function t$1(...t$3) {
2496
+ return t(n, t$3);
2497
+ }
2498
+ const n = (e$2, t$3) => {
2499
+ let n$2 = [[], []];
2500
+ 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);
2501
+ return n$2;
2503
2502
  };
2504
2503
 
2505
2504
  //#endregion
@@ -2524,8 +2523,8 @@ function transformFilterMatcherToFilterExprs(filterOption) {
2524
2523
  let idExcludes = [];
2525
2524
  let codeIncludes = [];
2526
2525
  let codeExcludes = [];
2527
- if (id$1) [idIncludes, idExcludes] = d(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m$1) => m$1.kind === "include");
2528
- if (code$1) [codeIncludes, codeExcludes] = d(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m$1) => m$1.kind === "include");
2526
+ if (id$1) [idIncludes, idExcludes] = t$1(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m$1) => m$1.kind === "include");
2527
+ if (code$1) [codeIncludes, codeExcludes] = t$1(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m$1) => m$1.kind === "include");
2529
2528
  ret.push(...idExcludes);
2530
2529
  ret.push(...codeExcludes);
2531
2530
  let andExprList = [];
@@ -2553,7 +2552,7 @@ function bindingifyFilterExprImpl(expr, list) {
2553
2552
  switch (expr.kind) {
2554
2553
  case "and": {
2555
2554
  let args$1 = expr.args;
2556
- for (let i$2 = args$1.length - 1; i$2 >= 0; i$2--) bindingifyFilterExprImpl(args$1[i$2], list);
2555
+ for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
2557
2556
  list.push({
2558
2557
  kind: "And",
2559
2558
  payload: args$1.length
@@ -2562,7 +2561,7 @@ function bindingifyFilterExprImpl(expr, list) {
2562
2561
  }
2563
2562
  case "or": {
2564
2563
  let args$1 = expr.args;
2565
- for (let i$2 = args$1.length - 1; i$2 >= 0; i$2--) bindingifyFilterExprImpl(args$1[i$2], list);
2564
+ for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
2566
2565
  list.push({
2567
2566
  kind: "Or",
2568
2567
  payload: args$1.length
@@ -2712,10 +2711,10 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2712
2711
  data.loadModulePromiseMap.set(id$1, promise$1);
2713
2712
  try {
2714
2713
  await context.load(id$1, options.moduleSideEffects ?? void 0);
2715
- } catch (e$1) {
2714
+ } catch (e$2) {
2716
2715
  data.loadModulePromiseMap.delete(id$1);
2717
2716
  data.loadModulePromiseResolveFnMap.delete(id$1);
2718
- throw e$1;
2717
+ throw e$2;
2719
2718
  }
2720
2719
  return promise$1;
2721
2720
  }
@@ -2802,12 +2801,12 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
2802
2801
  this.warn = getLogHandler$1(this.warn);
2803
2802
  this.info = getLogHandler$1(this.info);
2804
2803
  }
2805
- error(e$1, pos) {
2806
- if (typeof e$1 === "string") e$1 = { message: e$1 };
2807
- if (pos) augmentCodeLocation(e$1, pos, this.moduleSource, this.moduleId);
2808
- e$1.id = this.moduleId;
2809
- e$1.hook = "transform";
2810
- return error(logPluginError(normalizeLog(e$1), this.pluginName));
2804
+ error(e$2, pos) {
2805
+ if (typeof e$2 === "string") e$2 = { message: e$2 };
2806
+ if (pos) augmentCodeLocation(e$2, pos, this.moduleSource, this.moduleId);
2807
+ e$2.id = this.moduleId;
2808
+ e$2.hook = "transform";
2809
+ return error(logPluginError(normalizeLog(e$2), this.pluginName));
2811
2810
  }
2812
2811
  getCombinedSourcemap() {
2813
2812
  return JSON.parse(this.inner.getCombinedSourcemap());
@@ -3033,9 +3032,9 @@ function transformRenderedChunk(chunk) {
3033
3032
  }
3034
3033
  function transformChunkModules(modules) {
3035
3034
  const result = {};
3036
- for (let i$2 = 0; i$2 < modules.values.length; i$2++) {
3037
- let key = modules.keys[i$2];
3038
- const mod = modules.values[i$2];
3035
+ for (let i$1 = 0; i$1 < modules.values.length; i$1++) {
3036
+ let key = modules.keys[i$1];
3037
+ const mod = modules.values[i$1];
3039
3038
  result[key] = transformToRenderedModule(mod);
3040
3039
  }
3041
3040
  return result;
@@ -3544,8 +3543,8 @@ function wrapHandlers(plugin) {
3544
3543
  if (handler) plugin[hookName] = async (...args$1) => {
3545
3544
  try {
3546
3545
  return await handler(...args$1);
3547
- } catch (e$1) {
3548
- return error(logPluginError(e$1, plugin.name, {
3546
+ } catch (e$2) {
3547
+ return error(logPluginError(e$2, plugin.name, {
3549
3548
  hook: hookName,
3550
3549
  id: hookName === "transform" ? args$1[2] : void 0
3551
3550
  }));
@@ -3575,6 +3574,9 @@ var NormalizedInputOptionsImpl = class {
3575
3574
  get platform() {
3576
3575
  return this.inner.platform;
3577
3576
  }
3577
+ get context() {
3578
+ return this.inner.context;
3579
+ }
3578
3580
  };
3579
3581
 
3580
3582
  //#endregion
@@ -4206,7 +4208,7 @@ async function initializeParallelPlugins(plugins) {
4206
4208
  };
4207
4209
  }
4208
4210
  function initializeWorkers(registryId, count, pluginInfos) {
4209
- return Promise.all(Array.from({ length: count }, (_, i$2) => initializeWorker(registryId, pluginInfos, i$2)));
4211
+ return Promise.all(Array.from({ length: count }, (_, i$1) => initializeWorker(registryId, pluginInfos, i$1)));
4210
4212
  }
4211
4213
  async function initializeWorker(registryId, pluginInfos, threadNumber) {
4212
4214
  const urlString = import.meta.resolve("#parallel-plugin-worker");
@@ -4226,9 +4228,9 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
4226
4228
  });
4227
4229
  });
4228
4230
  return worker;
4229
- } catch (e$1) {
4231
+ } catch (e$2) {
4230
4232
  worker?.terminate();
4231
- throw e$1;
4233
+ throw e$2;
4232
4234
  }
4233
4235
  }
4234
4236
  const availableParallelism = () => {
@@ -4244,12 +4246,12 @@ const availableParallelism = () => {
4244
4246
 
4245
4247
  //#endregion
4246
4248
  //#region src/utils/create-bundler-option.ts
4247
- async function createBundlerOptions(inputOptions, outputOptions, watchMode, isClose) {
4249
+ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
4248
4250
  const inputPlugins = await normalizePluginOption(inputOptions.plugins);
4249
4251
  const outputPlugins = await normalizePluginOption(outputOptions.plugins);
4250
4252
  const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
4251
4253
  const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel, watchMode);
4252
- if (!isClose) outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions, onLog, logLevel, watchMode);
4254
+ outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions, onLog, logLevel, watchMode);
4253
4255
  const normalizedOutputPlugins = await normalizePluginOption(outputOptions.plugins);
4254
4256
  let plugins = [
4255
4257
  ...BUILTIN_PLUGINS,
@@ -4270,17 +4272,17 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode, isCl
4270
4272
  onLog,
4271
4273
  stopWorkers: parallelPluginInitResult?.stopWorkers
4272
4274
  };
4273
- } catch (e$1) {
4275
+ } catch (e$2) {
4274
4276
  await parallelPluginInitResult?.stopWorkers();
4275
- throw e$1;
4277
+ throw e$2;
4276
4278
  }
4277
4279
  }
4278
4280
 
4279
4281
  //#endregion
4280
4282
  //#region src/utils/create-bundler.ts
4281
4283
  let asyncRuntimeShutdown = false;
4282
- async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose) {
4283
- const option = await createBundlerOptions(inputOptions, outputOptions, false, isClose);
4284
+ async function createBundlerImpl(bundler, inputOptions, outputOptions) {
4285
+ const option = await createBundlerOptions(inputOptions, outputOptions, false);
4284
4286
  if (asyncRuntimeShutdown) startAsyncRuntime();
4285
4287
  try {
4286
4288
  return {
@@ -4291,9 +4293,9 @@ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose)
4291
4293
  asyncRuntimeShutdown = true;
4292
4294
  }
4293
4295
  };
4294
- } catch (e$1) {
4296
+ } catch (e$2) {
4295
4297
  await option.stopWorkers?.();
4296
- throw e$1;
4298
+ throw e$2;
4297
4299
  }
4298
4300
  }
4299
4301
 
@@ -4321,11 +4323,11 @@ var RolldownBuild = class {
4321
4323
  this.#bundler = new BindingBundler();
4322
4324
  }
4323
4325
  get closed() {
4324
- return this.#bundlerImpl?.impl.closed ?? false;
4326
+ return this.#bundlerImpl?.impl.closed ?? true;
4325
4327
  }
4326
- async #getBundlerWithStopWorker(outputOptions, isClose) {
4328
+ async #getBundlerWithStopWorker(outputOptions) {
4327
4329
  if (this.#bundlerImpl) await this.#bundlerImpl.stopWorkers?.();
4328
- return this.#bundlerImpl = await createBundlerImpl(this.#bundler, this.#inputOptions, outputOptions, isClose);
4330
+ return this.#bundlerImpl = await createBundlerImpl(this.#bundler, this.#inputOptions, outputOptions);
4329
4331
  }
4330
4332
  async generate(outputOptions = {}) {
4331
4333
  validateOption("output", outputOptions);
@@ -4340,10 +4342,12 @@ var RolldownBuild = class {
4340
4342
  return transformToRollupOutput(output);
4341
4343
  }
4342
4344
  async close() {
4343
- const { impl, stopWorkers, shutdown } = await this.#getBundlerWithStopWorker({}, true);
4344
- await stopWorkers?.();
4345
- await impl.close();
4346
- shutdown();
4345
+ if (this.#bundlerImpl) {
4346
+ await this.#bundlerImpl.stopWorkers?.();
4347
+ await this.#bundlerImpl.impl.close();
4348
+ this.#bundlerImpl.shutdown();
4349
+ this.#bundlerImpl = void 0;
4350
+ }
4347
4351
  }
4348
4352
  async [Symbol.asyncDispose]() {
4349
4353
  await this.close();
@@ -4532,4 +4536,4 @@ function defineConfig(config) {
4532
4536
  const VERSION = version;
4533
4537
 
4534
4538
  //#endregion
4535
- export { BuiltinPlugin, PluginContextData, PluginDriver, VERSION, __commonJS, __toESM, ansis_default, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, createBundlerImpl, defineConfig, description$1 as description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
4539
+ export { BuiltinPlugin, PluginContextData, PluginDriver, VERSION, __commonJS, __toESM, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, createBundlerImpl, defineConfig, description$1 as description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, import_ansis, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };