@rolldown/browser 1.0.0-beta.39 → 1.0.0-beta.41

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.
@@ -1,4 +1,4 @@
1
- import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-CIyujJMQ.mjs";
1
+ import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-CTl_R-Xm.mjs";
2
2
  import { and, arraify, code, exclude, id, include, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-CHTC3-kR.mjs";
3
3
  import { Worker, isMainThread } from "node:worker_threads";
4
4
  import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, initTraceSubscriber, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
@@ -243,7 +243,7 @@ if (isMainThread) {
243
243
 
244
244
  //#endregion
245
245
  //#region package.json
246
- var version = "1.0.0-beta.39";
246
+ var version = "1.0.0-beta.41";
247
247
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
248
248
 
249
249
  //#endregion
@@ -590,20 +590,20 @@ function getSortedPlugins(hookName, plugins) {
590
590
  }
591
591
 
592
592
  //#endregion
593
- //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs
594
- var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs": ((exports, module) => {
595
- 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) => {
596
- 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);
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
597
  return [
598
- n$2 >> 16 & 255,
599
- n$2 >> 8 & 255,
600
- 255 & n$2
598
+ l$1 >> 16 & 255,
599
+ l$1 >> 8 & 255,
600
+ 255 & l$1
601
601
  ];
602
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, n$2, l$1, 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, 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);
605
- }, g = (() => {
606
- 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;
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
607
  try {
608
608
  e$1 = "," + s(i$1).join(",");
609
609
  } catch (e$2) {
@@ -616,86 +616,86 @@ var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis
616
616
  2: 2,
617
617
  3: 3
618
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, n$3, l$2) => (t$2 = r$2.TERM, {
619
+ return u$1 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, l$2, n$3) => (t$2 = r$2.TERM, {
620
620
  "24bit": 3,
621
621
  truecolor: 3,
622
622
  ansi256: 2,
623
623
  ansi: 1
624
- }[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;
625
- })(), f = {
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
626
  open: i,
627
627
  close: i
628
- }, h = 39, b = 49, O = {}, m = ({ p: e$2 }, { open: t$3, close: n$2 }) => {
628
+ }, h = 39, b = 49, O = {}, m = ({ p: e$2 }, { open: t$3, close: l$1 }) => {
629
629
  let o$1 = (e$3, ...r$1) => {
630
630
  if (!e$3) {
631
- if (t$3 && t$3 === n$2) return t$3;
631
+ if (t$3 && t$3 === l$1) return t$3;
632
632
  if ((e$3 ?? i) === i) return i;
633
633
  }
634
- 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;
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
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, n$3 = i, o$2 = 0;
637
- 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;
638
- s$2 = n$3 + s$2.slice(o$2);
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
639
  }
640
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 = n$2;
642
- return e$2 && (s$1 = e$2.o + t$3, c$1 = n$2 + e$2.c), l(o$1, r), o$1.p = {
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
643
  open: t$3,
644
- close: n$2,
644
+ close: l$1,
645
645
  o: s$1,
646
646
  c: c$1,
647
647
  p: e$2
648
648
  }, o$1.open = s$1, o$1.close = c$1, o$1;
649
649
  };
650
- const w = function(e$2 = g) {
651
- let t$3 = {
652
- Ansis: w,
653
- level: e$2,
654
- isSupported: () => s$1,
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
655
  strip: (e$3) => e$3.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
656
656
  extend(e$3) {
657
657
  for (let t$4 in e$3) {
658
- let r$1 = e$3[t$4], l$1 = (typeof r$1)[0], o$1 = "s" === l$1 ? x(...p(r$1)) : r$1;
659
- O[t$4] = "f" === l$1 ? { get() {
660
- return (...e$4) => m(this, r$1(...e$4));
661
- } } : { get() {
662
- let e$4 = m(this, o$1);
663
- return n$1(this, t$4, { value: e$4 }), e$4;
664
- } };
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);
665
660
  }
666
- return r = o({}, O), l(t$3, r), t$3;
661
+ return r = o({}, O), n$1(s$1, r), s$1;
667
662
  }
668
- }, s$1 = e$2 > 0, c$1 = (e$3, t$4) => s$1 ? {
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
669
  open: `[${e$3}m`,
670
670
  close: `[${t$4}m`
671
- } : 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);
672
- 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));
673
- let E, M = {
674
- fg: v,
675
- bg: C,
676
- rgb: x,
677
- bgRgb: T,
678
- hex: a$2(x),
679
- bgHex: a$2(T),
680
- visible: f,
681
- reset: c$1(0, 0),
682
- bold: c$1(1, 22),
683
- dim: c$1(2, 22),
684
- italic: c$1(3, 23),
685
- underline: c$1(4, 24),
686
- inverse: c$1(7, 27),
687
- hidden: c$1(8, 28),
688
- strikethrough: c$1(9, 29)
689
- }, I = "Bright";
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
690
  return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e$3, t$4) => {
691
- 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);
692
- })), t$3.extend(M);
693
- }, y = new w();
694
- module.exports = y, y.default = y;
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
695
  }) });
696
696
 
697
697
  //#endregion
698
- //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.mjs
698
+ //#region ../../node_modules/.pnpm/ansis@4.2.0/node_modules/ansis/index.mjs
699
699
  var import_ansis = /* @__PURE__ */ __toESM(require_ansis(), 1);
700
700
  var ansis_default = import_ansis.default;
701
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;
@@ -1638,6 +1638,18 @@ function omit(schema, keys) {
1638
1638
  };
1639
1639
  }
1640
1640
  /* @__NO_SIDE_EFFECTS__ */
1641
+ function partial(schema, keys) {
1642
+ const entries2 = {};
1643
+ for (const key in schema.entries) entries2[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key];
1644
+ return {
1645
+ ...schema,
1646
+ entries: entries2,
1647
+ get "~standard"() {
1648
+ return /* @__PURE__ */ _getStandardProps(this);
1649
+ }
1650
+ };
1651
+ }
1652
+ /* @__NO_SIDE_EFFECTS__ */
1641
1653
  function pipe(...pipe2) {
1642
1654
  return {
1643
1655
  ...pipe2[0],
@@ -2092,6 +2104,11 @@ const AdvancedChunksSchema = strictObject({
2092
2104
  maxModuleSize: optional(number())
2093
2105
  })))
2094
2106
  });
2107
+ const GeneratedCodePresetSchema = union([literal("es5"), literal("es2015")]);
2108
+ const GeneratedCodeOptionsSchema = strictObject({
2109
+ symbols: pipe(optional(boolean()), description("Whether to use Symbol.toStringTag for namespace objects")),
2110
+ preset: GeneratedCodePresetSchema
2111
+ });
2095
2112
  const OutputOptionsSchema = strictObject({
2096
2113
  dir: pipe(optional(string()), description("Output directory, defaults to `dist` if `file` is not set")),
2097
2114
  file: pipe(optional(string()), description("Single output file")),
@@ -2114,7 +2131,11 @@ const OutputOptionsSchema = strictObject({
2114
2131
  ])), 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")})`)),
2115
2132
  sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
2116
2133
  sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
2117
- sourcemapIgnoreList: optional(union([boolean(), custom(() => true)])),
2134
+ sourcemapIgnoreList: optional(union([
2135
+ boolean(),
2136
+ custom(() => true),
2137
+ StringOrRegExpSchema
2138
+ ])),
2118
2139
  sourcemapPathTransform: optional(custom(() => true)),
2119
2140
  banner: optional(union([string(), AddonFunctionSchema])),
2120
2141
  footer: optional(union([string(), AddonFunctionSchema])),
@@ -2135,6 +2156,7 @@ const OutputOptionsSchema = strictObject({
2135
2156
  ])), description("Minify the bundled file")),
2136
2157
  name: pipe(optional(string()), description("Name for UMD / IIFE format outputs")),
2137
2158
  globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2159
+ generatedCode: pipe(optional(partial(GeneratedCodeOptionsSchema)), description("Generated code options")),
2138
2160
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
2139
2161
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2140
2162
  manualChunks: optional(pipe(function_(), args(tuple([string(), object({})])), returns(union([string(), nullish(string())])))),
@@ -2342,7 +2364,7 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
2342
2364
  }
2343
2365
 
2344
2366
  //#endregion
2345
- //#region ../../node_modules/.pnpm/remeda@2.31.1/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
2367
+ //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
2346
2368
  function e(e$2, t$3, n$2) {
2347
2369
  let r$1 = (n$3) => e$2(n$3, ...t$3);
2348
2370
  return n$2 === void 0 ? r$1 : Object.assign(r$1, {
@@ -2352,7 +2374,7 @@ function e(e$2, t$3, n$2) {
2352
2374
  }
2353
2375
 
2354
2376
  //#endregion
2355
- //#region ../../node_modules/.pnpm/remeda@2.31.1/node_modules/remeda/dist/purry-DH9cw9sy.js
2377
+ //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js
2356
2378
  function t(t$3, n$2, r$1) {
2357
2379
  let i$1 = t$3.length - n$2.length;
2358
2380
  if (i$1 === 0) return t$3(...n$2);
@@ -2361,7 +2383,7 @@ function t(t$3, n$2, r$1) {
2361
2383
  }
2362
2384
 
2363
2385
  //#endregion
2364
- //#region ../../node_modules/.pnpm/remeda@2.31.1/node_modules/remeda/dist/partition-DAu403JQ.js
2386
+ //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/partition-DAu403JQ.js
2365
2387
  function t$1(...t$3) {
2366
2388
  return t(n, t$3);
2367
2389
  }
@@ -3444,130 +3466,6 @@ var NormalizedInputOptionsImpl = class {
3444
3466
  }
3445
3467
  };
3446
3468
 
3447
- //#endregion
3448
- //#region src/types/chunking-context.ts
3449
- var ChunkingContextImpl = class {
3450
- constructor(context) {
3451
- this.context = context;
3452
- }
3453
- getModuleInfo(moduleId) {
3454
- const bindingInfo = this.context.getModuleInfo(moduleId);
3455
- if (bindingInfo) return transformModuleInfo(bindingInfo, {
3456
- moduleSideEffects: null,
3457
- meta: {}
3458
- });
3459
- return null;
3460
- }
3461
- };
3462
-
3463
- //#endregion
3464
- //#region src/utils/bindingify-output-options.ts
3465
- function bindingifyOutputOptions(outputOptions) {
3466
- const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
3467
- const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
3468
- return {
3469
- dir,
3470
- file: file == null ? void 0 : file,
3471
- format: bindingifyFormat(format),
3472
- exports,
3473
- hashCharacters,
3474
- sourcemap: bindingifySourcemap(sourcemap),
3475
- sourcemapBaseUrl,
3476
- sourcemapDebugIds,
3477
- sourcemapIgnoreList: bindingifySourcemapIgnoreList(sourcemapIgnoreList),
3478
- sourcemapPathTransform,
3479
- banner: bindingifyAddon(banner),
3480
- footer: bindingifyAddon(footer),
3481
- intro: bindingifyAddon(intro),
3482
- outro: bindingifyAddon(outro),
3483
- extend: outputOptions.extend,
3484
- globals,
3485
- esModule,
3486
- name,
3487
- assetFileNames: bindingifyAssetFilenames(assetFileNames),
3488
- entryFileNames,
3489
- chunkFileNames,
3490
- cssEntryFileNames,
3491
- cssChunkFileNames,
3492
- plugins: [],
3493
- minify: outputOptions.minify,
3494
- externalLiveBindings: outputOptions.externalLiveBindings,
3495
- inlineDynamicImports: outputOptions.inlineDynamicImports,
3496
- advancedChunks,
3497
- polyfillRequire: outputOptions.polyfillRequire,
3498
- sanitizeFileName,
3499
- preserveModules,
3500
- virtualDirname,
3501
- legalComments,
3502
- preserveModulesRoot,
3503
- topLevelVar,
3504
- minifyInternalExports: outputOptions.minifyInternalExports
3505
- };
3506
- }
3507
- function bindingifyAddon(configAddon) {
3508
- return async (chunk) => {
3509
- if (typeof configAddon === "function") return configAddon(transformRenderedChunk(chunk));
3510
- return configAddon || "";
3511
- };
3512
- }
3513
- function bindingifyFormat(format) {
3514
- switch (format) {
3515
- case void 0:
3516
- case "es":
3517
- case "esm":
3518
- case "module": return "es";
3519
- case "cjs":
3520
- case "commonjs": return "cjs";
3521
- case "iife": return "iife";
3522
- case "umd": return "umd";
3523
- default: unimplemented(`output.format: ${format}`);
3524
- }
3525
- }
3526
- function bindingifySourcemap(sourcemap) {
3527
- switch (sourcemap) {
3528
- case true: return "file";
3529
- case "inline": return "inline";
3530
- case false:
3531
- case void 0: return;
3532
- case "hidden": return "hidden";
3533
- default: throw new Error(`unknown sourcemap: ${sourcemap}`);
3534
- }
3535
- }
3536
- function bindingifySourcemapIgnoreList(sourcemapIgnoreList) {
3537
- return typeof sourcemapIgnoreList === "function" ? sourcemapIgnoreList : sourcemapIgnoreList === false ? () => false : (relativeSourcePath, _sourcemapPath) => relativeSourcePath.includes("node_modules");
3538
- }
3539
- function bindingifyAssetFilenames(assetFileNames) {
3540
- if (typeof assetFileNames === "function") return (asset) => {
3541
- return assetFileNames({
3542
- name: asset.name,
3543
- names: asset.names,
3544
- originalFileName: asset.originalFileName,
3545
- originalFileNames: asset.originalFileNames,
3546
- source: transformAssetSource(asset.source),
3547
- type: "asset"
3548
- });
3549
- };
3550
- return assetFileNames;
3551
- }
3552
- function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
3553
- if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
3554
- else if (manualChunks != null) advancedChunks = { groups: [{ name(moduleId, ctx) {
3555
- return manualChunks(moduleId, { getModuleInfo: (id$1) => ctx.getModuleInfo(id$1) });
3556
- } }] };
3557
- if (advancedChunks == null) return;
3558
- const { groups,...restAdvancedChunks } = advancedChunks;
3559
- return {
3560
- ...restAdvancedChunks,
3561
- groups: groups?.map((group) => {
3562
- const { name,...restGroup } = group;
3563
- return {
3564
- ...restGroup,
3565
- name: typeof name === "function" ? (id$1, ctx) => name(id$1, new ChunkingContextImpl(ctx)) : name
3566
- };
3567
- })
3568
- };
3569
- }
3570
-
3571
3469
  //#endregion
3572
3470
  //#region src/options/normalized-output-options.ts
3573
3471
  var NormalizedOutputOptionsImpl = class {
@@ -3649,7 +3547,7 @@ var NormalizedOutputOptionsImpl = class {
3649
3547
  return this.inner.sourcemapDebugIds;
3650
3548
  }
3651
3549
  get sourcemapIgnoreList() {
3652
- return bindingifySourcemapIgnoreList(this.outputOptions.sourcemapIgnoreList);
3550
+ return this.outputOptions.sourcemapIgnoreList;
3653
3551
  }
3654
3552
  get sourcemapPathTransform() {
3655
3553
  return this.outputOptions.sourcemapPathTransform;
@@ -4066,6 +3964,128 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
4066
3964
  };
4067
3965
  }
4068
3966
 
3967
+ //#endregion
3968
+ //#region src/types/chunking-context.ts
3969
+ var ChunkingContextImpl = class {
3970
+ constructor(context) {
3971
+ this.context = context;
3972
+ }
3973
+ getModuleInfo(moduleId) {
3974
+ const bindingInfo = this.context.getModuleInfo(moduleId);
3975
+ if (bindingInfo) return transformModuleInfo(bindingInfo, {
3976
+ moduleSideEffects: null,
3977
+ meta: {}
3978
+ });
3979
+ return null;
3980
+ }
3981
+ };
3982
+
3983
+ //#endregion
3984
+ //#region src/utils/bindingify-output-options.ts
3985
+ function bindingifyOutputOptions(outputOptions) {
3986
+ const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
3987
+ const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
3988
+ return {
3989
+ dir,
3990
+ file: file == null ? void 0 : file,
3991
+ format: bindingifyFormat(format),
3992
+ exports,
3993
+ hashCharacters,
3994
+ sourcemap: bindingifySourcemap(sourcemap),
3995
+ sourcemapBaseUrl,
3996
+ sourcemapDebugIds,
3997
+ sourcemapIgnoreList: sourcemapIgnoreList ?? /node_modules/,
3998
+ sourcemapPathTransform,
3999
+ banner: bindingifyAddon(banner),
4000
+ footer: bindingifyAddon(footer),
4001
+ intro: bindingifyAddon(intro),
4002
+ outro: bindingifyAddon(outro),
4003
+ extend: outputOptions.extend,
4004
+ globals,
4005
+ generatedCode,
4006
+ esModule,
4007
+ name,
4008
+ assetFileNames: bindingifyAssetFilenames(assetFileNames),
4009
+ entryFileNames,
4010
+ chunkFileNames,
4011
+ cssEntryFileNames,
4012
+ cssChunkFileNames,
4013
+ plugins: [],
4014
+ minify: outputOptions.minify,
4015
+ externalLiveBindings: outputOptions.externalLiveBindings,
4016
+ inlineDynamicImports: outputOptions.inlineDynamicImports,
4017
+ advancedChunks,
4018
+ polyfillRequire: outputOptions.polyfillRequire,
4019
+ sanitizeFileName,
4020
+ preserveModules,
4021
+ virtualDirname,
4022
+ legalComments,
4023
+ preserveModulesRoot,
4024
+ topLevelVar,
4025
+ minifyInternalExports: outputOptions.minifyInternalExports
4026
+ };
4027
+ }
4028
+ function bindingifyAddon(configAddon) {
4029
+ return async (chunk) => {
4030
+ if (typeof configAddon === "function") return configAddon(transformRenderedChunk(chunk));
4031
+ return configAddon || "";
4032
+ };
4033
+ }
4034
+ function bindingifyFormat(format) {
4035
+ switch (format) {
4036
+ case void 0:
4037
+ case "es":
4038
+ case "esm":
4039
+ case "module": return "es";
4040
+ case "cjs":
4041
+ case "commonjs": return "cjs";
4042
+ case "iife": return "iife";
4043
+ case "umd": return "umd";
4044
+ default: unimplemented(`output.format: ${format}`);
4045
+ }
4046
+ }
4047
+ function bindingifySourcemap(sourcemap) {
4048
+ switch (sourcemap) {
4049
+ case true: return "file";
4050
+ case "inline": return "inline";
4051
+ case false:
4052
+ case void 0: return;
4053
+ case "hidden": return "hidden";
4054
+ default: throw new Error(`unknown sourcemap: ${sourcemap}`);
4055
+ }
4056
+ }
4057
+ function bindingifyAssetFilenames(assetFileNames) {
4058
+ if (typeof assetFileNames === "function") return (asset) => {
4059
+ return assetFileNames({
4060
+ name: asset.name,
4061
+ names: asset.names,
4062
+ originalFileName: asset.originalFileName,
4063
+ originalFileNames: asset.originalFileNames,
4064
+ source: transformAssetSource(asset.source),
4065
+ type: "asset"
4066
+ });
4067
+ };
4068
+ return assetFileNames;
4069
+ }
4070
+ function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
4071
+ if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
4072
+ else if (manualChunks != null) advancedChunks = { groups: [{ name(moduleId, ctx) {
4073
+ return manualChunks(moduleId, { getModuleInfo: (id$1) => ctx.getModuleInfo(id$1) });
4074
+ } }] };
4075
+ if (advancedChunks == null) return;
4076
+ const { groups,...restAdvancedChunks } = advancedChunks;
4077
+ return {
4078
+ ...restAdvancedChunks,
4079
+ groups: groups?.map((group) => {
4080
+ const { name,...restGroup } = group;
4081
+ return {
4082
+ ...restGroup,
4083
+ name: typeof name === "function" ? (id$1, ctx) => name(id$1, new ChunkingContextImpl(ctx)) : name
4084
+ };
4085
+ })
4086
+ };
4087
+ }
4088
+
4069
4089
  //#endregion
4070
4090
  //#region src/utils/initialize-parallel-plugins.ts
4071
4091
  async function initializeParallelPlugins(plugins) {
@@ -4158,18 +4178,6 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
4158
4178
  }
4159
4179
  }
4160
4180
 
4161
- //#endregion
4162
- //#region src/utils/transform-hmr-patch-output.ts
4163
- function transformHmrPatchOutput(output) {
4164
- handleHmrPatchOutputErrors(output);
4165
- const { patch } = output;
4166
- return patch ?? void 0;
4167
- }
4168
- function handleHmrPatchOutputErrors(output) {
4169
- const rawErrors = output.errors;
4170
- if (rawErrors.length > 0) throw normalizeErrors(rawErrors);
4171
- }
4172
-
4173
4181
  //#endregion
4174
4182
  //#region src/api/rolldown/rolldown-build.ts
4175
4183
  Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
@@ -4231,18 +4239,6 @@ var RolldownBuild = class RolldownBuild {
4231
4239
  async [Symbol.asyncDispose]() {
4232
4240
  await this.close();
4233
4241
  }
4234
- async generateHmrPatch(changedFiles) {
4235
- const ret = await this.#bundlerImpl.impl.generateHmrPatch(changedFiles);
4236
- switch (ret.type) {
4237
- case "Ok": return ret.field0;
4238
- case "Error": throw normalizeErrors(ret.field0);
4239
- default: throw new Error("Unknown error");
4240
- }
4241
- }
4242
- async hmrInvalidate(file, firstInvalidatedBy) {
4243
- const output = await this.#bundlerImpl.impl.hmrInvalidate(file, firstInvalidatedBy);
4244
- return transformHmrPatchOutput(output);
4245
- }
4246
4242
  get watchFiles() {
4247
4243
  return this.#bundlerImpl?.impl.getWatchFiles() ?? Promise.resolve([]);
4248
4244
  }