@rolldown/browser 1.0.0-beta.10-commit.ac4e5db → 1.0.0-beta.10-commit.81375fe

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 (33) hide show
  1. package/dist/cli.cjs +28 -29
  2. package/dist/cli.mjs +29 -56
  3. package/dist/config.cjs +2 -2
  4. package/dist/config.d.cts +1 -1
  5. package/dist/config.d.mts +1 -1
  6. package/dist/config.mjs +3 -3
  7. package/dist/experimental-index.browser.mjs +1 -1
  8. package/dist/experimental-index.cjs +1 -1
  9. package/dist/experimental-index.d.cts +1 -1
  10. package/dist/experimental-index.d.mts +1 -1
  11. package/dist/experimental-index.mjs +2 -2
  12. package/dist/filter-index.d.cts +1 -1
  13. package/dist/filter-index.d.mts +1 -1
  14. package/dist/filter-index.mjs +1 -1
  15. package/dist/index.browser.mjs +1 -1
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.cts +1 -1
  18. package/dist/index.d.mts +1 -1
  19. package/dist/index.mjs +2 -2
  20. package/dist/parallel-plugin-worker.cjs +1 -1
  21. package/dist/parallel-plugin-worker.mjs +2 -2
  22. package/dist/parallel-plugin.d.cts +1 -1
  23. package/dist/parallel-plugin.d.mts +1 -1
  24. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  25. package/dist/shared/{define-config.d-DII1FzpF.d.cts → define-config.d-BDJzbjFe.d.mts} +3 -2
  26. package/dist/shared/{define-config.d-BBxr6_Bs.d.mts → define-config.d-C0X0fNDk.d.cts} +4 -3
  27. package/dist/shared/{dist-JdACkHJM.mjs → dist-BoWaIc-K.mjs} +1 -1
  28. package/dist/shared/{load-config-DHiFIPc1.cjs → load-config-Cr472rVH.cjs} +1 -1
  29. package/dist/shared/{load-config-DXspXfGi.mjs → load-config-a5TDbL5U.mjs} +1 -1
  30. package/dist/shared/{src-DYeE276c.cjs → src-Cd6dJVwS.cjs} +237 -98
  31. package/dist/shared/{src-CrAobyBl.mjs → src-Mp5z-lgE.mjs} +259 -100
  32. package/dist/{src-Bhvm4CGb.js → src--mQWdm3h.js} +269 -110
  33. package/package.json +2 -6
@@ -1,14 +1,39 @@
1
- import { and$1 as and, arraify, code$1 as code, exclude$1 as exclude, id$1 as id, include$1 as include, isNullish, moduleType$1 as moduleType, noop, or$1 as or, unimplemented, unreachable, unsupported } from "./dist-JdACkHJM.mjs";
1
+ import { and, arraify, code, exclude, id, include, isNullish, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-BoWaIc-K.mjs";
2
2
  import { augmentCodeLocation, error, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-C31FpvkE.mjs";
3
3
  import { BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, Bundler, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
4
4
  import path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
- import colors from "ansis";
7
6
  import os from "node:os";
8
7
  import { Worker } from "node:worker_threads";
9
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$2 = 0, n$1 = keys.length, key; i$2 < n$1; i$2++) {
21
+ key = keys[i$2];
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
10
35
  //#region package.json
11
- var version = "1.0.0-beta.10-commit.ac4e5db";
36
+ var version = "1.0.0-beta.10-commit.81375fe";
12
37
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
13
38
 
14
39
  //#endregion
@@ -347,8 +372,8 @@ var MinimalPluginContextImpl = class {
347
372
  watchMode
348
373
  };
349
374
  }
350
- error(e) {
351
- return error(logPluginError(normalizeLog(e), this.pluginName, { hook: this.hookName }));
375
+ error(e$1) {
376
+ return error(logPluginError(normalizeLog(e$1), this.pluginName, { hook: this.hookName }));
352
377
  }
353
378
  };
354
379
 
@@ -1322,6 +1347,25 @@ function unionAsync(options, message2) {
1322
1347
  };
1323
1348
  }
1324
1349
  /* @__NO_SIDE_EFFECTS__ */
1350
+ function void_(message2) {
1351
+ return {
1352
+ kind: "schema",
1353
+ type: "void",
1354
+ reference: void_,
1355
+ expects: "void",
1356
+ async: false,
1357
+ message: message2,
1358
+ get "~standard"() {
1359
+ return /* @__PURE__ */ _getStandardProps(this);
1360
+ },
1361
+ "~run"(dataset, config2) {
1362
+ if (dataset.value === void 0) dataset.typed = true;
1363
+ else _addIssue(this, "type", dataset, config2);
1364
+ return dataset;
1365
+ }
1366
+ };
1367
+ }
1368
+ /* @__NO_SIDE_EFFECTS__ */
1325
1369
  function keyof(schema, message2) {
1326
1370
  return /* @__PURE__ */ picklist(Object.keys(schema.entries), message2);
1327
1371
  }
@@ -1754,6 +1798,117 @@ function toJsonSchema(schema, config) {
1754
1798
  return jsonSchema;
1755
1799
  }
1756
1800
 
1801
+ //#endregion
1802
+ //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs
1803
+ var require_ansis = __commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs"(exports, module) {
1804
+ let e, t$1, r, { defineProperty: n, setPrototypeOf: l, create: o, keys: s } = Object, i$1 = "", { round: c, max: a$1 } = Math, p = (e$1) => {
1805
+ let t$2 = /([a-f\d]{3,6})/i.exec(e$1)?.[1], r$1 = t$2?.length, n$1 = parseInt(6 ^ r$1 ? 3 ^ r$1 ? "0" : t$2[0] + t$2[0] + t$2[1] + t$2[1] + t$2[2] + t$2[2] : t$2, 16);
1806
+ return [
1807
+ n$1 >> 16 & 255,
1808
+ n$1 >> 8 & 255,
1809
+ 255 & n$1
1810
+ ];
1811
+ }, u$2 = (e$1, t$2, r$1) => e$1 ^ t$2 || t$2 ^ r$1 ? 16 + 36 * c(e$1 / 51) + 6 * c(t$2 / 51) + c(r$1 / 51) : 8 > e$1 ? 16 : e$1 > 248 ? 231 : c(24 * (e$1 - 8) / 247) + 232, d$1 = (e$1) => {
1812
+ let t$2, r$1, n$1, l$1, o$1;
1813
+ return 8 > e$1 ? 30 + e$1 : 16 > e$1 ? e$1 - 8 + 90 : (232 > e$1 ? (o$1 = (e$1 -= 16) % 36, t$2 = (e$1 / 36 | 0) / 5, r$1 = (o$1 / 6 | 0) / 5, n$1 = o$1 % 6 / 5) : t$2 = r$1 = n$1 = (10 * (e$1 - 232) + 8) / 255, l$1 = 2 * a$1(t$2, r$1, n$1), l$1 ? 30 + (c(n$1) << 2 | c(r$1) << 1 | c(t$2)) + (2 ^ l$1 ? 0 : 60) : 30);
1814
+ }, g = (() => {
1815
+ let r$1 = (e$1) => o$1.some((t$2) => e$1.test(t$2)), n$1 = globalThis, l$1 = n$1.process ?? {}, o$1 = l$1.argv ?? [], i$2 = l$1.env ?? {}, c$1 = -1;
1816
+ try {
1817
+ e = "," + s(i$2).join(",");
1818
+ } catch (e$1) {
1819
+ i$2 = {}, c$1 = 0;
1820
+ }
1821
+ let a$2 = "FORCE_COLOR", p$1 = {
1822
+ false: 0,
1823
+ 0: 0,
1824
+ 1: 1,
1825
+ 2: 2,
1826
+ 3: 3
1827
+ }[i$2[a$2]] ?? -1, u$3 = a$2 in i$2 && p$1 || r$1(/^--color=?(true|always)?$/);
1828
+ return u$3 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, n$2, l$2) => (t$1 = r$2.TERM, {
1829
+ "24bit": 3,
1830
+ truecolor: 3,
1831
+ ansi256: 2,
1832
+ ansi: 1
1833
+ }[r$2.COLORTERM] || (r$2.CI ? /,GITHUB/.test(e) ? 3 : 1 : n$2 && "dumb" !== t$1 ? l$2 ? 3 : /-256/.test(t$1) ? 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;
1834
+ })(), f = {
1835
+ open: i$1,
1836
+ close: i$1
1837
+ }, h = 39, b = 49, O = {}, m = ({ p: e$1 }, { open: t$2, close: n$1 }) => {
1838
+ let o$1 = (e$2, ...r$1) => {
1839
+ if (!e$2) {
1840
+ if (t$2 && t$2 === n$1) return t$2;
1841
+ if ((e$2 ?? i$1) === i$1) return i$1;
1842
+ }
1843
+ 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;
1844
+ if (s$2.includes("\x1B")) for (; c$2; c$2 = c$2.p) {
1845
+ let { open: e$3, close: t$3 } = c$2, r$2 = t$3.length, n$2 = i$1, o$2 = 0;
1846
+ if (r$2) for (; ~(l$1 = s$2.indexOf(t$3, o$2)); o$2 = l$1 + r$2) n$2 += s$2.slice(o$2, l$1) + e$3;
1847
+ s$2 = n$2 + s$2.slice(o$2);
1848
+ }
1849
+ return a$2 + (s$2.includes("\n") ? s$2.replace(/(\r?\n)/g, p$1 + "$1" + a$2) : s$2) + p$1;
1850
+ }, s$1 = t$2, c$1 = n$1;
1851
+ return e$1 && (s$1 = e$1.o + t$2, c$1 = n$1 + e$1.c), l(o$1, r), o$1.p = {
1852
+ open: t$2,
1853
+ close: n$1,
1854
+ o: s$1,
1855
+ c: c$1,
1856
+ p: e$1
1857
+ }, o$1.open = s$1, o$1.close = c$1, o$1;
1858
+ };
1859
+ const w = function(e$1 = g) {
1860
+ let t$2 = {
1861
+ Ansis: w,
1862
+ level: e$1,
1863
+ isSupported: () => s$1,
1864
+ strip: (e$2) => e$2.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i$1),
1865
+ extend(e$2) {
1866
+ for (let t$3 in e$2) {
1867
+ let r$1 = e$2[t$3], l$1 = (typeof r$1)[0], o$1 = "s" === l$1 ? x(...p(r$1)) : r$1;
1868
+ O[t$3] = "f" === l$1 ? { get() {
1869
+ return (...e$3) => m(this, r$1(...e$3));
1870
+ } } : { get() {
1871
+ let e$3 = m(this, o$1);
1872
+ return n(this, t$3, { value: e$3 }), e$3;
1873
+ } };
1874
+ }
1875
+ return r = o({}, O), l(t$2, r), t$2;
1876
+ }
1877
+ }, s$1 = e$1 > 0, c$1 = (e$2, t$3) => s$1 ? {
1878
+ open: `[${e$2}m`,
1879
+ close: `[${t$3}m`
1880
+ } : f, a$2 = (e$2) => (t$3) => e$2(...p(t$3)), y$1 = (e$2, t$3) => (r$1, n$1, l$1) => c$1(`${e$2}8;2;${r$1};${n$1};${l$1}`, t$3), R = (e$2, t$3) => (r$1, n$1, l$1) => c$1(((e$3, t$4, r$2) => d$1(u$2(e$3, t$4, r$2)))(r$1, n$1, l$1) + e$2, t$3), $ = (e$2) => (t$3, r$1, n$1) => e$2(u$2(t$3, 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);
1881
+ 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));
1882
+ let E, M = {
1883
+ fg: v,
1884
+ bg: C,
1885
+ rgb: x,
1886
+ bgRgb: T,
1887
+ hex: a$2(x),
1888
+ bgHex: a$2(T),
1889
+ visible: f,
1890
+ reset: c$1(0, 0),
1891
+ bold: c$1(1, 22),
1892
+ dim: c$1(2, 22),
1893
+ italic: c$1(3, 23),
1894
+ underline: c$1(4, 24),
1895
+ inverse: c$1(7, 27),
1896
+ hidden: c$1(8, 28),
1897
+ strikethrough: c$1(9, 29)
1898
+ }, I = "Bright";
1899
+ return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map((e$2, t$3) => {
1900
+ E = "bg" + e$2[0].toUpperCase() + e$2.slice(1), 8 > t$3 ? (M[e$2 + I] = c$1(90 + t$3, h), M[E + I] = c$1(100 + t$3, b)) : t$3 = 60, M[e$2] = c$1(30 + t$3, h), M[E] = c$1(40 + t$3, b);
1901
+ }), t$2.extend(M);
1902
+ }, y = new w();
1903
+ module.exports = y, y.default = y;
1904
+ } });
1905
+
1906
+ //#endregion
1907
+ //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.mjs
1908
+ var import_ansis = __toESM(require_ansis(), 1);
1909
+ var ansis_default = import_ansis.default;
1910
+ 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;
1911
+
1757
1912
  //#endregion
1758
1913
  //#region src/utils/validator.ts
1759
1914
  const StringOrRegExpSchema = union([string(), instance(RegExp)]);
@@ -1909,10 +2064,10 @@ const InputOptionsSchema = strictObject({
1909
2064
  literal("browser"),
1910
2065
  literal("neutral"),
1911
2066
  literal("node")
1912
- ])), description(`Platform for which the code should be generated (node, ${colors.underline("browser")}, neutral)`)),
2067
+ ])), description(`Platform for which the code should be generated (node, ${ansis_default.underline("browser")}, neutral)`)),
1913
2068
  shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
1914
2069
  treeshake: optional(TreeshakingOptionsSchema),
1915
- logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${colors.dim("silent")}, ${colors.underline(colors.gray("info"))}, debug, ${colors.yellow("warn")})`)),
2070
+ logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${ansis_default.dim("silent")}, ${ansis_default.underline(ansis_default.gray("info"))}, debug, ${ansis_default.yellow("warn")})`)),
1916
2071
  onLog: optional(OnLogSchema),
1917
2072
  onwarn: optional(OnwarnSchema),
1918
2073
  moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
@@ -1980,7 +2135,11 @@ const AdvancedChunksSchema = strictObject({
1980
2135
  minShareCount: optional(number()),
1981
2136
  groups: optional(array(strictObject({
1982
2137
  name: string(),
1983
- test: optional(union([string(), instance(RegExp)])),
2138
+ test: optional(union([
2139
+ string(),
2140
+ instance(RegExp),
2141
+ pipe(function_(), args(tuple([string()])), returns(union([nullish(boolean()), void_()])))
2142
+ ])),
1984
2143
  priority: optional(number()),
1985
2144
  minSize: optional(number()),
1986
2145
  minShareCount: optional(number()),
@@ -1997,18 +2156,18 @@ const OutputOptionsSchema = strictObject({
1997
2156
  literal("named"),
1998
2157
  literal("default"),
1999
2158
  literal("none")
2000
- ])), description(`Specify a export mode (${colors.underline("auto")}, named, default, none)`)),
2159
+ ])), description(`Specify a export mode (${ansis_default.underline("auto")}, named, default, none)`)),
2001
2160
  hashCharacters: pipe(optional(union([
2002
2161
  literal("base64"),
2003
2162
  literal("base36"),
2004
2163
  literal("hex")
2005
2164
  ])), description("Use the specified character set for file hashes")),
2006
- format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${colors.underline("esm")}, cjs, and iife)`)),
2165
+ format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${ansis_default.underline("esm")}, cjs, and iife)`)),
2007
2166
  sourcemap: pipe(optional(union([
2008
2167
  boolean(),
2009
2168
  literal("inline"),
2010
2169
  literal("hidden")
2011
- ])), description(`Generate sourcemap (\`-s inline\` for inline, or ${colors.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
2170
+ ])), 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")})`)),
2012
2171
  sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
2013
2172
  sourcemapIgnoreList: optional(union([boolean(), custom(() => true)])),
2014
2173
  sourcemapPathTransform: optional(custom(() => true)),
@@ -2047,7 +2206,7 @@ const OutputOptionsSchema = strictObject({
2047
2206
  virtualDirname: optional(string())
2048
2207
  });
2049
2208
  const getAddonDescription = (placement, wrapper) => {
2050
- return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
2209
+ return `Code to insert the ${ansis_default.bold(placement)} of the bundled file (${ansis_default.bold(wrapper)} the wrapper function)`;
2051
2210
  };
2052
2211
  const OutputCliOverrideSchema = strictObject({
2053
2212
  assetFileNames: pipe(optional(string()), description("Name pattern for asset files")),
@@ -2102,7 +2261,7 @@ function validateOption(key, options) {
2102
2261
  const issuePaths = issue.path.map((path$1) => path$1.key);
2103
2262
  let issueMsg = issue.message;
2104
2263
  if (issue.type === "union") {
2105
- const subIssue = issue.issues?.find((i$1) => !(i$1.type !== issue.received && i$1.input === issue.input));
2264
+ const subIssue = issue.issues?.find((i$2) => !(i$2.type !== issue.received && i$2.input === issue.input));
2106
2265
  if (subIssue) {
2107
2266
  if (subIssue.path) issuePaths.push(subIssue.path.map((path$1) => path$1.key));
2108
2267
  issueMsg = subIssue.message;
@@ -2166,8 +2325,8 @@ function bindingifySourcemap(map) {
2166
2325
  file: map.file ?? void 0,
2167
2326
  mappings: map.mappings,
2168
2327
  sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
2169
- sources: map.sources?.map((s) => s ?? void 0),
2170
- sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
2328
+ sources: map.sources?.map((s$1) => s$1 ?? void 0),
2329
+ sourcesContent: map.sourcesContent?.map((s$1) => s$1 ?? void 0),
2171
2330
  names: map.names,
2172
2331
  x_google_ignoreList: map.x_google_ignoreList,
2173
2332
  debugId: "debugId" in map ? map.debugId : void 0
@@ -2177,19 +2336,19 @@ function bindingifySourcemap(map) {
2177
2336
  //#endregion
2178
2337
  //#region src/utils/error.ts
2179
2338
  function normalizeErrors(rawErrors) {
2180
- const errors = rawErrors.map((e) => e instanceof Error ? e : Object.assign(new Error(), {
2181
- kind: e.kind,
2182
- message: e.message,
2339
+ const errors = rawErrors.map((e$1) => e$1 instanceof Error ? e$1 : Object.assign(new Error(), {
2340
+ kind: e$1.kind,
2341
+ message: e$1.message,
2183
2342
  stack: void 0
2184
2343
  }));
2185
2344
  let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
2186
- for (let i$1 = 0; i$1 < errors.length; i$1++) {
2345
+ for (let i$2 = 0; i$2 < errors.length; i$2++) {
2187
2346
  summary += "\n";
2188
- if (i$1 >= 5) {
2347
+ if (i$2 >= 5) {
2189
2348
  summary += "...";
2190
2349
  break;
2191
2350
  }
2192
- summary += getErrorMessage(errors[i$1]);
2351
+ summary += getErrorMessage(errors[i$2]);
2193
2352
  }
2194
2353
  const wrapper = new Error(summary);
2195
2354
  Object.defineProperty(wrapper, "errors", {
@@ -2204,21 +2363,21 @@ function normalizeErrors(rawErrors) {
2204
2363
  });
2205
2364
  return wrapper;
2206
2365
  }
2207
- function getErrorMessage(e) {
2208
- if (Object.hasOwn(e, "kind")) return e.message;
2209
- let s = "";
2210
- if (e.plugin) s += `[plugin ${e.plugin}]`;
2211
- const id$1 = e.id ?? e.loc?.file;
2366
+ function getErrorMessage(e$1) {
2367
+ if (Object.hasOwn(e$1, "kind")) return e$1.message;
2368
+ let s$1 = "";
2369
+ if (e$1.plugin) s$1 += `[plugin ${e$1.plugin}]`;
2370
+ const id$1 = e$1.id ?? e$1.loc?.file;
2212
2371
  if (id$1) {
2213
- s += " " + id$1;
2214
- if (e.loc) s += `:${e.loc.line}:${e.loc.column}`;
2372
+ s$1 += " " + id$1;
2373
+ if (e$1.loc) s$1 += `:${e$1.loc.line}:${e$1.loc.column}`;
2215
2374
  }
2216
- if (s) s += "\n";
2217
- const message = `${e.name ?? "Error"}: ${e.message}`;
2218
- s += message;
2219
- if (e.frame) s = joinNewLine(s, e.frame);
2220
- if (e.stack) s = joinNewLine(s, e.stack.replace(message, ""));
2221
- return s;
2375
+ if (s$1) s$1 += "\n";
2376
+ const message = `${e$1.name ?? "Error"}: ${e$1.message}`;
2377
+ s$1 += message;
2378
+ if (e$1.frame) s$1 = joinNewLine(s$1, e$1.frame);
2379
+ if (e$1.stack) s$1 = joinNewLine(s$1, e$1.stack.replace(message, ""));
2380
+ return s$1;
2222
2381
  }
2223
2382
  function joinNewLine(s1, s2) {
2224
2383
  return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
@@ -2274,49 +2433,49 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
2274
2433
  }
2275
2434
 
2276
2435
  //#endregion
2277
- //#region ../../node_modules/.pnpm/remeda@2.21.6/node_modules/remeda/dist/chunk-D6FCK2GA.js
2278
- function u$1(o, n, a) {
2279
- let t$1 = (r) => o(r, ...n);
2280
- return a === void 0 ? t$1 : Object.assign(t$1, {
2281
- lazy: a,
2282
- lazyArgs: n
2436
+ //#region ../../node_modules/.pnpm/remeda@2.22.3/node_modules/remeda/dist/chunk-D6FCK2GA.js
2437
+ function u$1(o$1, n$1, a$2) {
2438
+ let t$2 = (r$1) => o$1(r$1, ...n$1);
2439
+ return a$2 === void 0 ? t$2 : Object.assign(t$2, {
2440
+ lazy: a$2,
2441
+ lazyArgs: n$1
2283
2442
  });
2284
2443
  }
2285
2444
 
2286
2445
  //#endregion
2287
- //#region ../../node_modules/.pnpm/remeda@2.21.6/node_modules/remeda/dist/chunk-WIMGWYZL.js
2288
- function u(r, n, o) {
2289
- let a = r.length - n.length;
2290
- if (a === 0) return r(...n);
2291
- if (a === 1) return u$1(r, n, o);
2446
+ //#region ../../node_modules/.pnpm/remeda@2.22.3/node_modules/remeda/dist/chunk-WIMGWYZL.js
2447
+ function u(r$1, n$1, o$1) {
2448
+ let a$2 = r$1.length - n$1.length;
2449
+ if (a$2 === 0) return r$1(...n$1);
2450
+ if (a$2 === 1) return u$1(r$1, n$1, o$1);
2292
2451
  throw new Error("Wrong number of arguments");
2293
2452
  }
2294
2453
 
2295
2454
  //#endregion
2296
- //#region ../../node_modules/.pnpm/remeda@2.21.6/node_modules/remeda/dist/chunk-3IFJP4R5.js
2297
- function d(...r) {
2298
- return u(i, r);
2299
- }
2300
- var i = (r, t$1) => {
2301
- let a = [[], []];
2302
- for (let [o, e] of r.entries()) t$1(e, o, r) ? a[0].push(e) : a[1].push(e);
2303
- return a;
2455
+ //#region ../../node_modules/.pnpm/remeda@2.22.3/node_modules/remeda/dist/chunk-3IFJP4R5.js
2456
+ function d(...r$1) {
2457
+ return u(i, r$1);
2458
+ }
2459
+ var i = (r$1, t$2) => {
2460
+ let a$2 = [[], []];
2461
+ for (let [o$1, e$1] of r$1.entries()) t$2(e$1, o$1, r$1) ? a$2[0].push(e$1) : a$2[1].push(e$1);
2462
+ return a$2;
2304
2463
  };
2305
2464
 
2306
2465
  //#endregion
2307
- //#region ../../node_modules/.pnpm/remeda@2.21.6/node_modules/remeda/dist/chunk-5NQBDF4H.js
2308
- function t(...n) {
2309
- return u(Object.keys, n);
2466
+ //#region ../../node_modules/.pnpm/remeda@2.22.3/node_modules/remeda/dist/chunk-5NQBDF4H.js
2467
+ function t(...n$1) {
2468
+ return u(Object.keys, n$1);
2310
2469
  }
2311
2470
 
2312
2471
  //#endregion
2313
2472
  //#region src/plugin/bindingify-hook-filter.ts
2314
2473
  function generalHookFilterMatcherToFilterExprs(matcher, stringKind) {
2315
2474
  if (typeof matcher === "string" || matcher instanceof RegExp) return [include(generateAtomMatcher(stringKind, matcher))];
2316
- if (Array.isArray(matcher)) return matcher.map((m) => include(generateAtomMatcher(stringKind, m)));
2475
+ if (Array.isArray(matcher)) return matcher.map((m$1) => include(generateAtomMatcher(stringKind, m$1)));
2317
2476
  let ret = [];
2318
- if (matcher.exclude) ret.push(...arraify(matcher.exclude).map((m) => exclude(generateAtomMatcher(stringKind, m))));
2319
- if (matcher.include) ret.push(...arraify(matcher.include).map((m) => include(generateAtomMatcher(stringKind, m))));
2477
+ if (matcher.exclude) ret.push(...arraify(matcher.exclude).map((m$1) => exclude(generateAtomMatcher(stringKind, m$1))));
2478
+ if (matcher.include) ret.push(...arraify(matcher.include).map((m$1) => include(generateAtomMatcher(stringKind, m$1))));
2320
2479
  return ret;
2321
2480
  }
2322
2481
  function generateAtomMatcher(kind, matcher) {
@@ -2331,14 +2490,14 @@ function transformFilterMatcherToFilterExprs(filterOption) {
2331
2490
  let idExcludes = [];
2332
2491
  let codeIncludes = [];
2333
2492
  let codeExcludes = [];
2334
- if (id$1) [idIncludes, idExcludes] = d(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m) => m.kind === "include");
2335
- if (code$1) [codeIncludes, codeExcludes] = d(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m) => m.kind === "include");
2493
+ if (id$1) [idIncludes, idExcludes] = d(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m$1) => m$1.kind === "include");
2494
+ if (code$1) [codeIncludes, codeExcludes] = d(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m$1) => m$1.kind === "include");
2336
2495
  ret.push(...idExcludes);
2337
2496
  ret.push(...codeExcludes);
2338
2497
  let andExprList = [];
2339
2498
  if (moduleType$1) {
2340
2499
  let moduleTypes = Array.isArray(moduleType$1) ? moduleType$1 : moduleType$1.include ?? [];
2341
- andExprList.push(or(...moduleTypes.map((m) => moduleType(m))));
2500
+ andExprList.push(or(...moduleTypes.map((m$1) => moduleType(m$1))));
2342
2501
  }
2343
2502
  if (idIncludes.length) andExprList.push(or(...idIncludes.map((item) => item.expr)));
2344
2503
  if (codeIncludes.length) andExprList.push(or(...codeIncludes.map((item) => item.expr)));
@@ -2360,7 +2519,7 @@ function bindingifyFilterExprImpl(expr, list) {
2360
2519
  switch (expr.kind) {
2361
2520
  case "and": {
2362
2521
  let args$1 = expr.args;
2363
- for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
2522
+ for (let i$2 = args$1.length - 1; i$2 >= 0; i$2--) bindingifyFilterExprImpl(args$1[i$2], list);
2364
2523
  list.push({
2365
2524
  kind: "And",
2366
2525
  payload: args$1.length
@@ -2369,7 +2528,7 @@ function bindingifyFilterExprImpl(expr, list) {
2369
2528
  }
2370
2529
  case "or": {
2371
2530
  let args$1 = expr.args;
2372
- for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
2531
+ for (let i$2 = args$1.length - 1; i$2 >= 0; i$2--) bindingifyFilterExprImpl(args$1[i$2], list);
2373
2532
  list.push({
2374
2533
  kind: "Or",
2375
2534
  payload: args$1.length
@@ -2507,10 +2666,10 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2507
2666
  data.loadModulePromiseMap.set(id$1, promise$1);
2508
2667
  try {
2509
2668
  await context.load(id$1, bindingifySideEffects(options.moduleSideEffects));
2510
- } catch (e) {
2669
+ } catch (e$1) {
2511
2670
  data.loadModulePromiseMap.delete(id$1);
2512
2671
  data.loadModulePromiseResolveFnMap.delete(id$1);
2513
- throw e;
2672
+ throw e$1;
2514
2673
  }
2515
2674
  return promise$1;
2516
2675
  }
@@ -2585,12 +2744,12 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
2585
2744
  this.warn = getLogHandler$1(this.warn);
2586
2745
  this.info = getLogHandler$1(this.info);
2587
2746
  }
2588
- error(e, pos) {
2589
- if (typeof e === "string") e = { message: e };
2590
- if (pos) augmentCodeLocation(e, pos, this.moduleSource, this.moduleId);
2591
- e.id = this.moduleId;
2592
- e.hook = "transform";
2593
- return error(logPluginError(normalizeLog(e), this.pluginName));
2747
+ error(e$1, pos) {
2748
+ if (typeof e$1 === "string") e$1 = { message: e$1 };
2749
+ if (pos) augmentCodeLocation(e$1, pos, this.moduleSource, this.moduleId);
2750
+ e$1.id = this.moduleId;
2751
+ e$1.hook = "transform";
2752
+ return error(logPluginError(normalizeLog(e$1), this.pluginName));
2594
2753
  }
2595
2754
  getCombinedSourcemap() {
2596
2755
  return JSON.parse(this.inner.getCombinedSourcemap());
@@ -2818,9 +2977,9 @@ function transformRenderedChunk(chunk) {
2818
2977
  }
2819
2978
  function transformChunkModules(modules) {
2820
2979
  const result = {};
2821
- for (let i$1 = 0; i$1 < modules.values.length; i$1++) {
2822
- let key = modules.keys[i$1];
2823
- const mod = modules.values[i$1];
2980
+ for (let i$2 = 0; i$2 < modules.values.length; i$2++) {
2981
+ let key = modules.keys[i$2];
2982
+ const mod = modules.values[i$2];
2824
2983
  result[key] = transformToRenderedModule(mod);
2825
2984
  }
2826
2985
  return result;
@@ -3068,20 +3227,20 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
3068
3227
  };
3069
3228
  const cache = {};
3070
3229
  return new Proxy(chunk, {
3071
- get(target, p) {
3072
- if (p in cache) return cache[p];
3073
- const value = target[p];
3074
- cache[p] = value;
3230
+ get(target, p$1) {
3231
+ if (p$1 in cache) return cache[p$1];
3232
+ const value = target[p$1];
3233
+ cache[p$1] = value;
3075
3234
  return value;
3076
3235
  },
3077
- set(target, p, newValue) {
3078
- cache[p] = newValue;
3236
+ set(target, p$1, newValue) {
3237
+ cache[p$1] = newValue;
3079
3238
  changed?.updated.add(bindingChunk.fileName);
3080
3239
  return true;
3081
3240
  },
3082
- has(target, p) {
3083
- if (p in cache) return true;
3084
- return p in target;
3241
+ has(target, p$1) {
3242
+ if (p$1 in cache) return true;
3243
+ return p$1 in target;
3085
3244
  }
3086
3245
  });
3087
3246
  }
@@ -3099,14 +3258,14 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
3099
3258
  };
3100
3259
  const cache = {};
3101
3260
  return new Proxy(asset, {
3102
- get(target, p) {
3103
- if (p in cache) return cache[p];
3104
- const value = target[p];
3105
- cache[p] = value;
3261
+ get(target, p$1) {
3262
+ if (p$1 in cache) return cache[p$1];
3263
+ const value = target[p$1];
3264
+ cache[p$1] = value;
3106
3265
  return value;
3107
3266
  },
3108
- set(target, p, newValue) {
3109
- cache[p] = newValue;
3267
+ set(target, p$1, newValue) {
3268
+ cache[p$1] = newValue;
3110
3269
  changed?.updated.add(bindingAsset.fileName);
3111
3270
  return true;
3112
3271
  }
@@ -3510,8 +3669,8 @@ function wrapHandlers(plugin) {
3510
3669
  if (handler) plugin[hookName] = async (...args$1) => {
3511
3670
  try {
3512
3671
  return await handler(...args$1);
3513
- } catch (e) {
3514
- return error(logPluginError(e, plugin.name, {
3672
+ } catch (e$1) {
3673
+ return error(logPluginError(e$1, plugin.name, {
3515
3674
  hook: hookName,
3516
3675
  id: hookName === "transform" ? args$1[2] : void 0
3517
3676
  }));
@@ -4142,7 +4301,7 @@ async function initializeParallelPlugins(plugins) {
4142
4301
  };
4143
4302
  }
4144
4303
  function initializeWorkers(registryId, count, pluginInfos) {
4145
- return Promise.all(Array.from({ length: count }, (_, i$1) => initializeWorker(registryId, pluginInfos, i$1)));
4304
+ return Promise.all(Array.from({ length: count }, (_, i$2) => initializeWorker(registryId, pluginInfos, i$2)));
4146
4305
  }
4147
4306
  async function initializeWorker(registryId, pluginInfos, threadNumber) {
4148
4307
  const urlString = import.meta.resolve("#parallel-plugin-worker");
@@ -4162,9 +4321,9 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
4162
4321
  });
4163
4322
  });
4164
4323
  return worker;
4165
- } catch (e) {
4324
+ } catch (e$1) {
4166
4325
  worker?.terminate();
4167
- throw e;
4326
+ throw e$1;
4168
4327
  }
4169
4328
  }
4170
4329
  const availableParallelism = () => {
@@ -4207,9 +4366,9 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode, isCl
4207
4366
  onLog,
4208
4367
  stopWorkers: parallelPluginInitResult?.stopWorkers
4209
4368
  };
4210
- } catch (e) {
4369
+ } catch (e$1) {
4211
4370
  await parallelPluginInitResult?.stopWorkers();
4212
- throw e;
4371
+ throw e$1;
4213
4372
  }
4214
4373
  }
4215
4374
 
@@ -4228,9 +4387,9 @@ async function createBundler(inputOptions, outputOptions, isClose) {
4228
4387
  asyncRuntimeShutdown = true;
4229
4388
  }
4230
4389
  };
4231
- } catch (e) {
4390
+ } catch (e$1) {
4232
4391
  await option.stopWorkers?.();
4233
- throw e;
4392
+ throw e$1;
4234
4393
  }
4235
4394
  }
4236
4395
 
@@ -4446,4 +4605,4 @@ function defineConfig(config) {
4446
4605
  const VERSION = version;
4447
4606
 
4448
4607
  //#endregion
4449
- export { BuiltinPlugin, PluginContextData, VERSION, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, description$1 as description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
4608
+ export { BuiltinPlugin, PluginContextData, VERSION, __commonJS, __toESM, ansis_default, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, description$1 as description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };