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

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.37";
30
+ var version = "1.0.0-beta.39";
31
31
 
32
32
  //#endregion
33
33
  //#region src/utils/code-frame.ts
@@ -844,72 +844,6 @@ function normalizeHook(hook) {
844
844
  unreachable("Invalid hook type");
845
845
  }
846
846
 
847
- //#endregion
848
- //#region src/utils/normalize-string-or-regex.ts
849
- function normalizedStringOrRegex(pattern) {
850
- if (!pattern) return;
851
- if (!isReadonlyArray(pattern)) return [pattern];
852
- return pattern;
853
- }
854
- function isReadonlyArray(input) {
855
- return Array.isArray(input);
856
- }
857
-
858
- //#endregion
859
- //#region src/builtin-plugin/constructors.ts
860
- function modulePreloadPolyfillPlugin(config) {
861
- return new BuiltinPlugin("builtin:module-preload-polyfill", config);
862
- }
863
- function dynamicImportVarsPlugin(config) {
864
- if (config) {
865
- config.include = normalizedStringOrRegex(config.include);
866
- config.exclude = normalizedStringOrRegex(config.exclude);
867
- }
868
- return new BuiltinPlugin("builtin:dynamic-import-vars", config);
869
- }
870
- function importGlobPlugin(config) {
871
- return new BuiltinPlugin("builtin:import-glob", config);
872
- }
873
- function reporterPlugin(config) {
874
- return new BuiltinPlugin("builtin:reporter", config);
875
- }
876
- function manifestPlugin(config) {
877
- return new BuiltinPlugin("builtin:manifest", config);
878
- }
879
- function wasmHelperPlugin(config) {
880
- return new BuiltinPlugin("builtin:wasm-helper", config);
881
- }
882
- function wasmFallbackPlugin() {
883
- const builtinPlugin = new BuiltinPlugin("builtin:wasm-fallback");
884
- return makeBuiltinPluginCallable(builtinPlugin);
885
- }
886
- function loadFallbackPlugin() {
887
- return new BuiltinPlugin("builtin:load-fallback");
888
- }
889
- function jsonPlugin(config) {
890
- const builtinPlugin = new BuiltinPlugin("builtin:json", config);
891
- return makeBuiltinPluginCallable(builtinPlugin);
892
- }
893
- function buildImportAnalysisPlugin(config) {
894
- return new BuiltinPlugin("builtin:build-import-analysis", config);
895
- }
896
- function viteResolvePlugin(config) {
897
- const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
898
- return makeBuiltinPluginCallable(builtinPlugin);
899
- }
900
- function isolatedDeclarationPlugin(config) {
901
- return new BuiltinPlugin("builtin:isolated-declaration", config);
902
- }
903
- function assetPlugin(config) {
904
- return new BuiltinPlugin("builtin:asset", config);
905
- }
906
- function webWorkerPostPlugin() {
907
- return new BuiltinPlugin("builtin:web-worker-post");
908
- }
909
- function esmExternalRequirePlugin(config) {
910
- return new BuiltinPlugin("builtin:esm-external-require", config);
911
- }
912
-
913
847
  //#endregion
914
848
  //#region src/constants/plugin.ts
915
849
  const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES = [
@@ -1008,7 +942,6 @@ function normalizePlugins(plugins, anonymousPrefix) {
1008
942
  }
1009
943
  const ANONYMOUS_PLUGIN_PREFIX = "at position ";
1010
944
  const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position ";
1011
- const BUILTIN_PLUGINS = [];
1012
945
 
1013
946
  //#endregion
1014
947
  //#region src/plugin/minimal-plugin-context.ts
@@ -1101,6 +1034,117 @@ function getSortedPlugins(hookName, plugins) {
1101
1034
  ];
1102
1035
  }
1103
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
+
1104
1148
  //#endregion
1105
1149
  //#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.9.2/node_modules/valibot/dist/index.js
1106
1150
  var store;
@@ -2066,117 +2110,6 @@ function safeParse(schema, input, config2) {
2066
2110
  };
2067
2111
  }
2068
2112
 
2069
- //#endregion
2070
- //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs
2071
- var require_ansis = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs": ((exports, module) => {
2072
- 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) => {
2073
- 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);
2074
- return [
2075
- n$2 >> 16 & 255,
2076
- n$2 >> 8 & 255,
2077
- 255 & n$2
2078
- ];
2079
- }, 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) => {
2080
- let t$3, r$1, n$2, l$1, o$1;
2081
- 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);
2082
- }, g = (() => {
2083
- 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;
2084
- try {
2085
- e$1 = "," + s(i$1).join(",");
2086
- } catch (e$2) {
2087
- i$1 = {}, c$1 = 0;
2088
- }
2089
- let a$2 = "FORCE_COLOR", p$1 = {
2090
- false: 0,
2091
- 0: 0,
2092
- 1: 1,
2093
- 2: 2,
2094
- 3: 3
2095
- }[i$1[a$2]] ?? -1, u$1 = a$2 in i$1 && p$1 || r$1(/^--color=?(true|always)?$/);
2096
- return u$1 && (c$1 = p$1), ~c$1 || (c$1 = ((r$2, n$3, l$2) => (t$2 = r$2.TERM, {
2097
- "24bit": 3,
2098
- truecolor: 3,
2099
- ansi256: 2,
2100
- ansi: 1
2101
- }[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;
2102
- })(), f = {
2103
- open: i,
2104
- close: i
2105
- }, h = 39, b = 49, O = {}, m = ({ p: e$2 }, { open: t$3, close: n$2 }) => {
2106
- let o$1 = (e$3, ...r$1) => {
2107
- if (!e$3) {
2108
- if (t$3 && t$3 === n$2) return t$3;
2109
- if ((e$3 ?? i) === i) return i;
2110
- }
2111
- 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;
2112
- if (s$2.includes("\x1B")) for (; c$2; c$2 = c$2.p) {
2113
- let { open: e$4, close: t$4 } = c$2, r$2 = t$4.length, n$3 = i, o$2 = 0;
2114
- 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;
2115
- s$2 = n$3 + s$2.slice(o$2);
2116
- }
2117
- return a$2 + (s$2.includes("\n") ? s$2.replace(/(\r?\n)/g, p$1 + "$1" + a$2) : s$2) + p$1;
2118
- }, s$1 = t$3, c$1 = n$2;
2119
- return e$2 && (s$1 = e$2.o + t$3, c$1 = n$2 + e$2.c), l(o$1, r), o$1.p = {
2120
- open: t$3,
2121
- close: n$2,
2122
- o: s$1,
2123
- c: c$1,
2124
- p: e$2
2125
- }, o$1.open = s$1, o$1.close = c$1, o$1;
2126
- };
2127
- const w = function(e$2 = g) {
2128
- let t$3 = {
2129
- Ansis: w,
2130
- level: e$2,
2131
- isSupported: () => s$1,
2132
- strip: (e$3) => e$3.replace(/[›][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i),
2133
- extend(e$3) {
2134
- for (let t$4 in e$3) {
2135
- let r$1 = e$3[t$4], l$1 = (typeof r$1)[0], o$1 = "s" === l$1 ? x(...p(r$1)) : r$1;
2136
- O[t$4] = "f" === l$1 ? { get() {
2137
- return (...e$4) => m(this, r$1(...e$4));
2138
- } } : { get() {
2139
- let e$4 = m(this, o$1);
2140
- return n$1(this, t$4, { value: e$4 }), e$4;
2141
- } };
2142
- }
2143
- return r = o({}, O), l(t$3, r), t$3;
2144
- }
2145
- }, s$1 = e$2 > 0, c$1 = (e$3, t$4) => s$1 ? {
2146
- open: `[${e$3}m`,
2147
- close: `[${t$4}m`
2148
- } : 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);
2149
- 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));
2150
- let E, M = {
2151
- fg: v,
2152
- bg: C,
2153
- rgb: x,
2154
- bgRgb: T,
2155
- hex: a$2(x),
2156
- bgHex: a$2(T),
2157
- visible: f,
2158
- reset: c$1(0, 0),
2159
- bold: c$1(1, 22),
2160
- dim: c$1(2, 22),
2161
- italic: c$1(3, 23),
2162
- underline: c$1(4, 24),
2163
- inverse: c$1(7, 27),
2164
- hidden: c$1(8, 28),
2165
- strikethrough: c$1(9, 29)
2166
- }, I = "Bright";
2167
- return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e$3, t$4) => {
2168
- 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);
2169
- })), t$3.extend(M);
2170
- }, y = new w();
2171
- module.exports = y, y.default = y;
2172
- }) });
2173
-
2174
- //#endregion
2175
- //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.mjs
2176
- var import_ansis = /* @__PURE__ */ __toESM(require_ansis(), 1);
2177
- var ansis_default = import_ansis.default;
2178
- 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;
2179
-
2180
2113
  //#endregion
2181
2114
  //#region src/utils/validator.ts
2182
2115
  const StringOrRegExpSchema = union([string(), instance(RegExp)]);
@@ -2223,7 +2156,7 @@ const JsxOptionsSchema = strictObject({
2223
2156
  throwIfNamespace: pipe(optional(string()), description("Toggles whether to throw an error when a tag name uses an XML namespace")),
2224
2157
  importSource: pipe(optional(string()), description("Import the factory of element and fragment if mode is classic")),
2225
2158
  pragma: pipe(optional(string()), description("Jsx element transformation")),
2226
- pragmaFlag: pipe(optional(string()), description("Jsx fragment transformation")),
2159
+ pragmaFrag: pipe(optional(string()), description("Jsx fragment transformation")),
2227
2160
  refresh: pipe(optional(boolean()), description("Enable react fast refresh"))
2228
2161
  });
2229
2162
  const RollupJsxOptionsSchema = strictObject({
@@ -2342,7 +2275,11 @@ const MinifyOptionsSchema = strictObject({
2342
2275
  codegen: optional(union([boolean(), CodegenOptionsSchema]))
2343
2276
  });
2344
2277
  const ResolveOptionsSchema = strictObject({
2345
- alias: optional(record(string(), union([string(), array(string())]))),
2278
+ alias: optional(record(string(), union([
2279
+ literal(false),
2280
+ string(),
2281
+ array(string())
2282
+ ]))),
2346
2283
  aliasFields: optional(array(array(string()))),
2347
2284
  conditionNames: optional(array(string())),
2348
2285
  extensionAlias: optional(record(string(), array(string()))),
@@ -2460,7 +2397,7 @@ const InputCliOverrideSchema = strictObject({
2460
2397
  literal("react-jsx"),
2461
2398
  literal("preserve")
2462
2399
  ])), description("Jsx options preset")),
2463
- 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")),
2464
2401
  context: pipe(optional(string()), description("The entity top-level `this` represents."))
2465
2402
  });
2466
2403
  const InputCliOptionsSchema = omit(strictObject({
@@ -2830,7 +2767,7 @@ function exclude(expr) {
2830
2767
  }
2831
2768
 
2832
2769
  //#endregion
2833
- //#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
2834
2771
  function e(e$2, t$3, n$2) {
2835
2772
  let r$1 = (n$3) => e$2(n$3, ...t$3);
2836
2773
  return n$2 === void 0 ? r$1 : Object.assign(r$1, {
@@ -2840,7 +2777,7 @@ function e(e$2, t$3, n$2) {
2840
2777
  }
2841
2778
 
2842
2779
  //#endregion
2843
- //#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
2844
2781
  function t(t$3, n$2, r$1) {
2845
2782
  let i$1 = t$3.length - n$2.length;
2846
2783
  if (i$1 === 0) return t$3(...n$2);
@@ -2849,7 +2786,7 @@ function t(t$3, n$2, r$1) {
2849
2786
  }
2850
2787
 
2851
2788
  //#endregion
2852
- //#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
2853
2790
  function t$1(...t$3) {
2854
2791
  return t(n, t$3);
2855
2792
  }
@@ -3009,7 +2946,7 @@ function bindingPluginOrder(order) {
3009
2946
  }
3010
2947
 
3011
2948
  //#endregion
3012
- //#region ../../node_modules/.pnpm/oxc-parser@0.87.0/node_modules/oxc-parser/wrap.mjs
2949
+ //#region ../../node_modules/.pnpm/oxc-parser@0.90.0/node_modules/oxc-parser/wrap.mjs
3013
2950
  function wrap$1(result) {
3014
2951
  let program, module$1, comments, errors;
3015
2952
  return {
@@ -3136,23 +3073,14 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
3136
3073
  invalidate: false
3137
3074
  };
3138
3075
  this.data.updateModuleOption(id$1, rawOptions);
3139
- async function createLoadModulePromise(context, data) {
3140
- const loadPromise = data.loadModulePromiseMap.get(id$1);
3141
- if (loadPromise) return loadPromise;
3142
- const promise$1 = new Promise((resolve$1, _) => {
3143
- data.loadModulePromiseResolveFnMap.set(id$1, resolve$1);
3076
+ let loadPromise = this.data.loadModulePromiseMap.get(id$1);
3077
+ if (!loadPromise) {
3078
+ loadPromise = this.context.load(id$1, options.moduleSideEffects ?? void 0).catch(() => {
3079
+ this.data.loadModulePromiseMap.delete(id$1);
3144
3080
  });
3145
- data.loadModulePromiseMap.set(id$1, promise$1);
3146
- try {
3147
- await context.load(id$1, options.moduleSideEffects ?? void 0);
3148
- } catch (e$2) {
3149
- data.loadModulePromiseMap.delete(id$1);
3150
- data.loadModulePromiseResolveFnMap.delete(id$1);
3151
- throw e$2;
3152
- }
3153
- return promise$1;
3081
+ this.data.loadModulePromiseMap.set(id$1, loadPromise);
3154
3082
  }
3155
- await createLoadModulePromise(this.context, this.data);
3083
+ await loadPromise;
3156
3084
  return this.data.getModuleInfo(id$1, this.context);
3157
3085
  }
3158
3086
  async resolve(source, importer, options) {
@@ -4272,7 +4200,6 @@ var PluginContextData = class {
4272
4200
  moduleOptionMap = /* @__PURE__ */ new Map();
4273
4201
  resolveOptionsMap = /* @__PURE__ */ new Map();
4274
4202
  loadModulePromiseMap = /* @__PURE__ */ new Map();
4275
- loadModulePromiseResolveFnMap = /* @__PURE__ */ new Map();
4276
4203
  renderedChunkMeta = null;
4277
4204
  normalizedInputOptions = null;
4278
4205
  normalizedOutputOptions = null;
@@ -4358,17 +4285,23 @@ var PluginContextData = class {
4358
4285
  this.normalizedOutputOptions ??= new NormalizedOutputOptionsImpl(opts, this.outputOptions, this.normalizedOutputPlugins);
4359
4286
  return this.normalizedOutputOptions;
4360
4287
  }
4361
- markModuleLoaded(id$1, _success) {
4362
- const resolve$1 = this.loadModulePromiseResolveFnMap.get(id$1);
4363
- if (resolve$1) resolve$1();
4364
- }
4365
4288
  clear() {
4366
4289
  this.renderedChunkMeta = null;
4367
4290
  this.loadModulePromiseMap.clear();
4368
- this.loadModulePromiseResolveFnMap.clear();
4369
4291
  }
4370
4292
  };
4371
4293
 
4294
+ //#endregion
4295
+ //#region src/utils/normalize-string-or-regex.ts
4296
+ function normalizedStringOrRegex(pattern) {
4297
+ if (!pattern) return;
4298
+ if (!isReadonlyArray(pattern)) return [pattern];
4299
+ return pattern;
4300
+ }
4301
+ function isReadonlyArray(input) {
4302
+ return Array.isArray(input);
4303
+ }
4304
+
4372
4305
  //#endregion
4373
4306
  //#region src/utils/bindingify-input-options.ts
4374
4307
  function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
@@ -4414,7 +4347,6 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
4414
4347
  makeAbsoluteExternalsRelative: bindingifyMakeAbsoluteExternalsRelative(inputOptions.makeAbsoluteExternalsRelative),
4415
4348
  debug: inputOptions.debug,
4416
4349
  invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
4417
- markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
4418
4350
  preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
4419
4351
  optimization: inputOptions.optimization,
4420
4352
  context: inputOptions.context,
@@ -4441,13 +4373,7 @@ function bindingifyExternal(external) {
4441
4373
  if (id$1.startsWith("\0")) return false;
4442
4374
  return external(id$1, importer, isResolved) ?? false;
4443
4375
  };
4444
- const externalArr = arraify(external);
4445
- return (id$1, _importer, _isResolved) => {
4446
- return externalArr.some((pat) => {
4447
- if (pat instanceof RegExp) return pat.test(id$1);
4448
- return id$1 === pat;
4449
- });
4450
- };
4376
+ return arraify(external);
4451
4377
  }
4452
4378
  }
4453
4379
  function bindingifyExperimental(experimental) {
@@ -4481,7 +4407,7 @@ function bindingifyResolve(resolve$1) {
4481
4407
  return {
4482
4408
  alias: alias ? Object.entries(alias).map(([name, replacement]) => ({
4483
4409
  find: name,
4484
- replacements: arraify(replacement)
4410
+ replacements: replacement === false ? [void 0] : arraify(replacement)
4485
4411
  })) : void 0,
4486
4412
  extensionAlias: extensionAlias ? Object.entries(extensionAlias).map(([name, value]) => ({
4487
4413
  target: name,
@@ -4650,11 +4576,7 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
4650
4576
  const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel, watchMode);
4651
4577
  outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions, onLog, logLevel, watchMode);
4652
4578
  const normalizedOutputPlugins = await normalizePluginOption(outputOptions.plugins);
4653
- let plugins = [
4654
- ...BUILTIN_PLUGINS,
4655
- ...normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX),
4656
- ...checkOutputPluginOption(normalizePlugins(normalizedOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX), onLog)
4657
- ];
4579
+ let plugins = [...normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX), ...checkOutputPluginOption(normalizePlugins(normalizedOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX), onLog)];
4658
4580
  const parallelPluginInitResult = void 0;
4659
4581
  try {
4660
4582
  const bindingInputOptions = bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode);
@@ -4675,27 +4597,6 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
4675
4597
  }
4676
4598
  }
4677
4599
 
4678
- //#endregion
4679
- //#region src/utils/create-bundler.ts
4680
- let asyncRuntimeShutdown = false;
4681
- async function createBundlerImpl(bundler, inputOptions, outputOptions) {
4682
- const option = await createBundlerOptions(inputOptions, outputOptions, false);
4683
- if (asyncRuntimeShutdown) startAsyncRuntime();
4684
- try {
4685
- return {
4686
- impl: bundler.createImpl(option.bundlerOptions),
4687
- stopWorkers: option.stopWorkers,
4688
- shutdown: () => {
4689
- shutdownAsyncRuntime();
4690
- asyncRuntimeShutdown = true;
4691
- }
4692
- };
4693
- } catch (e$2) {
4694
- await option.stopWorkers?.();
4695
- throw e$2;
4696
- }
4697
- }
4698
-
4699
4600
  //#endregion
4700
4601
  //#region src/utils/transform-hmr-patch-output.ts
4701
4602
  function transformHmrPatchOutput(output) {
@@ -4711,10 +4612,11 @@ function handleHmrPatchOutputErrors(output) {
4711
4612
  //#endregion
4712
4613
  //#region src/api/rolldown/rolldown-build.ts
4713
4614
  Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
4714
- var RolldownBuild = class {
4615
+ var RolldownBuild = class RolldownBuild {
4715
4616
  #inputOptions;
4716
4617
  #bundler;
4717
4618
  #bundlerImpl;
4619
+ static asyncRuntimeShutdown = false;
4718
4620
  constructor(inputOptions) {
4719
4621
  this.#inputOptions = inputOptions;
4720
4622
  this.#bundler = new BindingBundler();
@@ -4724,7 +4626,26 @@ var RolldownBuild = class {
4724
4626
  }
4725
4627
  async #getBundlerWithStopWorker(outputOptions) {
4726
4628
  if (this.#bundlerImpl) await this.#bundlerImpl.stopWorkers?.();
4727
- return this.#bundlerImpl = await createBundlerImpl(this.#bundler, this.#inputOptions, outputOptions);
4629
+ const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
4630
+ if (RolldownBuild.asyncRuntimeShutdown) startAsyncRuntime();
4631
+ try {
4632
+ return this.#bundlerImpl = {
4633
+ impl: this.#bundler.createImpl(option.bundlerOptions),
4634
+ stopWorkers: option.stopWorkers,
4635
+ shutdown: () => {
4636
+ shutdownAsyncRuntime();
4637
+ RolldownBuild.asyncRuntimeShutdown = true;
4638
+ }
4639
+ };
4640
+ } catch (e$2) {
4641
+ await option.stopWorkers?.();
4642
+ throw e$2;
4643
+ }
4644
+ }
4645
+ async scan() {
4646
+ const { impl } = await this.#getBundlerWithStopWorker({});
4647
+ const output = await impl.scan();
4648
+ return handleOutputErrors(output);
4728
4649
  }
4729
4650
  async generate(outputOptions = {}) {
4730
4651
  validateOption("output", outputOptions);
@@ -4932,4 +4853,4 @@ function defineConfig(config) {
4932
4853
  const VERSION = version;
4933
4854
 
4934
4855
  //#endregion
4935
- export { BuiltinPlugin, PluginDriver, VERSION, assetPlugin, build, buildImportAnalysisPlugin, createBundlerImpl, createBundlerOptions, defineConfig, dynamicImportVarsPlugin, esmExternalRequirePlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
4856
+ 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.37",
3
+ "version": "1.0.0-beta.39",
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
  }