@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,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_src = require('./src-DYeE276c.cjs');
2
+ const require_src = require('./src-Cd6dJVwS.cjs');
3
3
  const node_path = require_chunk.__toESM(require("node:path"));
4
4
  const node_url = require_chunk.__toESM(require("node:url"));
5
5
  const node_process = require_chunk.__toESM(require("node:process"));
@@ -1,4 +1,4 @@
1
- import { rolldown } from "./src-CrAobyBl.mjs";
1
+ import { rolldown } from "./src-Mp5z-lgE.mjs";
2
2
  import path from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import { cwd } from "node:process";
@@ -4,12 +4,11 @@ const require_parse_ast_index = require('./parse-ast-index-BuelS_NF.cjs');
4
4
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("../rolldown-binding.wasi.cjs"));
5
5
  const node_path = require_chunk.__toESM(require("node:path"));
6
6
  const node_url = require_chunk.__toESM(require("node:url"));
7
- const ansis = require_chunk.__toESM(require("ansis"));
8
7
  const node_os = require_chunk.__toESM(require("node:os"));
9
8
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
10
9
 
11
10
  //#region package.json
12
- var version = "1.0.0-beta.10-commit.ac4e5db";
11
+ var version = "1.0.0-beta.10-commit.81375fe";
13
12
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
14
13
 
15
14
  //#endregion
@@ -348,8 +347,8 @@ var MinimalPluginContextImpl = class {
348
347
  watchMode
349
348
  };
350
349
  }
351
- error(e) {
352
- return require_parse_ast_index.error(require_parse_ast_index.logPluginError(normalizeLog(e), this.pluginName, { hook: this.hookName }));
350
+ error(e$1) {
351
+ return require_parse_ast_index.error(require_parse_ast_index.logPluginError(normalizeLog(e$1), this.pluginName, { hook: this.hookName }));
353
352
  }
354
353
  };
355
354
 
@@ -1323,6 +1322,25 @@ function unionAsync(options, message2) {
1323
1322
  };
1324
1323
  }
1325
1324
  /* @__NO_SIDE_EFFECTS__ */
1325
+ function void_(message2) {
1326
+ return {
1327
+ kind: "schema",
1328
+ type: "void",
1329
+ reference: void_,
1330
+ expects: "void",
1331
+ async: false,
1332
+ message: message2,
1333
+ get "~standard"() {
1334
+ return /* @__PURE__ */ _getStandardProps(this);
1335
+ },
1336
+ "~run"(dataset, config2) {
1337
+ if (dataset.value === void 0) dataset.typed = true;
1338
+ else _addIssue(this, "type", dataset, config2);
1339
+ return dataset;
1340
+ }
1341
+ };
1342
+ }
1343
+ /* @__NO_SIDE_EFFECTS__ */
1326
1344
  function keyof(schema, message2) {
1327
1345
  return /* @__PURE__ */ picklist(Object.keys(schema.entries), message2);
1328
1346
  }
@@ -1755,6 +1773,117 @@ function toJsonSchema(schema, config) {
1755
1773
  return jsonSchema;
1756
1774
  }
1757
1775
 
1776
+ //#endregion
1777
+ //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs
1778
+ var require_ansis = require_chunk.__commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs"(exports, module) {
1779
+ 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) => {
1780
+ 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);
1781
+ return [
1782
+ n$1 >> 16 & 255,
1783
+ n$1 >> 8 & 255,
1784
+ 255 & n$1
1785
+ ];
1786
+ }, 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) => {
1787
+ let t$2, r$1, n$1, l$1, o$1;
1788
+ 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);
1789
+ }, g = (() => {
1790
+ 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;
1791
+ try {
1792
+ e = "," + s(i$2).join(",");
1793
+ } catch (e$1) {
1794
+ i$2 = {}, c$1 = 0;
1795
+ }
1796
+ let a$2 = "FORCE_COLOR", p$1 = {
1797
+ false: 0,
1798
+ 0: 0,
1799
+ 1: 1,
1800
+ 2: 2,
1801
+ 3: 3
1802
+ }[i$2[a$2]] ?? -1, u$3 = a$2 in i$2 && p$1 || r$1(/^--color=?(true|always)?$/);
1803
+ return u$3 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, n$2, l$2) => (t$1 = r$2.TERM, {
1804
+ "24bit": 3,
1805
+ truecolor: 3,
1806
+ ansi256: 2,
1807
+ ansi: 1
1808
+ }[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;
1809
+ })(), f = {
1810
+ open: i$1,
1811
+ close: i$1
1812
+ }, h = 39, b = 49, O = {}, m = ({ p: e$1 }, { open: t$2, close: n$1 }) => {
1813
+ let o$1 = (e$2, ...r$1) => {
1814
+ if (!e$2) {
1815
+ if (t$2 && t$2 === n$1) return t$2;
1816
+ if ((e$2 ?? i$1) === i$1) return i$1;
1817
+ }
1818
+ 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;
1819
+ if (s$2.includes("\x1B")) for (; c$2; c$2 = c$2.p) {
1820
+ let { open: e$3, close: t$3 } = c$2, r$2 = t$3.length, n$2 = i$1, o$2 = 0;
1821
+ 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;
1822
+ s$2 = n$2 + s$2.slice(o$2);
1823
+ }
1824
+ return a$2 + (s$2.includes("\n") ? s$2.replace(/(\r?\n)/g, p$1 + "$1" + a$2) : s$2) + p$1;
1825
+ }, s$1 = t$2, c$1 = n$1;
1826
+ return e$1 && (s$1 = e$1.o + t$2, c$1 = n$1 + e$1.c), l(o$1, r), o$1.p = {
1827
+ open: t$2,
1828
+ close: n$1,
1829
+ o: s$1,
1830
+ c: c$1,
1831
+ p: e$1
1832
+ }, o$1.open = s$1, o$1.close = c$1, o$1;
1833
+ };
1834
+ const w = function(e$1 = g) {
1835
+ let t$2 = {
1836
+ Ansis: w,
1837
+ level: e$1,
1838
+ isSupported: () => s$1,
1839
+ strip: (e$2) => e$2.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i$1),
1840
+ extend(e$2) {
1841
+ for (let t$3 in e$2) {
1842
+ let r$1 = e$2[t$3], l$1 = (typeof r$1)[0], o$1 = "s" === l$1 ? x(...p(r$1)) : r$1;
1843
+ O[t$3] = "f" === l$1 ? { get() {
1844
+ return (...e$3) => m(this, r$1(...e$3));
1845
+ } } : { get() {
1846
+ let e$3 = m(this, o$1);
1847
+ return n(this, t$3, { value: e$3 }), e$3;
1848
+ } };
1849
+ }
1850
+ return r = o({}, O), l(t$2, r), t$2;
1851
+ }
1852
+ }, s$1 = e$1 > 0, c$1 = (e$2, t$3) => s$1 ? {
1853
+ open: `[${e$2}m`,
1854
+ close: `[${t$3}m`
1855
+ } : 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);
1856
+ 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));
1857
+ let E, M = {
1858
+ fg: v,
1859
+ bg: C,
1860
+ rgb: x,
1861
+ bgRgb: T,
1862
+ hex: a$2(x),
1863
+ bgHex: a$2(T),
1864
+ visible: f,
1865
+ reset: c$1(0, 0),
1866
+ bold: c$1(1, 22),
1867
+ dim: c$1(2, 22),
1868
+ italic: c$1(3, 23),
1869
+ underline: c$1(4, 24),
1870
+ inverse: c$1(7, 27),
1871
+ hidden: c$1(8, 28),
1872
+ strikethrough: c$1(9, 29)
1873
+ }, I = "Bright";
1874
+ return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map((e$2, t$3) => {
1875
+ 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);
1876
+ }), t$2.extend(M);
1877
+ }, y = new w();
1878
+ module.exports = y, y.default = y;
1879
+ } });
1880
+
1881
+ //#endregion
1882
+ //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.mjs
1883
+ var import_ansis = require_chunk.__toESM(require_ansis(), 1);
1884
+ var ansis_default = import_ansis.default;
1885
+ 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;
1886
+
1758
1887
  //#endregion
1759
1888
  //#region src/utils/validator.ts
1760
1889
  const StringOrRegExpSchema = union([string(), instance(RegExp)]);
@@ -1910,10 +2039,10 @@ const InputOptionsSchema = strictObject({
1910
2039
  literal("browser"),
1911
2040
  literal("neutral"),
1912
2041
  literal("node")
1913
- ])), description(`Platform for which the code should be generated (node, ${ansis.default.underline("browser")}, neutral)`)),
2042
+ ])), description(`Platform for which the code should be generated (node, ${ansis_default.underline("browser")}, neutral)`)),
1914
2043
  shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
1915
2044
  treeshake: optional(TreeshakingOptionsSchema),
1916
- logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${ansis.default.dim("silent")}, ${ansis.default.underline(ansis.default.gray("info"))}, debug, ${ansis.default.yellow("warn")})`)),
2045
+ logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${ansis_default.dim("silent")}, ${ansis_default.underline(ansis_default.gray("info"))}, debug, ${ansis_default.yellow("warn")})`)),
1917
2046
  onLog: optional(OnLogSchema),
1918
2047
  onwarn: optional(OnwarnSchema),
1919
2048
  moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
@@ -1981,7 +2110,11 @@ const AdvancedChunksSchema = strictObject({
1981
2110
  minShareCount: optional(number()),
1982
2111
  groups: optional(array(strictObject({
1983
2112
  name: string(),
1984
- test: optional(union([string(), instance(RegExp)])),
2113
+ test: optional(union([
2114
+ string(),
2115
+ instance(RegExp),
2116
+ pipe(function_(), args(tuple([string()])), returns(union([nullish(boolean()), void_()])))
2117
+ ])),
1985
2118
  priority: optional(number()),
1986
2119
  minSize: optional(number()),
1987
2120
  minShareCount: optional(number()),
@@ -1998,18 +2131,18 @@ const OutputOptionsSchema = strictObject({
1998
2131
  literal("named"),
1999
2132
  literal("default"),
2000
2133
  literal("none")
2001
- ])), description(`Specify a export mode (${ansis.default.underline("auto")}, named, default, none)`)),
2134
+ ])), description(`Specify a export mode (${ansis_default.underline("auto")}, named, default, none)`)),
2002
2135
  hashCharacters: pipe(optional(union([
2003
2136
  literal("base64"),
2004
2137
  literal("base36"),
2005
2138
  literal("hex")
2006
2139
  ])), description("Use the specified character set for file hashes")),
2007
- format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${ansis.default.underline("esm")}, cjs, and iife)`)),
2140
+ format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${ansis_default.underline("esm")}, cjs, and iife)`)),
2008
2141
  sourcemap: pipe(optional(union([
2009
2142
  boolean(),
2010
2143
  literal("inline"),
2011
2144
  literal("hidden")
2012
- ])), 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")})`)),
2145
+ ])), 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")})`)),
2013
2146
  sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
2014
2147
  sourcemapIgnoreList: optional(union([boolean(), custom(() => true)])),
2015
2148
  sourcemapPathTransform: optional(custom(() => true)),
@@ -2048,7 +2181,7 @@ const OutputOptionsSchema = strictObject({
2048
2181
  virtualDirname: optional(string())
2049
2182
  });
2050
2183
  const getAddonDescription = (placement, wrapper) => {
2051
- return `Code to insert the ${ansis.default.bold(placement)} of the bundled file (${ansis.default.bold(wrapper)} the wrapper function)`;
2184
+ return `Code to insert the ${ansis_default.bold(placement)} of the bundled file (${ansis_default.bold(wrapper)} the wrapper function)`;
2052
2185
  };
2053
2186
  const OutputCliOverrideSchema = strictObject({
2054
2187
  assetFileNames: pipe(optional(string()), description("Name pattern for asset files")),
@@ -2103,7 +2236,7 @@ function validateOption(key, options) {
2103
2236
  const issuePaths = issue.path.map((path$2) => path$2.key);
2104
2237
  let issueMsg = issue.message;
2105
2238
  if (issue.type === "union") {
2106
- const subIssue = issue.issues?.find((i$1) => !(i$1.type !== issue.received && i$1.input === issue.input));
2239
+ const subIssue = issue.issues?.find((i$2) => !(i$2.type !== issue.received && i$2.input === issue.input));
2107
2240
  if (subIssue) {
2108
2241
  if (subIssue.path) issuePaths.push(subIssue.path.map((path$2) => path$2.key));
2109
2242
  issueMsg = subIssue.message;
@@ -2167,8 +2300,8 @@ function bindingifySourcemap(map) {
2167
2300
  file: map.file ?? void 0,
2168
2301
  mappings: map.mappings,
2169
2302
  sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
2170
- sources: map.sources?.map((s) => s ?? void 0),
2171
- sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
2303
+ sources: map.sources?.map((s$1) => s$1 ?? void 0),
2304
+ sourcesContent: map.sourcesContent?.map((s$1) => s$1 ?? void 0),
2172
2305
  names: map.names,
2173
2306
  x_google_ignoreList: map.x_google_ignoreList,
2174
2307
  debugId: "debugId" in map ? map.debugId : void 0
@@ -2178,19 +2311,19 @@ function bindingifySourcemap(map) {
2178
2311
  //#endregion
2179
2312
  //#region src/utils/error.ts
2180
2313
  function normalizeErrors(rawErrors) {
2181
- const errors = rawErrors.map((e) => e instanceof Error ? e : Object.assign(new Error(), {
2182
- kind: e.kind,
2183
- message: e.message,
2314
+ const errors = rawErrors.map((e$1) => e$1 instanceof Error ? e$1 : Object.assign(new Error(), {
2315
+ kind: e$1.kind,
2316
+ message: e$1.message,
2184
2317
  stack: void 0
2185
2318
  }));
2186
2319
  let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
2187
- for (let i$1 = 0; i$1 < errors.length; i$1++) {
2320
+ for (let i$2 = 0; i$2 < errors.length; i$2++) {
2188
2321
  summary += "\n";
2189
- if (i$1 >= 5) {
2322
+ if (i$2 >= 5) {
2190
2323
  summary += "...";
2191
2324
  break;
2192
2325
  }
2193
- summary += getErrorMessage(errors[i$1]);
2326
+ summary += getErrorMessage(errors[i$2]);
2194
2327
  }
2195
2328
  const wrapper = new Error(summary);
2196
2329
  Object.defineProperty(wrapper, "errors", {
@@ -2205,21 +2338,21 @@ function normalizeErrors(rawErrors) {
2205
2338
  });
2206
2339
  return wrapper;
2207
2340
  }
2208
- function getErrorMessage(e) {
2209
- if (Object.hasOwn(e, "kind")) return e.message;
2210
- let s = "";
2211
- if (e.plugin) s += `[plugin ${e.plugin}]`;
2212
- const id$1 = e.id ?? e.loc?.file;
2341
+ function getErrorMessage(e$1) {
2342
+ if (Object.hasOwn(e$1, "kind")) return e$1.message;
2343
+ let s$1 = "";
2344
+ if (e$1.plugin) s$1 += `[plugin ${e$1.plugin}]`;
2345
+ const id$1 = e$1.id ?? e$1.loc?.file;
2213
2346
  if (id$1) {
2214
- s += " " + id$1;
2215
- if (e.loc) s += `:${e.loc.line}:${e.loc.column}`;
2347
+ s$1 += " " + id$1;
2348
+ if (e$1.loc) s$1 += `:${e$1.loc.line}:${e$1.loc.column}`;
2216
2349
  }
2217
- if (s) s += "\n";
2218
- const message = `${e.name ?? "Error"}: ${e.message}`;
2219
- s += message;
2220
- if (e.frame) s = joinNewLine(s, e.frame);
2221
- if (e.stack) s = joinNewLine(s, e.stack.replace(message, ""));
2222
- return s;
2350
+ if (s$1) s$1 += "\n";
2351
+ const message = `${e$1.name ?? "Error"}: ${e$1.message}`;
2352
+ s$1 += message;
2353
+ if (e$1.frame) s$1 = joinNewLine(s$1, e$1.frame);
2354
+ if (e$1.stack) s$1 = joinNewLine(s$1, e$1.stack.replace(message, ""));
2355
+ return s$1;
2223
2356
  }
2224
2357
  function joinNewLine(s1, s2) {
2225
2358
  return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
@@ -2275,49 +2408,49 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
2275
2408
  }
2276
2409
 
2277
2410
  //#endregion
2278
- //#region ../../node_modules/.pnpm/remeda@2.21.6/node_modules/remeda/dist/chunk-D6FCK2GA.js
2279
- function u$1(o, n, a) {
2280
- let t$1 = (r) => o(r, ...n);
2281
- return a === void 0 ? t$1 : Object.assign(t$1, {
2282
- lazy: a,
2283
- lazyArgs: n
2411
+ //#region ../../node_modules/.pnpm/remeda@2.22.3/node_modules/remeda/dist/chunk-D6FCK2GA.js
2412
+ function u$1(o$1, n$1, a$2) {
2413
+ let t$2 = (r$1) => o$1(r$1, ...n$1);
2414
+ return a$2 === void 0 ? t$2 : Object.assign(t$2, {
2415
+ lazy: a$2,
2416
+ lazyArgs: n$1
2284
2417
  });
2285
2418
  }
2286
2419
 
2287
2420
  //#endregion
2288
- //#region ../../node_modules/.pnpm/remeda@2.21.6/node_modules/remeda/dist/chunk-WIMGWYZL.js
2289
- function u(r, n, o) {
2290
- let a = r.length - n.length;
2291
- if (a === 0) return r(...n);
2292
- if (a === 1) return u$1(r, n, o);
2421
+ //#region ../../node_modules/.pnpm/remeda@2.22.3/node_modules/remeda/dist/chunk-WIMGWYZL.js
2422
+ function u(r$1, n$1, o$1) {
2423
+ let a$2 = r$1.length - n$1.length;
2424
+ if (a$2 === 0) return r$1(...n$1);
2425
+ if (a$2 === 1) return u$1(r$1, n$1, o$1);
2293
2426
  throw new Error("Wrong number of arguments");
2294
2427
  }
2295
2428
 
2296
2429
  //#endregion
2297
- //#region ../../node_modules/.pnpm/remeda@2.21.6/node_modules/remeda/dist/chunk-3IFJP4R5.js
2298
- function d(...r) {
2299
- return u(i, r);
2300
- }
2301
- var i = (r, t$1) => {
2302
- let a = [[], []];
2303
- for (let [o, e] of r.entries()) t$1(e, o, r) ? a[0].push(e) : a[1].push(e);
2304
- return a;
2430
+ //#region ../../node_modules/.pnpm/remeda@2.22.3/node_modules/remeda/dist/chunk-3IFJP4R5.js
2431
+ function d(...r$1) {
2432
+ return u(i, r$1);
2433
+ }
2434
+ var i = (r$1, t$2) => {
2435
+ let a$2 = [[], []];
2436
+ 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);
2437
+ return a$2;
2305
2438
  };
2306
2439
 
2307
2440
  //#endregion
2308
- //#region ../../node_modules/.pnpm/remeda@2.21.6/node_modules/remeda/dist/chunk-5NQBDF4H.js
2309
- function t(...n) {
2310
- return u(Object.keys, n);
2441
+ //#region ../../node_modules/.pnpm/remeda@2.22.3/node_modules/remeda/dist/chunk-5NQBDF4H.js
2442
+ function t(...n$1) {
2443
+ return u(Object.keys, n$1);
2311
2444
  }
2312
2445
 
2313
2446
  //#endregion
2314
2447
  //#region src/plugin/bindingify-hook-filter.ts
2315
2448
  function generalHookFilterMatcherToFilterExprs(matcher, stringKind) {
2316
2449
  if (typeof matcher === "string" || matcher instanceof RegExp) return [require_dist.include(generateAtomMatcher(stringKind, matcher))];
2317
- if (Array.isArray(matcher)) return matcher.map((m) => require_dist.include(generateAtomMatcher(stringKind, m)));
2450
+ if (Array.isArray(matcher)) return matcher.map((m$1) => require_dist.include(generateAtomMatcher(stringKind, m$1)));
2318
2451
  let ret = [];
2319
- if (matcher.exclude) ret.push(...require_dist.arraify(matcher.exclude).map((m) => require_dist.exclude(generateAtomMatcher(stringKind, m))));
2320
- if (matcher.include) ret.push(...require_dist.arraify(matcher.include).map((m) => require_dist.include(generateAtomMatcher(stringKind, m))));
2452
+ if (matcher.exclude) ret.push(...require_dist.arraify(matcher.exclude).map((m$1) => require_dist.exclude(generateAtomMatcher(stringKind, m$1))));
2453
+ if (matcher.include) ret.push(...require_dist.arraify(matcher.include).map((m$1) => require_dist.include(generateAtomMatcher(stringKind, m$1))));
2321
2454
  return ret;
2322
2455
  }
2323
2456
  function generateAtomMatcher(kind, matcher) {
@@ -2332,14 +2465,14 @@ function transformFilterMatcherToFilterExprs(filterOption) {
2332
2465
  let idExcludes = [];
2333
2466
  let codeIncludes = [];
2334
2467
  let codeExcludes = [];
2335
- if (id$1) [idIncludes, idExcludes] = d(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m) => m.kind === "include");
2336
- if (code$1) [codeIncludes, codeExcludes] = d(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m) => m.kind === "include");
2468
+ if (id$1) [idIncludes, idExcludes] = d(generalHookFilterMatcherToFilterExprs(id$1, "id") ?? [], (m$1) => m$1.kind === "include");
2469
+ if (code$1) [codeIncludes, codeExcludes] = d(generalHookFilterMatcherToFilterExprs(code$1, "code") ?? [], (m$1) => m$1.kind === "include");
2337
2470
  ret.push(...idExcludes);
2338
2471
  ret.push(...codeExcludes);
2339
2472
  let andExprList = [];
2340
2473
  if (moduleType$1) {
2341
2474
  let moduleTypes = Array.isArray(moduleType$1) ? moduleType$1 : moduleType$1.include ?? [];
2342
- andExprList.push(require_dist.or(...moduleTypes.map((m) => require_dist.moduleType(m))));
2475
+ andExprList.push(require_dist.or(...moduleTypes.map((m$1) => require_dist.moduleType(m$1))));
2343
2476
  }
2344
2477
  if (idIncludes.length) andExprList.push(require_dist.or(...idIncludes.map((item) => item.expr)));
2345
2478
  if (codeIncludes.length) andExprList.push(require_dist.or(...codeIncludes.map((item) => item.expr)));
@@ -2361,7 +2494,7 @@ function bindingifyFilterExprImpl(expr, list) {
2361
2494
  switch (expr.kind) {
2362
2495
  case "and": {
2363
2496
  let args$1 = expr.args;
2364
- for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
2497
+ for (let i$2 = args$1.length - 1; i$2 >= 0; i$2--) bindingifyFilterExprImpl(args$1[i$2], list);
2365
2498
  list.push({
2366
2499
  kind: "And",
2367
2500
  payload: args$1.length
@@ -2370,7 +2503,7 @@ function bindingifyFilterExprImpl(expr, list) {
2370
2503
  }
2371
2504
  case "or": {
2372
2505
  let args$1 = expr.args;
2373
- for (let i$1 = args$1.length - 1; i$1 >= 0; i$1--) bindingifyFilterExprImpl(args$1[i$1], list);
2506
+ for (let i$2 = args$1.length - 1; i$2 >= 0; i$2--) bindingifyFilterExprImpl(args$1[i$2], list);
2374
2507
  list.push({
2375
2508
  kind: "Or",
2376
2509
  payload: args$1.length
@@ -2508,10 +2641,10 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2508
2641
  data.loadModulePromiseMap.set(id$1, promise$1);
2509
2642
  try {
2510
2643
  await context.load(id$1, bindingifySideEffects(options.moduleSideEffects));
2511
- } catch (e) {
2644
+ } catch (e$1) {
2512
2645
  data.loadModulePromiseMap.delete(id$1);
2513
2646
  data.loadModulePromiseResolveFnMap.delete(id$1);
2514
- throw e;
2647
+ throw e$1;
2515
2648
  }
2516
2649
  return promise$1;
2517
2650
  }
@@ -2586,12 +2719,12 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
2586
2719
  this.warn = getLogHandler$1(this.warn);
2587
2720
  this.info = getLogHandler$1(this.info);
2588
2721
  }
2589
- error(e, pos) {
2590
- if (typeof e === "string") e = { message: e };
2591
- if (pos) require_parse_ast_index.augmentCodeLocation(e, pos, this.moduleSource, this.moduleId);
2592
- e.id = this.moduleId;
2593
- e.hook = "transform";
2594
- return require_parse_ast_index.error(require_parse_ast_index.logPluginError(normalizeLog(e), this.pluginName));
2722
+ error(e$1, pos) {
2723
+ if (typeof e$1 === "string") e$1 = { message: e$1 };
2724
+ if (pos) require_parse_ast_index.augmentCodeLocation(e$1, pos, this.moduleSource, this.moduleId);
2725
+ e$1.id = this.moduleId;
2726
+ e$1.hook = "transform";
2727
+ return require_parse_ast_index.error(require_parse_ast_index.logPluginError(normalizeLog(e$1), this.pluginName));
2595
2728
  }
2596
2729
  getCombinedSourcemap() {
2597
2730
  return JSON.parse(this.inner.getCombinedSourcemap());
@@ -2819,9 +2952,9 @@ function transformRenderedChunk(chunk) {
2819
2952
  }
2820
2953
  function transformChunkModules(modules) {
2821
2954
  const result = {};
2822
- for (let i$1 = 0; i$1 < modules.values.length; i$1++) {
2823
- let key = modules.keys[i$1];
2824
- const mod = modules.values[i$1];
2955
+ for (let i$2 = 0; i$2 < modules.values.length; i$2++) {
2956
+ let key = modules.keys[i$2];
2957
+ const mod = modules.values[i$2];
2825
2958
  result[key] = transformToRenderedModule(mod);
2826
2959
  }
2827
2960
  return result;
@@ -3069,20 +3202,20 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
3069
3202
  };
3070
3203
  const cache = {};
3071
3204
  return new Proxy(chunk, {
3072
- get(target, p) {
3073
- if (p in cache) return cache[p];
3074
- const value = target[p];
3075
- cache[p] = value;
3205
+ get(target, p$1) {
3206
+ if (p$1 in cache) return cache[p$1];
3207
+ const value = target[p$1];
3208
+ cache[p$1] = value;
3076
3209
  return value;
3077
3210
  },
3078
- set(target, p, newValue) {
3079
- cache[p] = newValue;
3211
+ set(target, p$1, newValue) {
3212
+ cache[p$1] = newValue;
3080
3213
  changed?.updated.add(bindingChunk.fileName);
3081
3214
  return true;
3082
3215
  },
3083
- has(target, p) {
3084
- if (p in cache) return true;
3085
- return p in target;
3216
+ has(target, p$1) {
3217
+ if (p$1 in cache) return true;
3218
+ return p$1 in target;
3086
3219
  }
3087
3220
  });
3088
3221
  }
@@ -3100,14 +3233,14 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
3100
3233
  };
3101
3234
  const cache = {};
3102
3235
  return new Proxy(asset, {
3103
- get(target, p) {
3104
- if (p in cache) return cache[p];
3105
- const value = target[p];
3106
- cache[p] = value;
3236
+ get(target, p$1) {
3237
+ if (p$1 in cache) return cache[p$1];
3238
+ const value = target[p$1];
3239
+ cache[p$1] = value;
3107
3240
  return value;
3108
3241
  },
3109
- set(target, p, newValue) {
3110
- cache[p] = newValue;
3242
+ set(target, p$1, newValue) {
3243
+ cache[p$1] = newValue;
3111
3244
  changed?.updated.add(bindingAsset.fileName);
3112
3245
  return true;
3113
3246
  }
@@ -3511,8 +3644,8 @@ function wrapHandlers(plugin) {
3511
3644
  if (handler) plugin[hookName] = async (...args$1) => {
3512
3645
  try {
3513
3646
  return await handler(...args$1);
3514
- } catch (e) {
3515
- return require_parse_ast_index.error(require_parse_ast_index.logPluginError(e, plugin.name, {
3647
+ } catch (e$1) {
3648
+ return require_parse_ast_index.error(require_parse_ast_index.logPluginError(e$1, plugin.name, {
3516
3649
  hook: hookName,
3517
3650
  id: hookName === "transform" ? args$1[2] : void 0
3518
3651
  }));
@@ -4143,7 +4276,7 @@ async function initializeParallelPlugins(plugins) {
4143
4276
  };
4144
4277
  }
4145
4278
  function initializeWorkers(registryId, count, pluginInfos) {
4146
- return Promise.all(Array.from({ length: count }, (_, i$1) => initializeWorker(registryId, pluginInfos, i$1)));
4279
+ return Promise.all(Array.from({ length: count }, (_, i$2) => initializeWorker(registryId, pluginInfos, i$2)));
4147
4280
  }
4148
4281
  async function initializeWorker(registryId, pluginInfos, threadNumber) {
4149
4282
  const urlString = (void 0)("#parallel-plugin-worker");
@@ -4163,9 +4296,9 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
4163
4296
  });
4164
4297
  });
4165
4298
  return worker;
4166
- } catch (e) {
4299
+ } catch (e$1) {
4167
4300
  worker?.terminate();
4168
- throw e;
4301
+ throw e$1;
4169
4302
  }
4170
4303
  }
4171
4304
  const availableParallelism = () => {
@@ -4208,9 +4341,9 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode, isCl
4208
4341
  onLog,
4209
4342
  stopWorkers: parallelPluginInitResult?.stopWorkers
4210
4343
  };
4211
- } catch (e) {
4344
+ } catch (e$1) {
4212
4345
  await parallelPluginInitResult?.stopWorkers();
4213
- throw e;
4346
+ throw e$1;
4214
4347
  }
4215
4348
  }
4216
4349
 
@@ -4229,9 +4362,9 @@ async function createBundler(inputOptions, outputOptions, isClose) {
4229
4362
  asyncRuntimeShutdown = true;
4230
4363
  }
4231
4364
  };
4232
- } catch (e) {
4365
+ } catch (e$1) {
4233
4366
  await option.stopWorkers?.();
4234
- throw e;
4367
+ throw e$1;
4235
4368
  }
4236
4369
  }
4237
4370
 
@@ -4465,6 +4598,12 @@ Object.defineProperty(exports, 'VERSION', {
4465
4598
  return VERSION;
4466
4599
  }
4467
4600
  });
4601
+ Object.defineProperty(exports, 'ansis_default', {
4602
+ enumerable: true,
4603
+ get: function () {
4604
+ return ansis_default;
4605
+ }
4606
+ });
4468
4607
  Object.defineProperty(exports, 'assetPlugin', {
4469
4608
  enumerable: true,
4470
4609
  get: function () {