@rolldown/browser 1.0.0-beta.36 → 1.0.0-beta.38

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.
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
 
28
28
  //#endregion
29
29
  //#region package.json
30
- var version = "1.0.0-beta.36";
30
+ var version = "1.0.0-beta.38";
31
31
 
32
32
  //#endregion
33
33
  //#region src/utils/code-frame.ts
@@ -223,20 +223,12 @@ function augmentCodeLocation(properties, pos, source, id$1) {
223
223
 
224
224
  //#endregion
225
225
  //#region src/builtin-plugin/utils.ts
226
- const BuiltinClassSymbol = Symbol.for("__RolldownBuiltinPlugin__");
227
226
  var BuiltinPlugin = class {
228
227
  constructor(name, _options) {
229
228
  this.name = name;
230
229
  this._options = _options;
231
- this[BuiltinClassSymbol] = true;
232
230
  }
233
231
  };
234
- function isBuiltinPlugin(obj) {
235
- return obj && obj[BuiltinClassSymbol] === true;
236
- }
237
- function createBuiltinPlugin(name, options) {
238
- return new BuiltinPlugin(name, options);
239
- }
240
232
  function makeBuiltinPluginCallable(plugin) {
241
233
  let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
242
234
  const wrappedPlugin = plugin;
@@ -852,72 +844,6 @@ function normalizeHook(hook) {
852
844
  unreachable("Invalid hook type");
853
845
  }
854
846
 
855
- //#endregion
856
- //#region src/utils/normalize-string-or-regex.ts
857
- function normalizedStringOrRegex(pattern) {
858
- if (!pattern) return;
859
- if (!isReadonlyArray(pattern)) return [pattern];
860
- return pattern;
861
- }
862
- function isReadonlyArray(input) {
863
- return Array.isArray(input);
864
- }
865
-
866
- //#endregion
867
- //#region src/builtin-plugin/constructors.ts
868
- function modulePreloadPolyfillPlugin(config) {
869
- return createBuiltinPlugin("builtin:module-preload-polyfill", config);
870
- }
871
- function dynamicImportVarsPlugin(config) {
872
- if (config) {
873
- config.include = normalizedStringOrRegex(config.include);
874
- config.exclude = normalizedStringOrRegex(config.exclude);
875
- }
876
- return createBuiltinPlugin("builtin:dynamic-import-vars", config);
877
- }
878
- function importGlobPlugin(config) {
879
- return createBuiltinPlugin("builtin:import-glob", config);
880
- }
881
- function reporterPlugin(config) {
882
- return createBuiltinPlugin("builtin:reporter", config);
883
- }
884
- function manifestPlugin(config) {
885
- return createBuiltinPlugin("builtin:manifest", config);
886
- }
887
- function wasmHelperPlugin(config) {
888
- return createBuiltinPlugin("builtin:wasm-helper", config);
889
- }
890
- function wasmFallbackPlugin() {
891
- const builtinPlugin = createBuiltinPlugin("builtin:wasm-fallback");
892
- return makeBuiltinPluginCallable(builtinPlugin);
893
- }
894
- function loadFallbackPlugin() {
895
- return createBuiltinPlugin("builtin:load-fallback");
896
- }
897
- function jsonPlugin(config) {
898
- const builtinPlugin = createBuiltinPlugin("builtin:json", config);
899
- return makeBuiltinPluginCallable(builtinPlugin);
900
- }
901
- function buildImportAnalysisPlugin(config) {
902
- return createBuiltinPlugin("builtin:build-import-analysis", config);
903
- }
904
- function viteResolvePlugin(config) {
905
- const builtinPlugin = createBuiltinPlugin("builtin:vite-resolve", config);
906
- return makeBuiltinPluginCallable(builtinPlugin);
907
- }
908
- function isolatedDeclarationPlugin(config) {
909
- return createBuiltinPlugin("builtin:isolated-declaration", config);
910
- }
911
- function assetPlugin(config) {
912
- return createBuiltinPlugin("builtin:asset", config);
913
- }
914
- function webWorkerPostPlugin() {
915
- return createBuiltinPlugin("builtin:web-worker-post");
916
- }
917
- function esmExternalRequirePlugin(config) {
918
- return createBuiltinPlugin("builtin:esm-external-require", config);
919
- }
920
-
921
847
  //#endregion
922
848
  //#region src/constants/plugin.ts
923
849
  const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES = [
@@ -1009,14 +935,13 @@ function checkOutputPluginOption(plugins, onLog) {
1009
935
  function normalizePlugins(plugins, anonymousPrefix) {
1010
936
  for (const [index, plugin] of plugins.entries()) {
1011
937
  if ("_parallel" in plugin) continue;
1012
- if (isBuiltinPlugin(plugin)) continue;
938
+ if (plugin instanceof BuiltinPlugin) continue;
1013
939
  if (!plugin.name) plugin.name = `${anonymousPrefix}${index + 1}`;
1014
940
  }
1015
941
  return plugins;
1016
942
  }
1017
943
  const ANONYMOUS_PLUGIN_PREFIX = "at position ";
1018
944
  const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position ";
1019
- const BUILTIN_PLUGINS = [];
1020
945
 
1021
946
  //#endregion
1022
947
  //#region src/plugin/minimal-plugin-context.ts
@@ -1078,7 +1003,7 @@ function getObjectPlugins(plugins) {
1078
1003
  return plugins.filter((plugin) => {
1079
1004
  if (!plugin) return;
1080
1005
  if ("_parallel" in plugin) return;
1081
- if (isBuiltinPlugin(plugin)) return;
1006
+ if (plugin instanceof BuiltinPlugin) return;
1082
1007
  return plugin;
1083
1008
  });
1084
1009
  }
@@ -1109,6 +1034,117 @@ function getSortedPlugins(hookName, plugins) {
1109
1034
  ];
1110
1035
  }
1111
1036
 
1037
+ //#endregion
1038
+ //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs
1039
+ var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs": ((exports, module) => {
1040
+ 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) => {
1041
+ 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);
1042
+ return [
1043
+ n$2 >> 16 & 255,
1044
+ n$2 >> 8 & 255,
1045
+ 255 & n$2
1046
+ ];
1047
+ }, 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) => {
1048
+ let t$3, r$1, n$2, l$1, o$1;
1049
+ 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);
1050
+ }, g = (() => {
1051
+ 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;
1052
+ try {
1053
+ e$1 = "," + s(i$1).join(",");
1054
+ } catch (e$2) {
1055
+ i$1 = {}, c$1 = 0;
1056
+ }
1057
+ let a$2 = "FORCE_COLOR", p$1 = {
1058
+ false: 0,
1059
+ 0: 0,
1060
+ 1: 1,
1061
+ 2: 2,
1062
+ 3: 3
1063
+ }[i$1[a$2]] ?? -1, u$1 = a$2 in i$1 && p$1 || r$1(/^--color=?(true|always)?$/);
1064
+ return u$1 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, n$3, l$2) => (t$2 = r$2.TERM, {
1065
+ "24bit": 3,
1066
+ truecolor: 3,
1067
+ ansi256: 2,
1068
+ ansi: 1
1069
+ }[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;
1070
+ })(), f = {
1071
+ open: i,
1072
+ close: i
1073
+ }, h = 39, b = 49, O = {}, m = ({ p: e$2 }, { open: t$3, close: n$2 }) => {
1074
+ let o$1 = (e$3, ...r$1) => {
1075
+ if (!e$3) {
1076
+ if (t$3 && t$3 === n$2) return t$3;
1077
+ if ((e$3 ?? i) === i) return i;
1078
+ }
1079
+ 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;
1080
+ if (s$2.includes("\x1B")) for (; c$2; c$2 = c$2.p) {
1081
+ let { open: e$4, close: t$4 } = c$2, r$2 = t$4.length, n$3 = i, o$2 = 0;
1082
+ 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;
1083
+ s$2 = n$3 + s$2.slice(o$2);
1084
+ }
1085
+ return a$2 + (s$2.includes("\n") ? s$2.replace(/(\r?\n)/g, p$1 + "$1" + a$2) : s$2) + p$1;
1086
+ }, s$1 = t$3, c$1 = n$2;
1087
+ return e$2 && (s$1 = e$2.o + t$3, c$1 = n$2 + e$2.c), l(o$1, r), o$1.p = {
1088
+ open: t$3,
1089
+ close: n$2,
1090
+ o: s$1,
1091
+ c: c$1,
1092
+ p: e$2
1093
+ }, o$1.open = s$1, o$1.close = c$1, o$1;
1094
+ };
1095
+ const w = function(e$2 = g) {
1096
+ let t$3 = {
1097
+ Ansis: w,
1098
+ level: e$2,
1099
+ isSupported: () => s$1,
1100
+ strip: (e$3) => e$3.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
1101
+ extend(e$3) {
1102
+ for (let t$4 in e$3) {
1103
+ let r$1 = e$3[t$4], l$1 = (typeof r$1)[0], o$1 = "s" === l$1 ? x(...p(r$1)) : r$1;
1104
+ O[t$4] = "f" === l$1 ? { get() {
1105
+ return (...e$4) => m(this, r$1(...e$4));
1106
+ } } : { get() {
1107
+ let e$4 = m(this, o$1);
1108
+ return n$1(this, t$4, { value: e$4 }), e$4;
1109
+ } };
1110
+ }
1111
+ return r = o({}, O), l(t$3, r), t$3;
1112
+ }
1113
+ }, s$1 = e$2 > 0, c$1 = (e$3, t$4) => s$1 ? {
1114
+ open: `[${e$3}m`,
1115
+ close: `[${t$4}m`
1116
+ } : 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);
1117
+ 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));
1118
+ let E, M = {
1119
+ fg: v,
1120
+ bg: C,
1121
+ rgb: x,
1122
+ bgRgb: T,
1123
+ hex: a$2(x),
1124
+ bgHex: a$2(T),
1125
+ visible: f,
1126
+ reset: c$1(0, 0),
1127
+ bold: c$1(1, 22),
1128
+ dim: c$1(2, 22),
1129
+ italic: c$1(3, 23),
1130
+ underline: c$1(4, 24),
1131
+ inverse: c$1(7, 27),
1132
+ hidden: c$1(8, 28),
1133
+ strikethrough: c$1(9, 29)
1134
+ }, I = "Bright";
1135
+ return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e$3, t$4) => {
1136
+ 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);
1137
+ })), t$3.extend(M);
1138
+ }, y = new w();
1139
+ module.exports = y, y.default = y;
1140
+ }) });
1141
+
1142
+ //#endregion
1143
+ //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.mjs
1144
+ var import_ansis = /* @__PURE__ */ __toESM(require_ansis(), 1);
1145
+ var ansis_default = import_ansis.default;
1146
+ 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;
1147
+
1112
1148
  //#endregion
1113
1149
  //#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.9.2/node_modules/valibot/dist/index.js
1114
1150
  var store;
@@ -2074,117 +2110,6 @@ function safeParse(schema, input, config2) {
2074
2110
  };
2075
2111
  }
2076
2112
 
2077
- //#endregion
2078
- //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs
2079
- var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs": ((exports, module) => {
2080
- 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) => {
2081
- 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);
2082
- return [
2083
- n$2 >> 16 & 255,
2084
- n$2 >> 8 & 255,
2085
- 255 & n$2
2086
- ];
2087
- }, 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) => {
2088
- let t$3, r$1, n$2, l$1, o$1;
2089
- 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);
2090
- }, g = (() => {
2091
- 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;
2092
- try {
2093
- e$1 = "," + s(i$1).join(",");
2094
- } catch (e$2) {
2095
- i$1 = {}, c$1 = 0;
2096
- }
2097
- let a$2 = "FORCE_COLOR", p$1 = {
2098
- false: 0,
2099
- 0: 0,
2100
- 1: 1,
2101
- 2: 2,
2102
- 3: 3
2103
- }[i$1[a$2]] ?? -1, u$1 = a$2 in i$1 && p$1 || r$1(/^--color=?(true|always)?$/);
2104
- return u$1 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, n$3, l$2) => (t$2 = r$2.TERM, {
2105
- "24bit": 3,
2106
- truecolor: 3,
2107
- ansi256: 2,
2108
- ansi: 1
2109
- }[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;
2110
- })(), f = {
2111
- open: i,
2112
- close: i
2113
- }, h = 39, b = 49, O = {}, m = ({ p: e$2 }, { open: t$3, close: n$2 }) => {
2114
- let o$1 = (e$3, ...r$1) => {
2115
- if (!e$3) {
2116
- if (t$3 && t$3 === n$2) return t$3;
2117
- if ((e$3 ?? i) === i) return i;
2118
- }
2119
- 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;
2120
- if (s$2.includes("\x1B")) for (; c$2; c$2 = c$2.p) {
2121
- let { open: e$4, close: t$4 } = c$2, r$2 = t$4.length, n$3 = i, o$2 = 0;
2122
- 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;
2123
- s$2 = n$3 + s$2.slice(o$2);
2124
- }
2125
- return a$2 + (s$2.includes("\n") ? s$2.replace(/(\r?\n)/g, p$1 + "$1" + a$2) : s$2) + p$1;
2126
- }, s$1 = t$3, c$1 = n$2;
2127
- return e$2 && (s$1 = e$2.o + t$3, c$1 = n$2 + e$2.c), l(o$1, r), o$1.p = {
2128
- open: t$3,
2129
- close: n$2,
2130
- o: s$1,
2131
- c: c$1,
2132
- p: e$2
2133
- }, o$1.open = s$1, o$1.close = c$1, o$1;
2134
- };
2135
- const w = function(e$2 = g) {
2136
- let t$3 = {
2137
- Ansis: w,
2138
- level: e$2,
2139
- isSupported: () => s$1,
2140
- strip: (e$3) => e$3.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
2141
- extend(e$3) {
2142
- for (let t$4 in e$3) {
2143
- let r$1 = e$3[t$4], l$1 = (typeof r$1)[0], o$1 = "s" === l$1 ? x(...p(r$1)) : r$1;
2144
- O[t$4] = "f" === l$1 ? { get() {
2145
- return (...e$4) => m(this, r$1(...e$4));
2146
- } } : { get() {
2147
- let e$4 = m(this, o$1);
2148
- return n$1(this, t$4, { value: e$4 }), e$4;
2149
- } };
2150
- }
2151
- return r = o({}, O), l(t$3, r), t$3;
2152
- }
2153
- }, s$1 = e$2 > 0, c$1 = (e$3, t$4) => s$1 ? {
2154
- open: `[${e$3}m`,
2155
- close: `[${t$4}m`
2156
- } : 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);
2157
- 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));
2158
- let E, M = {
2159
- fg: v,
2160
- bg: C,
2161
- rgb: x,
2162
- bgRgb: T,
2163
- hex: a$2(x),
2164
- bgHex: a$2(T),
2165
- visible: f,
2166
- reset: c$1(0, 0),
2167
- bold: c$1(1, 22),
2168
- dim: c$1(2, 22),
2169
- italic: c$1(3, 23),
2170
- underline: c$1(4, 24),
2171
- inverse: c$1(7, 27),
2172
- hidden: c$1(8, 28),
2173
- strikethrough: c$1(9, 29)
2174
- }, I = "Bright";
2175
- return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e$3, t$4) => {
2176
- 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);
2177
- })), t$3.extend(M);
2178
- }, y = new w();
2179
- module.exports = y, y.default = y;
2180
- }) });
2181
-
2182
- //#endregion
2183
- //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.mjs
2184
- var import_ansis = /* @__PURE__ */ __toESM(require_ansis(), 1);
2185
- var ansis_default = import_ansis.default;
2186
- 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;
2187
-
2188
2113
  //#endregion
2189
2114
  //#region src/utils/validator.ts
2190
2115
  const StringOrRegExpSchema = union([string(), instance(RegExp)]);
@@ -2231,7 +2156,7 @@ const JsxOptionsSchema = strictObject({
2231
2156
  throwIfNamespace: pipe(optional(string()), description("Toggles whether to throw an error when a tag name uses an XML namespace")),
2232
2157
  importSource: pipe(optional(string()), description("Import the factory of element and fragment if mode is classic")),
2233
2158
  pragma: pipe(optional(string()), description("Jsx element transformation")),
2234
- pragmaFlag: pipe(optional(string()), description("Jsx fragment transformation")),
2159
+ pragmaFrag: pipe(optional(string()), description("Jsx fragment transformation")),
2235
2160
  refresh: pipe(optional(boolean()), description("Enable react fast refresh"))
2236
2161
  });
2237
2162
  const RollupJsxOptionsSchema = strictObject({
@@ -2350,7 +2275,11 @@ const MinifyOptionsSchema = strictObject({
2350
2275
  codegen: optional(union([boolean(), CodegenOptionsSchema]))
2351
2276
  });
2352
2277
  const ResolveOptionsSchema = strictObject({
2353
- alias: optional(record(string(), union([string(), array(string())]))),
2278
+ alias: optional(record(string(), union([
2279
+ literal(false),
2280
+ string(),
2281
+ array(string())
2282
+ ]))),
2354
2283
  aliasFields: optional(array(array(string()))),
2355
2284
  conditionNames: optional(array(string())),
2356
2285
  extensionAlias: optional(record(string(), array(string()))),
@@ -2468,7 +2397,7 @@ const InputCliOverrideSchema = strictObject({
2468
2397
  literal("react-jsx"),
2469
2398
  literal("preserve")
2470
2399
  ])), description("Jsx options preset")),
2471
- preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points")),
2400
+ preserveEntrySignatures: pipe(optional(literal(false)), description("Avoid facade chunks for entry points")),
2472
2401
  context: pipe(optional(string()), description("The entity top-level `this` represents."))
2473
2402
  });
2474
2403
  const InputCliOptionsSchema = omit(strictObject({
@@ -2838,7 +2767,7 @@ function exclude(expr) {
2838
2767
  }
2839
2768
 
2840
2769
  //#endregion
2841
- //#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
2770
+ //#region ../../node_modules/.pnpm/remeda@2.31.1/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
2842
2771
  function e(e$2, t$3, n$2) {
2843
2772
  let r$1 = (n$3) => e$2(n$3, ...t$3);
2844
2773
  return n$2 === void 0 ? r$1 : Object.assign(r$1, {
@@ -2848,7 +2777,7 @@ function e(e$2, t$3, n$2) {
2848
2777
  }
2849
2778
 
2850
2779
  //#endregion
2851
- //#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/purry-DH9cw9sy.js
2780
+ //#region ../../node_modules/.pnpm/remeda@2.31.1/node_modules/remeda/dist/purry-DH9cw9sy.js
2852
2781
  function t(t$3, n$2, r$1) {
2853
2782
  let i$1 = t$3.length - n$2.length;
2854
2783
  if (i$1 === 0) return t$3(...n$2);
@@ -2857,7 +2786,7 @@ function t(t$3, n$2, r$1) {
2857
2786
  }
2858
2787
 
2859
2788
  //#endregion
2860
- //#region ../../node_modules/.pnpm/remeda@2.30.0/node_modules/remeda/dist/partition-BJYkp-a7.js
2789
+ //#region ../../node_modules/.pnpm/remeda@2.31.1/node_modules/remeda/dist/partition-DAu403JQ.js
2861
2790
  function t$1(...t$3) {
2862
2791
  return t(n, t$3);
2863
2792
  }
@@ -3017,7 +2946,7 @@ function bindingPluginOrder(order) {
3017
2946
  }
3018
2947
 
3019
2948
  //#endregion
3020
- //#region ../../node_modules/.pnpm/oxc-parser@0.87.0/node_modules/oxc-parser/wrap.mjs
2949
+ //#region ../../node_modules/.pnpm/oxc-parser@0.89.0/node_modules/oxc-parser/wrap.mjs
3021
2950
  function wrap$1(result) {
3022
2951
  let program, module$1, comments, errors;
3023
2952
  return {
@@ -4377,13 +4306,24 @@ var PluginContextData = class {
4377
4306
  }
4378
4307
  };
4379
4308
 
4309
+ //#endregion
4310
+ //#region src/utils/normalize-string-or-regex.ts
4311
+ function normalizedStringOrRegex(pattern) {
4312
+ if (!pattern) return;
4313
+ if (!isReadonlyArray(pattern)) return [pattern];
4314
+ return pattern;
4315
+ }
4316
+ function isReadonlyArray(input) {
4317
+ return Array.isArray(input);
4318
+ }
4319
+
4380
4320
  //#endregion
4381
4321
  //#region src/utils/bindingify-input-options.ts
4382
4322
  function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
4383
4323
  const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
4384
4324
  const plugins = rawPlugins.map((plugin) => {
4385
4325
  if ("_parallel" in plugin) return;
4386
- if (isBuiltinPlugin(plugin)) return bindingifyBuiltInPlugin(plugin);
4326
+ if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
4387
4327
  return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
4388
4328
  });
4389
4329
  const { jsx, transform } = bindingifyJsx(onLog, inputOptions.jsx, inputOptions.transform);
@@ -4449,13 +4389,7 @@ function bindingifyExternal(external) {
4449
4389
  if (id$1.startsWith("\0")) return false;
4450
4390
  return external(id$1, importer, isResolved) ?? false;
4451
4391
  };
4452
- const externalArr = arraify(external);
4453
- return (id$1, _importer, _isResolved) => {
4454
- return externalArr.some((pat) => {
4455
- if (pat instanceof RegExp) return pat.test(id$1);
4456
- return id$1 === pat;
4457
- });
4458
- };
4392
+ return arraify(external);
4459
4393
  }
4460
4394
  }
4461
4395
  function bindingifyExperimental(experimental) {
@@ -4489,7 +4423,7 @@ function bindingifyResolve(resolve$1) {
4489
4423
  return {
4490
4424
  alias: alias ? Object.entries(alias).map(([name, replacement]) => ({
4491
4425
  find: name,
4492
- replacements: arraify(replacement)
4426
+ replacements: replacement === false ? [void 0] : arraify(replacement)
4493
4427
  })) : void 0,
4494
4428
  extensionAlias: extensionAlias ? Object.entries(extensionAlias).map(([name, value]) => ({
4495
4429
  target: name,
@@ -4658,11 +4592,7 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
4658
4592
  const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel, watchMode);
4659
4593
  outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions, onLog, logLevel, watchMode);
4660
4594
  const normalizedOutputPlugins = await normalizePluginOption(outputOptions.plugins);
4661
- let plugins = [
4662
- ...BUILTIN_PLUGINS,
4663
- ...normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX),
4664
- ...checkOutputPluginOption(normalizePlugins(normalizedOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX), onLog)
4665
- ];
4595
+ let plugins = [...normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX), ...checkOutputPluginOption(normalizePlugins(normalizedOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX), onLog)];
4666
4596
  const parallelPluginInitResult = void 0;
4667
4597
  try {
4668
4598
  const bindingInputOptions = bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode);
@@ -4683,27 +4613,6 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
4683
4613
  }
4684
4614
  }
4685
4615
 
4686
- //#endregion
4687
- //#region src/utils/create-bundler.ts
4688
- let asyncRuntimeShutdown = false;
4689
- async function createBundlerImpl(bundler, inputOptions, outputOptions) {
4690
- const option = await createBundlerOptions(inputOptions, outputOptions, false);
4691
- if (asyncRuntimeShutdown) startAsyncRuntime();
4692
- try {
4693
- return {
4694
- impl: bundler.createImpl(option.bundlerOptions),
4695
- stopWorkers: option.stopWorkers,
4696
- shutdown: () => {
4697
- shutdownAsyncRuntime();
4698
- asyncRuntimeShutdown = true;
4699
- }
4700
- };
4701
- } catch (e$2) {
4702
- await option.stopWorkers?.();
4703
- throw e$2;
4704
- }
4705
- }
4706
-
4707
4616
  //#endregion
4708
4617
  //#region src/utils/transform-hmr-patch-output.ts
4709
4618
  function transformHmrPatchOutput(output) {
@@ -4719,10 +4628,11 @@ function handleHmrPatchOutputErrors(output) {
4719
4628
  //#endregion
4720
4629
  //#region src/api/rolldown/rolldown-build.ts
4721
4630
  Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
4722
- var RolldownBuild = class {
4631
+ var RolldownBuild = class RolldownBuild {
4723
4632
  #inputOptions;
4724
4633
  #bundler;
4725
4634
  #bundlerImpl;
4635
+ static asyncRuntimeShutdown = false;
4726
4636
  constructor(inputOptions) {
4727
4637
  this.#inputOptions = inputOptions;
4728
4638
  this.#bundler = new BindingBundler();
@@ -4732,7 +4642,26 @@ var RolldownBuild = class {
4732
4642
  }
4733
4643
  async #getBundlerWithStopWorker(outputOptions) {
4734
4644
  if (this.#bundlerImpl) await this.#bundlerImpl.stopWorkers?.();
4735
- return this.#bundlerImpl = await createBundlerImpl(this.#bundler, this.#inputOptions, outputOptions);
4645
+ const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
4646
+ if (RolldownBuild.asyncRuntimeShutdown) startAsyncRuntime();
4647
+ try {
4648
+ return this.#bundlerImpl = {
4649
+ impl: this.#bundler.createImpl(option.bundlerOptions),
4650
+ stopWorkers: option.stopWorkers,
4651
+ shutdown: () => {
4652
+ shutdownAsyncRuntime();
4653
+ RolldownBuild.asyncRuntimeShutdown = true;
4654
+ }
4655
+ };
4656
+ } catch (e$2) {
4657
+ await option.stopWorkers?.();
4658
+ throw e$2;
4659
+ }
4660
+ }
4661
+ async scan() {
4662
+ const { impl } = await this.#getBundlerWithStopWorker({});
4663
+ const output = await impl.scan();
4664
+ return handleOutputErrors(output);
4736
4665
  }
4737
4666
  async generate(outputOptions = {}) {
4738
4667
  validateOption("output", outputOptions);
@@ -4940,4 +4869,4 @@ function defineConfig(config) {
4940
4869
  const VERSION = version;
4941
4870
 
4942
4871
  //#endregion
4943
- export { PluginDriver, VERSION, assetPlugin, build, buildImportAnalysisPlugin, createBuiltinPlugin, createBundlerImpl, createBundlerOptions, defineConfig, dynamicImportVarsPlugin, esmExternalRequirePlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
4872
+ export { BuiltinPlugin, PluginDriver, RolldownBuild, VERSION, build, createBundlerOptions, defineConfig, makeBuiltinPluginCallable, normalizedStringOrRegex, rolldown, watch };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolldown/browser",
3
- "version": "1.0.0-beta.36",
3
+ "version": "1.0.0-beta.38",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "type": "module",
@@ -49,14 +49,13 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@napi-rs/wasm-runtime": "^1.0.0",
53
- "@oxc-project/runtime": "=0.87.0"
52
+ "@napi-rs/wasm-runtime": "^1.0.0"
54
53
  },
55
54
  "scripts": {
56
55
  "build": "pnpm run build:debug",
57
- "build:debug": "pnpm run --filter rolldown build-browser:debug",
58
- "build:release": "pnpm run --filter rolldown build-browser:release",
59
- "build-node": "BROWSER_PKG=1 pnpm run --filter rolldown build-node",
56
+ "build:debug": "pnpm run --filter rolldown build-browser-pkg:debug",
57
+ "build:release": "pnpm run --filter rolldown build-browser-pkg:release",
58
+ "build-node": "TARGET='browser' pnpm run --filter rolldown build-node",
60
59
  "preinstall": "npx only-allow pnpm"
61
60
  }
62
61
  }