@rolldown/browser 1.0.0-beta.13-commit.024b632 → 1.0.0-beta.14-commit.12b8061

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 (35) hide show
  1. package/dist/cli.cjs +2 -2
  2. package/dist/cli.mjs +2 -2
  3. package/dist/config.cjs +2 -2
  4. package/dist/config.d.cts +2 -2
  5. package/dist/config.d.mts +2 -2
  6. package/dist/config.mjs +2 -2
  7. package/dist/experimental-index.browser.mjs +3 -2
  8. package/dist/experimental-index.cjs +3 -2
  9. package/dist/experimental-index.d.cts +2 -2
  10. package/dist/experimental-index.d.mts +2 -2
  11. package/dist/experimental-index.mjs +4 -2
  12. package/dist/filter-index.d.cts +2 -2
  13. package/dist/filter-index.d.mts +2 -2
  14. package/dist/index.browser.mjs +1 -1
  15. package/dist/index.cjs +1 -1
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.mjs +1 -1
  19. package/dist/parallel-plugin-worker.cjs +1 -1
  20. package/dist/parallel-plugin-worker.mjs +1 -1
  21. package/dist/parallel-plugin.d.cts +2 -2
  22. package/dist/parallel-plugin.d.mts +2 -2
  23. package/dist/parse-ast-index.d.cts +1 -1
  24. package/dist/parse-ast-index.d.mts +1 -1
  25. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  26. package/dist/shared/{binding-BHIN6Pwt.d.mts → binding-CZdobbZA.d.cts} +13 -2
  27. package/dist/shared/{binding-TjXg6Uds.d.cts → binding-Dze8QVpf.d.mts} +13 -2
  28. package/dist/shared/{define-config-D9yO3QIE.d.mts → define-config-BE-fkZNW.d.cts} +4 -3
  29. package/dist/shared/{define-config-DHHoUVzc.d.cts → define-config-CnVvtpOm.d.mts} +4 -3
  30. package/dist/shared/{load-config-DqW80Noh.mjs → load-config-BUkt64Ft.mjs} +1 -1
  31. package/dist/shared/{load-config-JUGDZMZS.cjs → load-config-Dtt_VFiY.cjs} +1 -1
  32. package/dist/shared/{src-Cnjy5N-n.cjs → src-B_I243k1.cjs} +45 -23
  33. package/dist/shared/{src-DZb73lcW.mjs → src-CKQe7Qnf.mjs} +41 -24
  34. package/dist/{src-zFpuhs38.js → src-1bRy3Pay.js} +515 -46
  35. package/package.json +1 -1
@@ -1,5 +1,4 @@
1
1
  import { BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, Bundler, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
2
- import path from "node:path";
3
2
 
4
3
  //#region rolldown:runtime
5
4
  var __create = Object.create;
@@ -28,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
27
 
29
28
  //#endregion
30
29
  //#region package.json
31
- var version = "1.0.0-beta.13-commit.024b632";
30
+ var version = "1.0.0-beta.14-commit.12b8061";
32
31
 
33
32
  //#endregion
34
33
  //#region src/builtin-plugin/utils.ts
@@ -55,8 +54,8 @@ var BuiltinPlugin = class {
55
54
  this._options = _options;
56
55
  }
57
56
  };
58
- function modulePreloadPolyfillPlugin() {
59
- return new BuiltinPlugin("builtin:module-preload-polyfill");
57
+ function modulePreloadPolyfillPlugin(config) {
58
+ return new BuiltinPlugin("builtin:module-preload-polyfill", config);
60
59
  }
61
60
  function dynamicImportVarsPlugin(config) {
62
61
  return new BuiltinPlugin("builtin:dynamic-import-vars", config);
@@ -74,13 +73,15 @@ function wasmHelperPlugin() {
74
73
  return new BuiltinPlugin("builtin:wasm-helper");
75
74
  }
76
75
  function wasmFallbackPlugin() {
77
- return new BuiltinPlugin("builtin:wasm-fallback");
76
+ const builtinPlugin = new BuiltinPlugin("builtin:wasm-fallback");
77
+ return makeBuiltinPluginCallable(builtinPlugin);
78
78
  }
79
79
  function loadFallbackPlugin() {
80
80
  return new BuiltinPlugin("builtin:load-fallback");
81
81
  }
82
82
  function jsonPlugin(config) {
83
- return new BuiltinPlugin("builtin:json", config);
83
+ const builtinPlugin = new BuiltinPlugin("builtin:json", config);
84
+ return makeBuiltinPluginCallable(builtinPlugin);
84
85
  }
85
86
  function buildImportAnalysisPlugin(config) {
86
87
  return new BuiltinPlugin("builtin:build-import-analysis", config);
@@ -120,6 +121,460 @@ function webWorkerPostPlugin() {
120
121
  return new BuiltinPlugin("builtin:web-worker-post");
121
122
  }
122
123
 
124
+ //#endregion
125
+ //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
126
+ let _lazyMatch = () => {
127
+ var __lib__ = (() => {
128
+ var m$1 = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r$1, e$1) => {
129
+ for (var n$1 in e$1) m$1(r$1, n$1, {
130
+ get: e$1[n$1],
131
+ enumerable: true
132
+ });
133
+ }, H = (r$1, e$1, n$1, a$2) => {
134
+ if (e$1 && typeof e$1 == "object" || typeof e$1 == "function") for (let t$2 of G(e$1)) !T.call(r$1, t$2) && t$2 !== n$1 && m$1(r$1, t$2, {
135
+ get: () => e$1[t$2],
136
+ enumerable: !(a$2 = V(e$1, t$2)) || a$2.enumerable
137
+ });
138
+ return r$1;
139
+ }, J = (r$1) => H(m$1({}, "__esModule", { value: true }), r$1), w$1 = {};
140
+ q(w$1, { default: () => re });
141
+ var A = (r$1) => Array.isArray(r$1), d$2 = (r$1) => typeof r$1 == "function", Q = (r$1) => r$1.length === 0, W = (r$1) => typeof r$1 == "number", K = (r$1) => typeof r$1 == "object" && r$1 !== null, X = (r$1) => r$1 instanceof RegExp, b$1 = (r$1) => typeof r$1 == "string", h$1 = (r$1) => r$1 === void 0, Y = (r$1) => {
142
+ const e$1 = /* @__PURE__ */ new Map();
143
+ return (n$1) => {
144
+ const a$2 = e$1.get(n$1);
145
+ if (a$2) return a$2;
146
+ const t$2 = r$1(n$1);
147
+ return e$1.set(n$1, t$2), t$2;
148
+ };
149
+ }, rr = (r$1, e$1, n$1 = {}) => {
150
+ const a$2 = {
151
+ cache: {},
152
+ input: r$1,
153
+ index: 0,
154
+ indexMax: 0,
155
+ options: n$1,
156
+ output: []
157
+ };
158
+ if (v(e$1)(a$2) && a$2.index === r$1.length) return a$2.output;
159
+ throw new Error(`Failed to parse at index ${a$2.indexMax}`);
160
+ }, i$2 = (r$1, e$1) => A(r$1) ? er(r$1, e$1) : b$1(r$1) ? ar(r$1, e$1) : nr(r$1, e$1), er = (r$1, e$1) => {
161
+ const n$1 = {};
162
+ for (const a$2 of r$1) {
163
+ if (a$2.length !== 1) throw new Error(`Invalid character: "${a$2}"`);
164
+ const t$2 = a$2.charCodeAt(0);
165
+ n$1[t$2] = true;
166
+ }
167
+ return (a$2) => {
168
+ const t$2 = a$2.index, o$1 = a$2.input;
169
+ for (; a$2.index < o$1.length && o$1.charCodeAt(a$2.index) in n$1;) a$2.index += 1;
170
+ const u$3 = a$2.index;
171
+ if (u$3 > t$2) {
172
+ if (!h$1(e$1) && !a$2.options.silent) {
173
+ const s$1 = a$2.input.slice(t$2, u$3), c$1 = d$2(e$1) ? e$1(s$1, o$1, String(t$2)) : e$1;
174
+ h$1(c$1) || a$2.output.push(c$1);
175
+ }
176
+ a$2.indexMax = Math.max(a$2.indexMax, a$2.index);
177
+ }
178
+ return true;
179
+ };
180
+ }, nr = (r$1, e$1) => {
181
+ const n$1 = r$1.source, a$2 = r$1.flags.replace(/y|$/, "y"), t$2 = new RegExp(n$1, a$2);
182
+ return g$1((o$1) => {
183
+ t$2.lastIndex = o$1.index;
184
+ const u$3 = t$2.exec(o$1.input);
185
+ if (u$3) {
186
+ if (!h$1(e$1) && !o$1.options.silent) {
187
+ const s$1 = d$2(e$1) ? e$1(...u$3, o$1.input, String(o$1.index)) : e$1;
188
+ h$1(s$1) || o$1.output.push(s$1);
189
+ }
190
+ return o$1.index += u$3[0].length, o$1.indexMax = Math.max(o$1.indexMax, o$1.index), true;
191
+ } else return false;
192
+ });
193
+ }, ar = (r$1, e$1) => (n$1) => {
194
+ if (n$1.input.startsWith(r$1, n$1.index)) {
195
+ if (!h$1(e$1) && !n$1.options.silent) {
196
+ const t$2 = d$2(e$1) ? e$1(r$1, n$1.input, String(n$1.index)) : e$1;
197
+ h$1(t$2) || n$1.output.push(t$2);
198
+ }
199
+ return n$1.index += r$1.length, n$1.indexMax = Math.max(n$1.indexMax, n$1.index), true;
200
+ } else return false;
201
+ }, C = (r$1, e$1, n$1, a$2) => {
202
+ const t$2 = v(r$1);
203
+ return g$1(_(M((o$1) => {
204
+ let u$3 = 0;
205
+ for (; u$3 < n$1;) {
206
+ const s$1 = o$1.index;
207
+ if (!t$2(o$1) || (u$3 += 1, o$1.index === s$1)) break;
208
+ }
209
+ return u$3 >= e$1;
210
+ })));
211
+ }, tr = (r$1, e$1) => C(r$1, 0, 1), f$1 = (r$1, e$1) => C(r$1, 0, Infinity), x = (r$1, e$1) => {
212
+ const n$1 = r$1.map(v);
213
+ return g$1(_(M((a$2) => {
214
+ for (let t$2 = 0, o$1 = n$1.length; t$2 < o$1; t$2++) if (!n$1[t$2](a$2)) return false;
215
+ return true;
216
+ })));
217
+ }, l$1 = (r$1, e$1) => {
218
+ const n$1 = r$1.map(v);
219
+ return g$1(_((a$2) => {
220
+ for (let t$2 = 0, o$1 = n$1.length; t$2 < o$1; t$2++) if (n$1[t$2](a$2)) return true;
221
+ return false;
222
+ }));
223
+ }, M = (r$1, e$1 = false) => {
224
+ const n$1 = v(r$1);
225
+ return (a$2) => {
226
+ const t$2 = a$2.index, o$1 = a$2.output.length, u$3 = n$1(a$2);
227
+ return (!u$3 || e$1) && (a$2.index = t$2, a$2.output.length !== o$1 && (a$2.output.length = o$1)), u$3;
228
+ };
229
+ }, _ = (r$1, e$1) => {
230
+ const n$1 = v(r$1);
231
+ return n$1;
232
+ }, g$1 = (() => {
233
+ let r$1 = 0;
234
+ return (e$1) => {
235
+ const n$1 = v(e$1), a$2 = r$1 += 1;
236
+ return (t$2) => {
237
+ var o$1;
238
+ if (t$2.options.memoization === false) return n$1(t$2);
239
+ const u$3 = t$2.index, s$1 = (o$1 = t$2.cache)[a$2] || (o$1[a$2] = /* @__PURE__ */ new Map()), c$1 = s$1.get(u$3);
240
+ if (c$1 === false) return false;
241
+ if (W(c$1)) return t$2.index = c$1, true;
242
+ if (c$1) return t$2.index = c$1.index, c$1.output?.length && t$2.output.push(...c$1.output), true;
243
+ {
244
+ const Z = t$2.output.length;
245
+ if (n$1(t$2)) {
246
+ const D = t$2.index, U = t$2.output.length;
247
+ if (U > Z) {
248
+ const ee = t$2.output.slice(Z, U);
249
+ s$1.set(u$3, {
250
+ index: D,
251
+ output: ee
252
+ });
253
+ } else s$1.set(u$3, D);
254
+ return true;
255
+ } else return s$1.set(u$3, false), false;
256
+ }
257
+ };
258
+ };
259
+ })(), E = (r$1) => {
260
+ let e$1;
261
+ return (n$1) => (e$1 || (e$1 = v(r$1())), e$1(n$1));
262
+ }, v = Y((r$1) => {
263
+ if (d$2(r$1)) return Q(r$1) ? E(r$1) : r$1;
264
+ if (b$1(r$1) || X(r$1)) return i$2(r$1);
265
+ if (A(r$1)) return x(r$1);
266
+ if (K(r$1)) return l$1(Object.values(r$1));
267
+ throw new Error("Invalid rule");
268
+ }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r$1) => {
269
+ let e$1 = "";
270
+ for (; r$1 > 0;) {
271
+ const n$1 = (r$1 - 1) % 26;
272
+ e$1 = P[n$1] + e$1, r$1 = Math.floor((r$1 - 1) / 26);
273
+ }
274
+ return e$1;
275
+ }, O$1 = (r$1) => {
276
+ let e$1 = 0;
277
+ for (let n$1 = 0, a$2 = r$1.length; n$1 < a$2; n$1++) e$1 = e$1 * 26 + P.indexOf(r$1[n$1]) + 1;
278
+ return e$1;
279
+ }, S = (r$1, e$1) => {
280
+ if (e$1 < r$1) return S(e$1, r$1);
281
+ const n$1 = [];
282
+ for (; r$1 <= e$1;) n$1.push(r$1++);
283
+ return n$1;
284
+ }, or$1 = (r$1, e$1, n$1) => S(r$1, e$1).map((a$2) => String(a$2).padStart(n$1, "0")), R = (r$1, e$1) => S(O$1(r$1), O$1(e$1)).map(ir), p$1 = (r$1) => r$1, z = (r$1) => ur((e$1) => rr(e$1, r$1, { memoization: false }).join("")), ur = (r$1) => {
285
+ const e$1 = {};
286
+ return (n$1) => e$1[n$1] ?? (e$1[n$1] = r$1(n$1));
287
+ }, sr = i$2(/^\*\*\/\*$/, ".*"), cr = i$2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r$1, e$1, n$1) => `.*${e$1 ? "" : "(?:^|/)"}${n$1.replaceAll(".", "\\.")}`), lr = i$2(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r$1, e$1, n$1, a$2) => `.*${e$1 ? "" : "(?:^|/)"}${n$1.replaceAll(".", "\\.")}(?:${a$2.replaceAll(",", "|").replaceAll(".", "\\.")})`), y$1 = i$2(/\\./, p$1), pr = i$2(/[$.*+?^(){}[\]\|]/, (r$1) => `\\${r$1}`), vr = i$2(/./, p$1), hr = i$2(/^(?:!!)*!(.*)$/, (r$1, e$1) => `(?!^${L(e$1)}$).*?`), dr = i$2(/^(!!)+/, ""), fr = l$1([hr, dr]), xr = i$2(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i$2(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i$2(/\/(\*\*)$/, "(?:/.*|$)"), _r = i$2(/\*\*/, ".*"), j = l$1([
288
+ xr,
289
+ gr,
290
+ mr,
291
+ _r
292
+ ]), Sr = i$2(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i$2(/\*/, "[^/]*"), N = l$1([Sr, yr]), k = i$2("?", "[^/]"), $r = i$2("[", p$1), wr = i$2("]", p$1), Ar = i$2(/[!^]/, "^/"), br = i$2(/[a-z]-[a-z]|[0-9]-[0-9]/i, p$1), Cr = i$2(/[$.*+?^(){}[\|]/, (r$1) => `\\${r$1}`), Mr = i$2(/[^\]]/, p$1), Er = l$1([
293
+ y$1,
294
+ Cr,
295
+ br,
296
+ Mr
297
+ ]), B = x([
298
+ $r,
299
+ tr(Ar),
300
+ f$1(Er),
301
+ wr
302
+ ]), Pr = i$2("{", "(?:"), Or$1 = i$2("}", ")"), Rr = i$2(/(\d+)\.\.(\d+)/, (r$1, e$1, n$1) => or$1(+e$1, +n$1, Math.min(e$1.length, n$1.length)).join("|")), zr = i$2(/([a-z]+)\.\.([a-z]+)/, (r$1, e$1, n$1) => R(e$1, n$1).join("|")), jr = i$2(/([A-Z]+)\.\.([A-Z]+)/, (r$1, e$1, n$1) => R(e$1.toLowerCase(), n$1.toLowerCase()).join("|").toUpperCase()), Nr = l$1([
303
+ Rr,
304
+ zr,
305
+ jr
306
+ ]), I = x([
307
+ Pr,
308
+ Nr,
309
+ Or$1
310
+ ]), kr = i$2("{", "(?:"), Br = i$2("}", ")"), Ir = i$2(",", "|"), Fr = i$2(/[$.*+?^(){[\]\|]/, (r$1) => `\\${r$1}`), Lr = i$2(/[^}]/, p$1), Zr = E(() => F), Dr = l$1([
311
+ j,
312
+ N,
313
+ k,
314
+ B,
315
+ I,
316
+ Zr,
317
+ y$1,
318
+ Fr,
319
+ Ir,
320
+ Lr
321
+ ]), F = x([
322
+ kr,
323
+ f$1(Dr),
324
+ Br
325
+ ]), Ur = f$1(l$1([
326
+ sr,
327
+ cr,
328
+ lr,
329
+ fr,
330
+ j,
331
+ N,
332
+ k,
333
+ B,
334
+ I,
335
+ F,
336
+ y$1,
337
+ pr,
338
+ vr
339
+ ])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i$2(/\\./, p$1), qr = i$2(/./, p$1), Hr = i$2(/\*\*\*+/, "*"), Jr = i$2(/([^/{[(!])\*\*/, (r$1, e$1) => `${e$1}*`), Qr = i$2(/(^|.)\*\*(?=[^*/)\]}])/, (r$1, e$1) => `${e$1}*`), Wr = f$1(l$1([
340
+ Tr,
341
+ Hr,
342
+ Jr,
343
+ Qr,
344
+ qr
345
+ ])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r$1, e$1) => {
346
+ const n$1 = Array.isArray(r$1) ? r$1 : [r$1];
347
+ if (!n$1.length) return false;
348
+ const a$2 = n$1.map($.compile), t$2 = n$1.every((s$1) => /(\/(?:\*\*)?|\[\/\])$/.test(s$1)), o$1 = e$1.replace(/[\\\/]+/g, "/").replace(/\/$/, t$2 ? "/" : "");
349
+ return a$2.some((s$1) => s$1.test(o$1));
350
+ };
351
+ $.compile = (r$1) => new RegExp(`^${L(Yr(r$1))}$`, "s");
352
+ var re = $;
353
+ return J(w$1);
354
+ })();
355
+ return __lib__.default || __lib__;
356
+ };
357
+ let _match;
358
+ const zeptomatch = (path, pattern) => {
359
+ if (!_match) {
360
+ _match = _lazyMatch();
361
+ _lazyMatch = null;
362
+ }
363
+ return _match(path, pattern);
364
+ };
365
+ const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
366
+ function normalizeWindowsPath(input = "") {
367
+ if (!input) return input;
368
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r$1) => r$1.toUpperCase());
369
+ }
370
+ const _UNC_REGEX = /^[/\\]{2}/;
371
+ const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
372
+ const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
373
+ const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
374
+ const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
375
+ const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
376
+ const sep = "/";
377
+ const normalize = function(path) {
378
+ if (path.length === 0) return ".";
379
+ path = normalizeWindowsPath(path);
380
+ const isUNCPath = path.match(_UNC_REGEX);
381
+ const isPathAbsolute = isAbsolute(path);
382
+ const trailingSeparator = path[path.length - 1] === "/";
383
+ path = normalizeString(path, !isPathAbsolute);
384
+ if (path.length === 0) {
385
+ if (isPathAbsolute) return "/";
386
+ return trailingSeparator ? "./" : ".";
387
+ }
388
+ if (trailingSeparator) path += "/";
389
+ if (_DRIVE_LETTER_RE.test(path)) path += "/";
390
+ if (isUNCPath) {
391
+ if (!isPathAbsolute) return `//./${path}`;
392
+ return `//${path}`;
393
+ }
394
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
395
+ };
396
+ const join = function(...segments) {
397
+ let path = "";
398
+ for (const seg of segments) {
399
+ if (!seg) continue;
400
+ if (path.length > 0) {
401
+ const pathTrailing = path[path.length - 1] === "/";
402
+ const segLeading = seg[0] === "/";
403
+ const both = pathTrailing && segLeading;
404
+ if (both) path += seg.slice(1);
405
+ else path += pathTrailing || segLeading ? seg : `/${seg}`;
406
+ } else path += seg;
407
+ }
408
+ return normalize(path);
409
+ };
410
+ function cwd() {
411
+ if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
412
+ return "/";
413
+ }
414
+ const resolve = function(...arguments_) {
415
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
416
+ let resolvedPath = "";
417
+ let resolvedAbsolute = false;
418
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
419
+ const path = index >= 0 ? arguments_[index] : cwd();
420
+ if (!path || path.length === 0) continue;
421
+ resolvedPath = `${path}/${resolvedPath}`;
422
+ resolvedAbsolute = isAbsolute(path);
423
+ }
424
+ resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
425
+ if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
426
+ return resolvedPath.length > 0 ? resolvedPath : ".";
427
+ };
428
+ function normalizeString(path, allowAboveRoot) {
429
+ let res = "";
430
+ let lastSegmentLength = 0;
431
+ let lastSlash = -1;
432
+ let dots = 0;
433
+ let char = null;
434
+ for (let index = 0; index <= path.length; ++index) {
435
+ if (index < path.length) char = path[index];
436
+ else if (char === "/") break;
437
+ else char = "/";
438
+ if (char === "/") {
439
+ if (lastSlash === index - 1 || dots === 1);
440
+ else if (dots === 2) {
441
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
442
+ if (res.length > 2) {
443
+ const lastSlashIndex = res.lastIndexOf("/");
444
+ if (lastSlashIndex === -1) {
445
+ res = "";
446
+ lastSegmentLength = 0;
447
+ } else {
448
+ res = res.slice(0, lastSlashIndex);
449
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
450
+ }
451
+ lastSlash = index;
452
+ dots = 0;
453
+ continue;
454
+ } else if (res.length > 0) {
455
+ res = "";
456
+ lastSegmentLength = 0;
457
+ lastSlash = index;
458
+ dots = 0;
459
+ continue;
460
+ }
461
+ }
462
+ if (allowAboveRoot) {
463
+ res += res.length > 0 ? "/.." : "..";
464
+ lastSegmentLength = 2;
465
+ }
466
+ } else {
467
+ if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
468
+ else res = path.slice(lastSlash + 1, index);
469
+ lastSegmentLength = index - lastSlash - 1;
470
+ }
471
+ lastSlash = index;
472
+ dots = 0;
473
+ } else if (char === "." && dots !== -1) ++dots;
474
+ else dots = -1;
475
+ }
476
+ return res;
477
+ }
478
+ const isAbsolute = function(p$1) {
479
+ return _IS_ABSOLUTE_RE.test(p$1);
480
+ };
481
+ const toNamespacedPath = function(p$1) {
482
+ return normalizeWindowsPath(p$1);
483
+ };
484
+ const extname = function(p$1) {
485
+ if (p$1 === "..") return "";
486
+ const match = _EXTNAME_RE.exec(normalizeWindowsPath(p$1));
487
+ return match && match[1] || "";
488
+ };
489
+ const relative = function(from, to) {
490
+ const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
491
+ const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
492
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
493
+ const _fromCopy = [..._from];
494
+ for (const segment of _fromCopy) {
495
+ if (_to[0] !== segment) break;
496
+ _from.shift();
497
+ _to.shift();
498
+ }
499
+ return [..._from.map(() => ".."), ..._to].join("/");
500
+ };
501
+ const dirname = function(p$1) {
502
+ const segments = normalizeWindowsPath(p$1).replace(/\/$/, "").split("/").slice(0, -1);
503
+ if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
504
+ return segments.join("/") || (isAbsolute(p$1) ? "/" : ".");
505
+ };
506
+ const format = function(p$1) {
507
+ const ext = p$1.ext ? p$1.ext.startsWith(".") ? p$1.ext : `.${p$1.ext}` : "";
508
+ const segments = [
509
+ p$1.root,
510
+ p$1.dir,
511
+ p$1.base ?? (p$1.name ?? "") + ext
512
+ ].filter(Boolean);
513
+ return normalizeWindowsPath(p$1.root ? resolve(...segments) : segments.join("/"));
514
+ };
515
+ const basename = function(p$1, extension) {
516
+ const segments = normalizeWindowsPath(p$1).split("/");
517
+ let lastSegment = "";
518
+ for (let i$2 = segments.length - 1; i$2 >= 0; i$2--) {
519
+ const val = segments[i$2];
520
+ if (val) {
521
+ lastSegment = val;
522
+ break;
523
+ }
524
+ }
525
+ return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
526
+ };
527
+ const parse = function(p$1) {
528
+ const root = _PATH_ROOT_RE.exec(p$1)?.[0]?.replace(/\\/g, "/") || "";
529
+ const base = basename(p$1);
530
+ const extension = extname(base);
531
+ return {
532
+ root,
533
+ dir: dirname(p$1),
534
+ base,
535
+ ext: extension,
536
+ name: base.slice(0, base.length - extension.length)
537
+ };
538
+ };
539
+ const matchesGlob = (path, pattern) => {
540
+ return zeptomatch(pattern, normalize(path));
541
+ };
542
+ const _path = {
543
+ __proto__: null,
544
+ basename,
545
+ dirname,
546
+ extname,
547
+ format,
548
+ isAbsolute,
549
+ join,
550
+ matchesGlob,
551
+ normalize,
552
+ normalizeString,
553
+ parse,
554
+ relative,
555
+ resolve,
556
+ sep,
557
+ toNamespacedPath
558
+ };
559
+
560
+ //#endregion
561
+ //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
562
+ const delimiter = /* @__PURE__ */ (() => globalThis.process?.platform === "win32" ? ";" : ":")();
563
+ const _platforms = {
564
+ posix: void 0,
565
+ win32: void 0
566
+ };
567
+ const mix = (del = delimiter) => {
568
+ return new Proxy(_path, { get(_, prop) {
569
+ if (prop === "delimiter") return del;
570
+ if (prop === "posix") return posix;
571
+ if (prop === "win32") return win32;
572
+ return _platforms[prop] || _path[prop];
573
+ } });
574
+ };
575
+ const posix = /* @__PURE__ */ mix(":");
576
+ const win32 = /* @__PURE__ */ mix(";");
577
+
123
578
  //#endregion
124
579
  //#region src/utils/misc.ts
125
580
  function arraify(value) {
@@ -422,8 +877,8 @@ const getExtendedLogMessage = (log) => {
422
877
  return prefix + log.message;
423
878
  };
424
879
  function relativeId(id$1) {
425
- if (!path.isAbsolute(id$1)) return id$1;
426
- return path.relative(path.resolve(), id$1);
880
+ if (!posix.isAbsolute(id$1)) return id$1;
881
+ return posix.relative(posix.resolve(), id$1);
427
882
  }
428
883
 
429
884
  //#endregion
@@ -1909,7 +2364,13 @@ const InputOptionsSchema = strictObject({
1909
2364
  dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names")),
1910
2365
  checks: optional(ChecksOptionsSchema),
1911
2366
  keepNames: pipe(optional(boolean()), description("Keep function/class name")),
1912
- debug: pipe(optional(object({ sessionId: pipe(optional(string()), description("Used to name the build.")) })), description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly."))
2367
+ debug: pipe(optional(object({ sessionId: pipe(optional(string()), description("Used to name the build.")) })), description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly.")),
2368
+ preserveEntrySignatures: pipe(optional(union([
2369
+ literal("strict"),
2370
+ literal("allow-extension"),
2371
+ literal("exports-only"),
2372
+ literal(false)
2373
+ ])))
1913
2374
  });
1914
2375
  const InputCliOverrideSchema = strictObject({
1915
2376
  input: pipe(optional(array(string())), description("Entry file")),
@@ -1922,7 +2383,8 @@ const InputCliOverrideSchema = strictObject({
1922
2383
  literal("react"),
1923
2384
  literal("react-jsx"),
1924
2385
  literal("preserve")
1925
- ])), description("Jsx options preset"))
2386
+ ])), description("Jsx options preset")),
2387
+ preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points"))
1926
2388
  });
1927
2389
  const InputCliOptionsSchema = omit(strictObject({
1928
2390
  ...InputOptionsSchema.entries,
@@ -2026,12 +2488,6 @@ const OutputOptionsSchema = strictObject({
2026
2488
  }, () => `The 'true' value is not supported`)),
2027
2489
  preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
2028
2490
  preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
2029
- preserveEntrySignatures: pipe(optional(union([
2030
- literal("strict"),
2031
- literal("allow-extension"),
2032
- literal("exports-only"),
2033
- literal(false)
2034
- ]))),
2035
2491
  virtualDirname: optional(string())
2036
2492
  });
2037
2493
  const getAddonDescription = (placement, wrapper) => {
@@ -2054,8 +2510,7 @@ const OutputCliOverrideSchema = strictObject({
2054
2510
  minSize: pipe(optional(number()), description("Minimum size of the chunk")),
2055
2511
  minShareCount: pipe(optional(number()), description("Minimum share count of the chunk"))
2056
2512
  })), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2057
- minify: pipe(optional(boolean()), description("Minify the bundled file")),
2058
- preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points"))
2513
+ minify: pipe(optional(boolean()), description("Minify the bundled file"))
2059
2514
  });
2060
2515
  const OutputCliOptionsSchema = omit(strictObject({
2061
2516
  ...OutputOptionsSchema.entries,
@@ -2081,12 +2536,12 @@ function validateOption(key, options) {
2081
2536
  let parsed = safeParse(key === "input" ? InputOptionsSchema : OutputOptionsSchema, options);
2082
2537
  if (!parsed.success) {
2083
2538
  const errors = parsed.issues.map((issue) => {
2084
- const issuePaths = issue.path.map((path$1) => path$1.key);
2539
+ const issuePaths = issue.path.map((path) => path.key);
2085
2540
  let issueMsg = issue.message;
2086
2541
  if (issue.type === "union") {
2087
2542
  const subIssue = issue.issues?.find((i$2) => !(i$2.type !== issue.received && i$2.input === issue.input));
2088
2543
  if (subIssue) {
2089
- if (subIssue.path) issuePaths.push(subIssue.path.map((path$1) => path$1.key));
2544
+ if (subIssue.path) issuePaths.push(subIssue.path.map((path) => path.key));
2090
2545
  issueMsg = subIssue.message;
2091
2546
  }
2092
2547
  }
@@ -2629,8 +3084,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2629
3084
  async function createLoadModulePromise(context, data) {
2630
3085
  const loadPromise = data.loadModulePromiseMap.get(id$1);
2631
3086
  if (loadPromise) return loadPromise;
2632
- const promise$1 = new Promise((resolve, _) => {
2633
- data.loadModulePromiseResolveFnMap.set(id$1, resolve);
3087
+ const promise$1 = new Promise((resolve$1, _) => {
3088
+ data.loadModulePromiseResolveFnMap.set(id$1, resolve$1);
2634
3089
  });
2635
3090
  data.loadModulePromiseMap.set(id$1, promise$1);
2636
3091
  try {
@@ -2663,7 +3118,10 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2663
3118
  }
2664
3119
  emitFile = (file) => {
2665
3120
  if (file.type === "prebuilt-chunk") return unimplemented("PluginContext.emitFile with type prebuilt-chunk");
2666
- if (file.type === "chunk") return this.context.emitChunk(file);
3121
+ if (file.type === "chunk") return this.context.emitChunk({
3122
+ preserveEntrySignatures: bindingifyPreserveEntrySignatures(file.preserveSignature),
3123
+ ...file
3124
+ });
2667
3125
  const fnSanitizedFileName = file.fileName || typeof this.outputOptions.sanitizeFileName !== "function" ? void 0 : this.outputOptions.sanitizeFileName(file.name || "asset");
2668
3126
  const filename = file.fileName ? void 0 : this.getAssetFileNames(file);
2669
3127
  return this.context.emitFile({
@@ -2871,9 +3329,9 @@ function preProcessSourceMap(ret, id$1) {
2871
3329
  if (!ret.map) return;
2872
3330
  let map = typeof ret.map === "object" ? ret.map : JSON.parse(ret.map);
2873
3331
  if (!isEmptySourcemapFiled(map.sources)) {
2874
- const directory = path.dirname(id$1) || ".";
3332
+ const directory = posix.dirname(id$1) || ".";
2875
3333
  const sourceRoot = map.sourceRoot || ".";
2876
- map.sources = map.sources.map((source) => path.resolve(directory, sourceRoot, source));
3334
+ map.sources = map.sources.map((source) => posix.resolve(directory, sourceRoot, source));
2877
3335
  }
2878
3336
  return map;
2879
3337
  }
@@ -2957,11 +3415,11 @@ function transformChunkModules(modules) {
2957
3415
  //#endregion
2958
3416
  //#region src/utils/bindingify-output-options.ts
2959
3417
  function bindingifyOutputOptions(outputOptions) {
2960
- const { dir, format, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, preserveEntrySignatures } = outputOptions;
3418
+ const { dir, format: format$1, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot } = outputOptions;
2961
3419
  return {
2962
3420
  dir,
2963
3421
  file: file == null ? void 0 : file,
2964
- format: bindingifyFormat(format),
3422
+ format: bindingifyFormat(format$1),
2965
3423
  exports,
2966
3424
  hashCharacters,
2967
3425
  sourcemap: bindingifySourcemap$1(sourcemap),
@@ -2991,8 +3449,7 @@ function bindingifyOutputOptions(outputOptions) {
2991
3449
  preserveModules,
2992
3450
  virtualDirname,
2993
3451
  legalComments,
2994
- preserveModulesRoot,
2995
- preserveEntrySignatures
3452
+ preserveModulesRoot
2996
3453
  };
2997
3454
  }
2998
3455
  function bindingifyAddon(configAddon) {
@@ -3001,8 +3458,8 @@ function bindingifyAddon(configAddon) {
3001
3458
  return configAddon || "";
3002
3459
  };
3003
3460
  }
3004
- function bindingifyFormat(format) {
3005
- switch (format) {
3461
+ function bindingifyFormat(format$1) {
3462
+ switch (format$1) {
3006
3463
  case void 0:
3007
3464
  case "es":
3008
3465
  case "esm":
@@ -3011,7 +3468,7 @@ function bindingifyFormat(format) {
3011
3468
  case "commonjs": return "cjs";
3012
3469
  case "iife": return "iife";
3013
3470
  case "umd": return "umd";
3014
- default: unimplemented(`output.format: ${format}`);
3471
+ default: unimplemented(`output.format: ${format$1}`);
3015
3472
  }
3016
3473
  }
3017
3474
  function bindingifySourcemap$1(sourcemap) {
@@ -3135,13 +3592,13 @@ var NormalizedOutputOptionsImpl = class {
3135
3592
  return this.normalizedOutputPlugins;
3136
3593
  }
3137
3594
  get preserveModules() {
3138
- return this.preserveModules;
3595
+ return this.outputOptions.preserveModules || false;
3139
3596
  }
3140
3597
  get preserveModulesRoot() {
3141
- return this.preserveModulesRoot;
3598
+ return this.outputOptions.preserveModulesRoot;
3142
3599
  }
3143
3600
  get virtualDirname() {
3144
- return this.virtualDirname;
3601
+ return this.outputOptions.virtualDirname || "_virtual";
3145
3602
  }
3146
3603
  };
3147
3604
  function normalizeAddon(value) {
@@ -3744,8 +4201,8 @@ var PluginContextData = class {
3744
4201
  return this.renderedChunkMeta;
3745
4202
  }
3746
4203
  markModuleLoaded(id$1, _success) {
3747
- const resolve = this.loadModulePromiseResolveFnMap.get(id$1);
3748
- if (resolve) resolve();
4204
+ const resolve$1 = this.loadModulePromiseResolveFnMap.get(id$1);
4205
+ if (resolve$1) resolve$1();
3749
4206
  }
3750
4207
  clear() {
3751
4208
  this.renderedChunkMeta = null;
@@ -3818,7 +4275,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3818
4275
  makeAbsoluteExternalsRelative: bindingifyMakeAbsoluteExternalsRelative(inputOptions.makeAbsoluteExternalsRelative),
3819
4276
  debug: inputOptions.debug,
3820
4277
  invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
3821
- markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData)
4278
+ markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
4279
+ preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures)
3822
4280
  };
3823
4281
  }
3824
4282
  function bindingifyHmr(hmr) {
@@ -3842,9 +4300,9 @@ function bindingifyExternal(external) {
3842
4300
  };
3843
4301
  }
3844
4302
  }
3845
- function bindingifyResolve(resolve) {
3846
- if (resolve) {
3847
- const { alias, extensionAlias,...rest } = resolve;
4303
+ function bindingifyResolve(resolve$1) {
4304
+ if (resolve$1) {
4305
+ const { alias, extensionAlias,...rest } = resolve$1;
3848
4306
  return {
3849
4307
  alias: alias ? Object.entries(alias).map(([name, replacement]) => ({
3850
4308
  find: name,
@@ -3954,6 +4412,17 @@ function bindingifyMakeAbsoluteExternalsRelative(makeAbsoluteExternalsRelative)
3954
4412
  field0: makeAbsoluteExternalsRelative
3955
4413
  };
3956
4414
  }
4415
+ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
4416
+ if (preserveEntrySignatures == void 0) return void 0;
4417
+ else if (typeof preserveEntrySignatures === "string") return {
4418
+ type: "String",
4419
+ field0: preserveEntrySignatures
4420
+ };
4421
+ else return {
4422
+ type: "Bool",
4423
+ field0: preserveEntrySignatures
4424
+ };
4425
+ }
3957
4426
 
3958
4427
  //#endregion
3959
4428
  //#region src/utils/plugin/index.ts
@@ -4071,14 +4540,14 @@ function createComposedPlugin(plugins) {
4071
4540
  for (let handlerIdx = 0; handlerIdx < batchedHandlers.length; handlerIdx++) {
4072
4541
  const [_handler, plugin] = batchedHandlers[handlerIdx];
4073
4542
  const handlerSymbol = handlerSymbols[handlerIdx];
4074
- const createFixedPluginResolveFn = (ctx, resolve) => {
4543
+ const createFixedPluginResolveFn = (ctx, resolve$1) => {
4075
4544
  return (source, importer, rawContextResolveOptions) => {
4076
4545
  const contextResolveOptions = rawContextResolveOptions ?? {};
4077
4546
  if (contextResolveOptions.skipSelf) {
4078
4547
  contextResolveOptions[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF] = handlerSymbol;
4079
4548
  contextResolveOptions.skipSelf = false;
4080
4549
  }
4081
- return resolve(source, importer, contextResolveOptions);
4550
+ return resolve$1(source, importer, contextResolveOptions);
4082
4551
  };
4083
4552
  };
4084
4553
  createFixedPluginResolveFnMap.set(plugin, createFixedPluginResolveFn);
@@ -4471,8 +4940,8 @@ var WatcherEmitter = class {
4471
4940
  break;
4472
4941
  case "change":
4473
4942
  for (const listener of listeners) {
4474
- const { path: path$1, kind } = event.watchChangeData();
4475
- await listener(path$1, { event: kind });
4943
+ const { path, kind } = event.watchChangeData();
4944
+ await listener(path, { event: kind });
4476
4945
  }
4477
4946
  break;
4478
4947
  default: throw new Error(`Unknown event: ${event}`);
@@ -4553,4 +5022,4 @@ function defineConfig(config) {
4553
5022
  const VERSION = version;
4554
5023
 
4555
5024
  //#endregion
4556
- export { BuiltinPlugin, VERSION, assetPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
5025
+ export { BuiltinPlugin, PluginDriver, VERSION, assetPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };