@coderline/alphatab-vite 1.9.0-alpha.1860 → 1.9.0-alpha.1883

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 (46) hide show
  1. package/dist/AlphaTabVitePluginOptions.cjs +1 -1
  2. package/dist/AlphaTabVitePluginOptions.mjs +1 -1
  3. package/dist/alphaTab.vite.cjs +1 -1
  4. package/dist/alphaTab.vite.mjs +1 -1
  5. package/dist/alphaTabVitePlugin.cjs +1 -1
  6. package/dist/alphaTabVitePlugin.mjs +1 -1
  7. package/dist/bridge/asset.cjs +3 -2
  8. package/dist/bridge/asset.mjs +3 -2
  9. package/dist/bridge/build.cjs +2 -4
  10. package/dist/bridge/build.mjs +2 -4
  11. package/dist/bridge/bundler.cjs +1 -1
  12. package/dist/bridge/bundler.mjs +1 -1
  13. package/dist/bridge/config.cjs +1 -1
  14. package/dist/bridge/config.mjs +1 -1
  15. package/dist/bridge/constants.cjs +1 -1
  16. package/dist/bridge/constants.mjs +1 -1
  17. package/dist/bridge/fsUtils.cjs +1 -1
  18. package/dist/bridge/fsUtils.mjs +1 -1
  19. package/dist/bridge/index.cjs +1 -1
  20. package/dist/bridge/index.mjs +1 -1
  21. package/dist/bridge/optimizer.cjs +5 -2
  22. package/dist/bridge/optimizer.mjs +5 -2
  23. package/dist/bridge/plugins.cjs +1 -1
  24. package/dist/bridge/plugins.mjs +1 -1
  25. package/dist/bridge/resolve.cjs +1 -1
  26. package/dist/bridge/resolve.mjs +1 -1
  27. package/dist/bridge/typeUtils.cjs +1 -1
  28. package/dist/bridge/typeUtils.mjs +1 -1
  29. package/dist/bridge/utils.cjs +1 -1
  30. package/dist/bridge/utils.mjs +1 -1
  31. package/dist/bridge/worker.cjs +3 -2
  32. package/dist/bridge/worker.mjs +3 -2
  33. package/dist/copyAssetsPlugin.cjs +1 -1
  34. package/dist/copyAssetsPlugin.mjs +1 -1
  35. package/dist/detectionGlobalPlugin.cjs +1 -1
  36. package/dist/detectionGlobalPlugin.mjs +1 -1
  37. package/dist/dist.cjs +587 -501
  38. package/dist/dist.mjs +586 -501
  39. package/dist/importMetaPlugin.cjs +2 -4
  40. package/dist/importMetaPlugin.mjs +2 -4
  41. package/dist/{prompt-B1Yc1NPt.cjs → prompt-CH6TK0bC.cjs} +63 -25
  42. package/dist/{prompt-B1Yc1NPt.mjs → prompt-CH6TK0bC.mjs} +63 -25
  43. package/dist/rolldown-runtime.cjs +2 -2
  44. package/dist/workerPlugin.cjs +6 -6
  45. package/dist/workerPlugin.mjs +6 -6
  46. package/package.json +3 -3
package/dist/dist.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * alphaTab Vite Plugin v1.9.0-alpha.1860 (develop, build 1860)
2
+ * alphaTab Vite Plugin v1.9.0-alpha.1883 (develop, build 1883)
3
3
  *
4
4
  * Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -34,8 +34,11 @@
34
34
  * @license
35
35
  */
36
36
  const require_rolldown_runtime = require("./rolldown-runtime.cjs");
37
+ let node_fs = require("node:fs");
38
+ node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
37
39
  let node_path = require("node:path");
38
40
  node_path = require_rolldown_runtime.__toESM(node_path, 1);
41
+ let node_url = require("node:url");
39
42
  let node_module = require("node:module");
40
43
  let node_fs_promises = require("node:fs/promises");
41
44
  node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises, 1);
@@ -47,7 +50,7 @@ let node_tty = require("node:tty");
47
50
  node_tty = require_rolldown_runtime.__toESM(node_tty, 1);
48
51
  let node_os = require("node:os");
49
52
  node_os = require_rolldown_runtime.__toESM(node_os, 1);
50
- //#region ../../node_modules/rolldown/dist/shared/binding-Dh6LYCIB.mjs
53
+ //#region ../../node_modules/rolldown/dist/shared/binding-Cv62mM1i.mjs
51
54
  var __create = Object.create;
52
55
  var __defProp = Object.defineProperty;
53
56
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -65,7 +68,7 @@ var __copyProps = (to, from, except, desc) => {
65
68
  }
66
69
  return to;
67
70
  };
68
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
71
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
69
72
  value: mod,
70
73
  enumerable: true
71
74
  }) : target, mod));
@@ -147,7 +150,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
147
150
  try {
148
151
  const binding = __require("@rolldown/binding-android-arm64");
149
152
  const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
150
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
153
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
151
154
  return binding;
152
155
  } catch (e) {
153
156
  loadErrors.push(e);
@@ -161,7 +164,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
161
164
  try {
162
165
  const binding = __require("@rolldown/binding-android-arm-eabi");
163
166
  const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
164
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
167
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
165
168
  return binding;
166
169
  } catch (e) {
167
170
  loadErrors.push(e);
@@ -176,7 +179,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
176
179
  try {
177
180
  const binding = __require("@rolldown/binding-win32-x64-gnu");
178
181
  const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
179
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
182
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
180
183
  return binding;
181
184
  } catch (e) {
182
185
  loadErrors.push(e);
@@ -190,7 +193,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
190
193
  try {
191
194
  const binding = __require("@rolldown/binding-win32-x64-msvc");
192
195
  const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
193
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
196
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
194
197
  return binding;
195
198
  } catch (e) {
196
199
  loadErrors.push(e);
@@ -205,7 +208,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
205
208
  try {
206
209
  const binding = __require("@rolldown/binding-win32-ia32-msvc");
207
210
  const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
208
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
211
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
209
212
  return binding;
210
213
  } catch (e) {
211
214
  loadErrors.push(e);
@@ -219,7 +222,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
219
222
  try {
220
223
  const binding = __require("@rolldown/binding-win32-arm64-msvc");
221
224
  const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
222
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
225
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
223
226
  return binding;
224
227
  } catch (e) {
225
228
  loadErrors.push(e);
@@ -234,7 +237,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
234
237
  try {
235
238
  const binding = __require("@rolldown/binding-darwin-universal");
236
239
  const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
237
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
240
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
238
241
  return binding;
239
242
  } catch (e) {
240
243
  loadErrors.push(e);
@@ -248,7 +251,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
248
251
  try {
249
252
  const binding = __require("@rolldown/binding-darwin-x64");
250
253
  const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
251
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
254
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
252
255
  return binding;
253
256
  } catch (e) {
254
257
  loadErrors.push(e);
@@ -262,7 +265,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
262
265
  try {
263
266
  const binding = __require("@rolldown/binding-darwin-arm64");
264
267
  const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
265
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
268
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
266
269
  return binding;
267
270
  } catch (e) {
268
271
  loadErrors.push(e);
@@ -277,7 +280,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
277
280
  try {
278
281
  const binding = __require("@rolldown/binding-freebsd-x64");
279
282
  const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
280
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
283
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
281
284
  return binding;
282
285
  } catch (e) {
283
286
  loadErrors.push(e);
@@ -291,7 +294,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
291
294
  try {
292
295
  const binding = __require("@rolldown/binding-freebsd-arm64");
293
296
  const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
294
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
297
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
295
298
  return binding;
296
299
  } catch (e) {
297
300
  loadErrors.push(e);
@@ -306,7 +309,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
306
309
  try {
307
310
  const binding = __require("@rolldown/binding-linux-x64-musl");
308
311
  const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
309
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
312
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
310
313
  return binding;
311
314
  } catch (e) {
312
315
  loadErrors.push(e);
@@ -320,7 +323,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
320
323
  try {
321
324
  const binding = __require("@rolldown/binding-linux-x64-gnu");
322
325
  const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
323
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
326
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
324
327
  return binding;
325
328
  } catch (e) {
326
329
  loadErrors.push(e);
@@ -335,7 +338,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
335
338
  try {
336
339
  const binding = __require("@rolldown/binding-linux-arm64-musl");
337
340
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
338
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
341
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
339
342
  return binding;
340
343
  } catch (e) {
341
344
  loadErrors.push(e);
@@ -349,7 +352,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
349
352
  try {
350
353
  const binding = __require("@rolldown/binding-linux-arm64-gnu");
351
354
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
352
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
355
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
353
356
  return binding;
354
357
  } catch (e) {
355
358
  loadErrors.push(e);
@@ -364,7 +367,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
364
367
  try {
365
368
  const binding = __require("@rolldown/binding-linux-arm-musleabihf");
366
369
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
367
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
370
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
368
371
  return binding;
369
372
  } catch (e) {
370
373
  loadErrors.push(e);
@@ -378,7 +381,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
378
381
  try {
379
382
  const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
380
383
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
381
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
384
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
382
385
  return binding;
383
386
  } catch (e) {
384
387
  loadErrors.push(e);
@@ -393,7 +396,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
393
396
  try {
394
397
  const binding = __require("@rolldown/binding-linux-loong64-musl");
395
398
  const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
396
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
399
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
397
400
  return binding;
398
401
  } catch (e) {
399
402
  loadErrors.push(e);
@@ -407,7 +410,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
407
410
  try {
408
411
  const binding = __require("@rolldown/binding-linux-loong64-gnu");
409
412
  const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
410
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
413
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
411
414
  return binding;
412
415
  } catch (e) {
413
416
  loadErrors.push(e);
@@ -422,7 +425,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
422
425
  try {
423
426
  const binding = __require("@rolldown/binding-linux-riscv64-musl");
424
427
  const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
425
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
428
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
426
429
  return binding;
427
430
  } catch (e) {
428
431
  loadErrors.push(e);
@@ -436,7 +439,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
436
439
  try {
437
440
  const binding = __require("@rolldown/binding-linux-riscv64-gnu");
438
441
  const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
439
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
442
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
440
443
  return binding;
441
444
  } catch (e) {
442
445
  loadErrors.push(e);
@@ -451,7 +454,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
451
454
  try {
452
455
  const binding = __require("@rolldown/binding-linux-ppc64-gnu");
453
456
  const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
454
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
457
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
455
458
  return binding;
456
459
  } catch (e) {
457
460
  loadErrors.push(e);
@@ -465,7 +468,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
465
468
  try {
466
469
  const binding = __require("@rolldown/binding-linux-s390x-gnu");
467
470
  const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
468
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
471
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
469
472
  return binding;
470
473
  } catch (e) {
471
474
  loadErrors.push(e);
@@ -480,7 +483,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
480
483
  try {
481
484
  const binding = __require("@rolldown/binding-openharmony-arm64");
482
485
  const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
483
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
486
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
484
487
  return binding;
485
488
  } catch (e) {
486
489
  loadErrors.push(e);
@@ -494,7 +497,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
494
497
  try {
495
498
  const binding = __require("@rolldown/binding-openharmony-x64");
496
499
  const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
497
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
500
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
498
501
  return binding;
499
502
  } catch (e) {
500
503
  loadErrors.push(e);
@@ -508,7 +511,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
508
511
  try {
509
512
  const binding = __require("@rolldown/binding-openharmony-arm");
510
513
  const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
511
- if (bindingPackageVersion !== "1.1.3" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.1.3 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
514
+ if (bindingPackageVersion !== "1.2.1" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
512
515
  return binding;
513
516
  } catch (e) {
514
517
  loadErrors.push(e);
@@ -516,30 +519,107 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
516
519
  } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
517
520
  else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
518
521
  }
519
- nativeBinding = requireNative();
520
- const forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || process.env.NAPI_RS_FORCE_WASI === "error";
522
+ function createLoadErrorChain(errors) {
523
+ return errors.reduce((previous, current) => {
524
+ let message;
525
+ try {
526
+ message = current && typeof current.message === "string" ? current.message : String(current);
527
+ } catch {
528
+ message = "Unknown error";
529
+ }
530
+ const error = new Error(message);
531
+ error.cause = previous;
532
+ return error;
533
+ }, null);
534
+ }
535
+ const __napiWasiFlavors = ["wasm32-wasi"];
536
+ const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR;
537
+ const __napiWasiFlavorRequested = typeof __napiWasiFlavor === "string" && __napiWasiFlavor.length > 0;
538
+ if (__napiWasiFlavorRequested && __napiWasiFlavors.indexOf(__napiWasiFlavor) === -1) throw new Error("Unsupported WASI flavor \"" + __napiWasiFlavor + "\". Available flavors: " + __napiWasiFlavors.join(", "));
539
+ const forceWasiError = process.env.NAPI_RS_FORCE_WASI === "error";
540
+ const forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || forceWasiError || __napiWasiFlavorRequested;
541
+ if (!forceWasi) nativeBinding = requireNative();
521
542
  if (!nativeBinding || forceWasi) {
522
543
  let wasiBinding = null;
523
- let wasiBindingError = null;
524
- try {
525
- wasiBinding = __require("../rolldown-binding.wasi.cjs");
526
- nativeBinding = wasiBinding;
527
- } catch (err) {
528
- if (forceWasi) wasiBindingError = err;
544
+ let wasiBindingLoaded = false;
545
+ const wasiBindingErrors = [];
546
+ const __napiWasiResolveCandidate = (specifier, isPackage, localArtifacts) => {
547
+ try {
548
+ __require.resolve(specifier);
549
+ } catch (resolveError) {
550
+ if (!resolveError || resolveError.code !== "MODULE_NOT_FOUND") throw resolveError;
551
+ if (isPackage) {
552
+ try {
553
+ __require.resolve(specifier + "/package.json");
554
+ } catch (packageError) {
555
+ if (packageError && packageError.code === "MODULE_NOT_FOUND") return resolveError;
556
+ throw resolveError;
557
+ }
558
+ throw resolveError;
559
+ }
560
+ return resolveError;
561
+ }
562
+ if (localArtifacts) {
563
+ let artifactError = null;
564
+ for (let i = 0; i < localArtifacts.length; i++) try {
565
+ __require.resolve(localArtifacts[i]);
566
+ return null;
567
+ } catch (resolveError) {
568
+ if (!resolveError || resolveError.code !== "MODULE_NOT_FOUND") throw resolveError;
569
+ artifactError = resolveError;
570
+ }
571
+ return artifactError;
572
+ }
573
+ return null;
574
+ };
575
+ if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
576
+ let candidateError = null;
577
+ let candidateFailed = false;
578
+ try {
579
+ candidateError = __napiWasiResolveCandidate("./rolldown-binding.wasi.cjs", false, ["./rolldown-binding.wasm32-wasi.debug.wasm", "./rolldown-binding.wasm32-wasi.wasm"]);
580
+ candidateFailed = candidateError !== null;
581
+ if (!candidateFailed) {
582
+ wasiBinding = __require("../rolldown-binding.wasi.cjs");
583
+ nativeBinding = wasiBinding;
584
+ wasiBindingLoaded = true;
585
+ }
586
+ } catch (err) {
587
+ candidateError = err;
588
+ candidateFailed = true;
589
+ }
590
+ if (candidateFailed) {
591
+ wasiBindingErrors.push(candidateError);
592
+ loadErrors.push(candidateError);
593
+ }
529
594
  }
530
- if (!nativeBinding || forceWasi) try {
531
- wasiBinding = __require("@rolldown/binding-wasm32-wasi");
532
- nativeBinding = wasiBinding;
533
- } catch (err) {
534
- if (forceWasi) {
535
- if (!wasiBindingError) wasiBindingError = err;
536
- else wasiBindingError.cause = err;
537
- loadErrors.push(err);
595
+ if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
596
+ let candidateError = null;
597
+ let candidateFailed = false;
598
+ try {
599
+ candidateError = __napiWasiResolveCandidate("@rolldown/binding-wasm32-wasi", true, void 0);
600
+ candidateFailed = candidateError !== null;
601
+ if (!candidateFailed) {
602
+ if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
603
+ const bindingPackageVersion = __require("@rolldown/binding-wasm32-wasi/package.json").version;
604
+ if (bindingPackageVersion !== "1.2.1") throw new Error(`WASI binding package version mismatch, expected 1.2.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
605
+ }
606
+ wasiBinding = __require("@rolldown/binding-wasm32-wasi");
607
+ nativeBinding = wasiBinding;
608
+ wasiBindingLoaded = true;
609
+ }
610
+ } catch (err) {
611
+ candidateError = err;
612
+ candidateFailed = true;
613
+ }
614
+ if (candidateFailed) {
615
+ wasiBindingErrors.push(candidateError);
616
+ loadErrors.push(candidateError);
538
617
  }
539
618
  }
540
- if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
541
- const error = /* @__PURE__ */ new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
542
- error.cause = wasiBindingError;
619
+ if (!wasiBindingLoaded && forceWasi && !forceWasiError && !__napiWasiFlavorRequested) nativeBinding = requireNative();
620
+ if ((forceWasiError || __napiWasiFlavorRequested) && !wasiBindingLoaded) {
621
+ const error = /* @__PURE__ */ new Error(__napiWasiFlavorRequested ? "WASI binding for flavor \"" + __napiWasiFlavor + "\" not found" : "WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
622
+ error.cause = createLoadErrorChain(wasiBindingErrors);
543
623
  throw error;
544
624
  }
545
625
  }
@@ -551,10 +631,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
551
631
  if (!nativeBinding) {
552
632
  if (loadErrors.length > 0) {
553
633
  const error = /* @__PURE__ */ new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.");
554
- error.cause = loadErrors.reduce((err, cur) => {
555
- cur.cause = err;
556
- return cur;
557
- });
634
+ error.cause = createLoadErrorChain(loadErrors);
558
635
  throw error;
559
636
  }
560
637
  throw new Error(`Failed to load native binding`);
@@ -607,7 +684,6 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
607
684
  module.exports.BindingWatcherChangeData = nativeBinding.BindingWatcherChangeData;
608
685
  module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
609
686
  module.exports.ParallelJsPluginRegistry = nativeBinding.ParallelJsPluginRegistry;
610
- module.exports.ScheduledBuild = nativeBinding.ScheduledBuild;
611
687
  module.exports.TraceSubscriberGuard = nativeBinding.TraceSubscriberGuard;
612
688
  module.exports.TsconfigCache = nativeBinding.TsconfigCache;
613
689
  module.exports.BindingAttachDebugInfo = nativeBinding.BindingAttachDebugInfo;
@@ -630,7 +706,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
630
706
  module.exports.startAsyncRuntime = nativeBinding.startAsyncRuntime;
631
707
  }));
632
708
  //#endregion
633
- //#region ../../node_modules/rolldown/dist/shared/logs-aMKUxRpj.mjs
709
+ //#region ../../node_modules/rolldown/dist/shared/logs-DmYCAKcW.mjs
634
710
  function spaces(index) {
635
711
  let result = "";
636
712
  while (index--) result += " ";
@@ -725,7 +801,12 @@ function getLocator(source, options = {}) {
725
801
  function locate(source, search, options) {
726
802
  return getLocator(source, options)(search, options && options.startIndex);
727
803
  }
728
- var INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", PARSE_ERROR = "PARSE_ERROR";
804
+ var INVALID_LOG_POSITION = "INVALID_LOG_POSITION";
805
+ var PLUGIN_ERROR = "PLUGIN_ERROR";
806
+ var INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN";
807
+ var CYCLE_LOADING = "CYCLE_LOADING";
808
+ var PARSE_ERROR = "PARSE_ERROR";
809
+ var VALIDATION_ERROR = "VALIDATION_ERROR";
729
810
  function logParseError(message, id, pos) {
730
811
  return {
731
812
  code: PARSE_ERROR,
@@ -734,6 +815,12 @@ function logParseError(message, id, pos) {
734
815
  pos
735
816
  };
736
817
  }
818
+ function logFailedValidation(message) {
819
+ return {
820
+ code: VALIDATION_ERROR,
821
+ message
822
+ };
823
+ }
737
824
  function logInvalidLogPosition(pluginName) {
738
825
  return {
739
826
  code: INVALID_LOG_POSITION,
@@ -836,7 +923,7 @@ function isReadonlyArray(input) {
836
923
  return Array.isArray(input);
837
924
  }
838
925
  //#endregion
839
- //#region ../../node_modules/rolldown/dist/shared/misc-CoQm4NHO.mjs
926
+ //#region ../../node_modules/rolldown/dist/shared/misc-DOSKtd97.mjs
840
927
  function arraify(value) {
841
928
  return Array.isArray(value) ? value : [value];
842
929
  }
@@ -852,8 +939,16 @@ function unsupported(info) {
852
939
  throw new Error(`UNSUPPORTED: ${info}`);
853
940
  }
854
941
  function noop(..._args) {}
942
+ var ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/;
943
+ /**
944
+ * Whether `name` is a path fragment — an absolute or relative path. Emitted file
945
+ * names, `[name]` substitutions and file-name patterns can be neither.
946
+ */
947
+ function isPathFragment(name) {
948
+ return name[0] === "/" || name[0] === "." && (name[1] === "/" || name[1] === ".") || ABSOLUTE_PATH_REGEX.test(name);
949
+ }
855
950
  //#endregion
856
- //#region ../../node_modules/rolldown/dist/shared/error-B68YLzl3.mjs
951
+ //#region ../../node_modules/rolldown/dist/shared/error-BgfXq0Tb.mjs
857
952
  function bindingifySourcemap$1(map) {
858
953
  if (map == null) return;
859
954
  return { inner: typeof map === "string" ? map : {
@@ -932,8 +1027,8 @@ function joinNewLine(s1, s2) {
932
1027
  return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
933
1028
  }
934
1029
  //#endregion
935
- //#region ../../node_modules/rolldown/dist/shared/parse-CTgsjpo8.mjs
936
- var import_binding$4 = /* @__PURE__ */ __toESM(require_binding(), 1);
1030
+ //#region ../../node_modules/rolldown/dist/shared/parse-DQIYJwT4.mjs
1031
+ var import_binding$5 = /* @__PURE__ */ __toESM(require_binding(), 1);
937
1032
  function wrap$1(result) {
938
1033
  let program, module, comments, errors;
939
1034
  return {
@@ -981,7 +1076,7 @@ function applyFix(program, fixPath) {
981
1076
  * @category Utilities
982
1077
  */
983
1078
  function parseSync(filename, sourceText, options) {
984
- return wrap$1((0, import_binding$4.parseSync)(filename, sourceText, options));
1079
+ return wrap$1((0, import_binding$5.parseSync)(filename, sourceText, options));
985
1080
  }
986
1081
  //#endregion
987
1082
  //#region ../../node_modules/rolldown/dist/parse-ast-index.mjs
@@ -1115,7 +1210,7 @@ function exclude(expr) {
1115
1210
  *
1116
1211
  * @category Plugin APIs
1117
1212
  */
1118
- var VERSION = "1.1.3";
1213
+ var VERSION = "1.2.1";
1119
1214
  var LOG_LEVEL_SILENT = "silent";
1120
1215
  var LOG_LEVEL_WARN = "warn";
1121
1216
  var LOG_LEVEL_INFO = "info";
@@ -1154,6 +1249,24 @@ function normalizeHook(hook) {
1154
1249
  }
1155
1250
  unreachable("Invalid hook type");
1156
1251
  }
1252
+ /**
1253
+ * Returns the `_parallel` marker of a parallel plugin, or `undefined` if the
1254
+ * given plugin is not one.
1255
+ *
1256
+ * Detection is descriptor-based instead of using the `in` operator: only an
1257
+ * own data property named `_parallel` with the expected shape counts. This
1258
+ * avoids false positives from inherited or accessor `_parallel` properties on
1259
+ * regular plugins, and guarantees that callers can safely read `fileUrl` and
1260
+ * `options` from the returned value.
1261
+ */
1262
+ function getParallelPluginInfo(plugin) {
1263
+ if (plugin === null || typeof plugin !== "object") return;
1264
+ const descriptor = Object.getOwnPropertyDescriptor(plugin, "_parallel");
1265
+ if (!descriptor || !("value" in descriptor)) return;
1266
+ const parallel = descriptor.value;
1267
+ if (parallel === null || typeof parallel !== "object" || typeof parallel.fileUrl !== "string") return;
1268
+ return parallel;
1269
+ }
1157
1270
  var MinimalPluginContextImpl = class {
1158
1271
  pluginName;
1159
1272
  hookName;
@@ -1177,7 +1290,7 @@ var MinimalPluginContextImpl = class {
1177
1290
  return error(logPluginError(normalizeLog(e), this.pluginName, { hook: this.hookName }));
1178
1291
  }
1179
1292
  };
1180
- var import_binding$3 = /* @__PURE__ */ __toESM(require_binding(), 1);
1293
+ var import_binding$4 = /* @__PURE__ */ __toESM(require_binding(), 1);
1181
1294
  var LAZY_FIELDS_KEY = Symbol("__lazy_fields__");
1182
1295
  /**
1183
1296
  * Base class for classes that use `@lazyProp` decorated properties.
@@ -1693,6 +1806,9 @@ var NormalizedOutputOptionsImpl = class extends PlainObjectLike {
1693
1806
  get sourcemap() {
1694
1807
  return this.inner.sourcemap;
1695
1808
  }
1809
+ get sourcemapFileNames() {
1810
+ return this.inner.sourcemapFilenames || this.outputOptions.sourcemapFileNames;
1811
+ }
1696
1812
  get sourcemapBaseUrl() {
1697
1813
  return this.inner.sourcemapBaseUrl ?? void 0;
1698
1814
  }
@@ -1814,6 +1930,7 @@ __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "assetFileNames",
1814
1930
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "format", null);
1815
1931
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "exports", null);
1816
1932
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemap", null);
1933
+ __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapFileNames", null);
1817
1934
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapBaseUrl", null);
1818
1935
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "shimMissingExports", null);
1819
1936
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "name", null);
@@ -1969,7 +2086,7 @@ var PluginContextData = class {
1969
2086
  this.loadModulePromiseMap.clear();
1970
2087
  }
1971
2088
  };
1972
- Object.defineProperty(import_binding$3.BindingMagicString.prototype, "isRolldownMagicString", {
2089
+ Object.defineProperty(import_binding$4.BindingMagicString.prototype, "isRolldownMagicString", {
1973
2090
  value: true,
1974
2091
  writable: false,
1975
2092
  configurable: false
@@ -1977,49 +2094,49 @@ Object.defineProperty(import_binding$3.BindingMagicString.prototype, "isRolldown
1977
2094
  function assertString(content, msg) {
1978
2095
  if (typeof content !== "string") throw new TypeError(msg);
1979
2096
  }
1980
- var nativeAppend = import_binding$3.BindingMagicString.prototype.append;
1981
- var nativePrepend = import_binding$3.BindingMagicString.prototype.prepend;
1982
- var nativeAppendLeft = import_binding$3.BindingMagicString.prototype.appendLeft;
1983
- var nativeAppendRight = import_binding$3.BindingMagicString.prototype.appendRight;
1984
- var nativePrependLeft = import_binding$3.BindingMagicString.prototype.prependLeft;
1985
- var nativePrependRight = import_binding$3.BindingMagicString.prototype.prependRight;
1986
- var nativeOverwrite = import_binding$3.BindingMagicString.prototype.overwrite;
1987
- var nativeUpdate = import_binding$3.BindingMagicString.prototype.update;
1988
- import_binding$3.BindingMagicString.prototype.append = function(content) {
2097
+ var nativeAppend = import_binding$4.BindingMagicString.prototype.append;
2098
+ var nativePrepend = import_binding$4.BindingMagicString.prototype.prepend;
2099
+ var nativeAppendLeft = import_binding$4.BindingMagicString.prototype.appendLeft;
2100
+ var nativeAppendRight = import_binding$4.BindingMagicString.prototype.appendRight;
2101
+ var nativePrependLeft = import_binding$4.BindingMagicString.prototype.prependLeft;
2102
+ var nativePrependRight = import_binding$4.BindingMagicString.prototype.prependRight;
2103
+ var nativeOverwrite = import_binding$4.BindingMagicString.prototype.overwrite;
2104
+ var nativeUpdate = import_binding$4.BindingMagicString.prototype.update;
2105
+ import_binding$4.BindingMagicString.prototype.append = function(content) {
1989
2106
  assertString(content, "outro content must be a string");
1990
2107
  return nativeAppend.call(this, content);
1991
2108
  };
1992
- import_binding$3.BindingMagicString.prototype.prepend = function(content) {
2109
+ import_binding$4.BindingMagicString.prototype.prepend = function(content) {
1993
2110
  assertString(content, "outro content must be a string");
1994
2111
  return nativePrepend.call(this, content);
1995
2112
  };
1996
- import_binding$3.BindingMagicString.prototype.appendLeft = function(index, content) {
2113
+ import_binding$4.BindingMagicString.prototype.appendLeft = function(index, content) {
1997
2114
  assertString(content, "inserted content must be a string");
1998
2115
  return nativeAppendLeft.call(this, index, content);
1999
2116
  };
2000
- import_binding$3.BindingMagicString.prototype.appendRight = function(index, content) {
2117
+ import_binding$4.BindingMagicString.prototype.appendRight = function(index, content) {
2001
2118
  assertString(content, "inserted content must be a string");
2002
2119
  return nativeAppendRight.call(this, index, content);
2003
2120
  };
2004
- import_binding$3.BindingMagicString.prototype.prependLeft = function(index, content) {
2121
+ import_binding$4.BindingMagicString.prototype.prependLeft = function(index, content) {
2005
2122
  assertString(content, "inserted content must be a string");
2006
2123
  return nativePrependLeft.call(this, index, content);
2007
2124
  };
2008
- import_binding$3.BindingMagicString.prototype.prependRight = function(index, content) {
2125
+ import_binding$4.BindingMagicString.prototype.prependRight = function(index, content) {
2009
2126
  assertString(content, "inserted content must be a string");
2010
2127
  return nativePrependRight.call(this, index, content);
2011
2128
  };
2012
- import_binding$3.BindingMagicString.prototype.overwrite = function(start, end, content, options) {
2129
+ import_binding$4.BindingMagicString.prototype.overwrite = function(start, end, content, options) {
2013
2130
  assertString(content, "replacement content must be a string");
2014
2131
  return nativeOverwrite.call(this, start, end, content, options);
2015
2132
  };
2016
- import_binding$3.BindingMagicString.prototype.update = function(start, end, content, options) {
2133
+ import_binding$4.BindingMagicString.prototype.update = function(start, end, content, options) {
2017
2134
  assertString(content, "replacement content must be a string");
2018
2135
  return nativeUpdate.call(this, start, end, content, options);
2019
2136
  };
2020
- var nativeReplace = import_binding$3.BindingMagicString.prototype.replace;
2021
- var nativeReplaceAll = import_binding$3.BindingMagicString.prototype.replaceAll;
2022
- import_binding$3.BindingMagicString.prototype.replace = function(searchValue, replacement) {
2137
+ var nativeReplace = import_binding$4.BindingMagicString.prototype.replace;
2138
+ var nativeReplaceAll = import_binding$4.BindingMagicString.prototype.replaceAll;
2139
+ import_binding$4.BindingMagicString.prototype.replace = function(searchValue, replacement) {
2023
2140
  if (typeof searchValue === "string") return nativeReplace.call(this, searchValue, replacement);
2024
2141
  if (searchValue.global) searchValue.lastIndex = 0;
2025
2142
  const lastMatchEnd = this.replaceRegex(searchValue, replacement);
@@ -2027,7 +2144,7 @@ import_binding$3.BindingMagicString.prototype.replace = function(searchValue, re
2027
2144
  else if (searchValue.sticky) searchValue.lastIndex = lastMatchEnd === -1 ? 0 : lastMatchEnd;
2028
2145
  return this;
2029
2146
  };
2030
- import_binding$3.BindingMagicString.prototype.replaceAll = function(searchValue, replacement) {
2147
+ import_binding$4.BindingMagicString.prototype.replaceAll = function(searchValue, replacement) {
2031
2148
  if (typeof searchValue === "string") return nativeReplaceAll.call(this, searchValue, replacement);
2032
2149
  if (!searchValue.global) throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");
2033
2150
  searchValue.lastIndex = 0;
@@ -2040,7 +2157,7 @@ import_binding$3.BindingMagicString.prototype.replaceAll = function(searchValue,
2040
2157
  *
2041
2158
  * @experimental
2042
2159
  */
2043
- var RolldownMagicString = import_binding$3.BindingMagicString;
2160
+ var RolldownMagicString = import_binding$4.BindingMagicString;
2044
2161
  function isEmptySourcemapFiled(array) {
2045
2162
  if (!array) return true;
2046
2163
  if (array.length === 0 || !array[0]) return true;
@@ -2133,6 +2250,20 @@ function containsImporterId(expr) {
2133
2250
  function assertNoImporterId(filterExprs, hookName) {
2134
2251
  if (filterExprs?.some(containsImporterId)) throw new Error(`The \`importerId\` filter can only be used with the \`resolveId\` hook, but it was used with the \`${hookName}\` hook.`);
2135
2252
  }
2253
+ function containsStringId(expr) {
2254
+ switch (expr.kind) {
2255
+ case "and":
2256
+ case "or": return expr.args.some(containsStringId);
2257
+ case "not":
2258
+ case "include":
2259
+ case "exclude": return containsStringId(expr.expr);
2260
+ case "id": return typeof expr.pattern === "string";
2261
+ default: return false;
2262
+ }
2263
+ }
2264
+ function assertNoStringId(filterExprs, hookName) {
2265
+ if (filterExprs?.some(containsStringId)) throw new Error(`A string \`id\` filter is not supported for the \`${hookName}\` hook, because its \`id\` is the import specifier rather than a resolved path. Use a RegExp instead.`);
2266
+ }
2136
2267
  function bindingifyFilterExprImpl(expr, list) {
2137
2268
  switch (expr.kind) {
2138
2269
  case "and": {
@@ -2206,8 +2337,11 @@ function bindingifyFilterExprImpl(expr, list) {
2206
2337
  }
2207
2338
  function bindingifyResolveIdFilter(filterOption) {
2208
2339
  if (!filterOption) return;
2209
- if (Array.isArray(filterOption)) return { value: filterOption.map(bindingifyFilterExpr) };
2210
- return filterOption.id ? bindingifyGeneralHookFilter("id", filterOption.id) : void 0;
2340
+ const filterExprs = Array.isArray(filterOption) ? filterOption : filterOption.id ? generalHookFilterMatcherToFilterExprs(filterOption.id, "id") : void 0;
2341
+ assertNoStringId(filterExprs, "resolveId");
2342
+ if (!filterExprs) return;
2343
+ const value = filterExprs.map(bindingifyFilterExpr);
2344
+ return value.length > 0 ? { value } : void 0;
2211
2345
  }
2212
2346
  function bindingifyLoadFilter(filterOption) {
2213
2347
  if (!filterOption) return;
@@ -2238,13 +2372,21 @@ function bindingifyPluginHookMeta(options) {
2238
2372
  }
2239
2373
  function bindingPluginOrder(order) {
2240
2374
  switch (order) {
2241
- case "post": return import_binding$3.BindingPluginOrder.Post;
2242
- case "pre": return import_binding$3.BindingPluginOrder.Pre;
2375
+ case "post": return import_binding$4.BindingPluginOrder.Post;
2376
+ case "pre": return import_binding$4.BindingPluginOrder.Pre;
2243
2377
  case null:
2244
2378
  case void 0: return;
2245
2379
  default: throw new Error(`Unknown plugin order: ${order}`);
2246
2380
  }
2247
2381
  }
2382
+ function bindingifyHook(hook, build) {
2383
+ if (!hook) return {};
2384
+ const normalized = normalizeHook(hook);
2385
+ return {
2386
+ ...build(normalized),
2387
+ meta: bindingifyPluginHookMeta(normalized.meta)
2388
+ };
2389
+ }
2248
2390
  var fsModule = {
2249
2391
  appendFile: node_fs_promises.default.appendFile,
2250
2392
  copyFile: node_fs_promises.default.copyFile,
@@ -2324,17 +2466,23 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2324
2466
  };
2325
2467
  }
2326
2468
  emitFile = (file) => {
2327
- if (file.type === "prebuilt-chunk") return this.context.emitPrebuiltChunk({
2328
- fileName: file.fileName,
2329
- name: file.name,
2330
- code: file.code,
2331
- exports: file.exports,
2332
- map: bindingifySourcemap$1(file.map),
2333
- sourcemapFileName: file.sourcemapFileName,
2334
- facadeModuleId: file.facadeModuleId,
2335
- isEntry: file.isEntry,
2336
- isDynamicEntry: file.isDynamicEntry
2337
- });
2469
+ if (file.type === "prebuilt-chunk") {
2470
+ if (typeof file.code !== "string") return error(logFailedValidation(`Emitted prebuilt chunks need to have a valid string code, received "${file.code}".`));
2471
+ if (typeof file.fileName !== "string" || isPathFragment(file.fileName)) return error(logFailedValidation(`The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "${file.fileName}".`));
2472
+ return this.context.emitPrebuiltChunk({
2473
+ fileName: file.fileName,
2474
+ name: file.name,
2475
+ code: file.code,
2476
+ exports: file.exports,
2477
+ map: bindingifySourcemap$1(file.map),
2478
+ sourcemapFileName: file.sourcemapFileName,
2479
+ facadeModuleId: file.facadeModuleId,
2480
+ isEntry: file.isEntry,
2481
+ isDynamicEntry: file.isDynamicEntry
2482
+ });
2483
+ }
2484
+ const validatedName = file.fileName || file.name;
2485
+ if (typeof validatedName === "string" && isPathFragment(validatedName)) return error(logFailedValidation(`The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "${validatedName}".`));
2338
2486
  if (file.type === "chunk") return this.context.emitChunk({
2339
2487
  preserveEntrySignatures: bindingifyPreserveEntrySignatures(file.preserveSignature),
2340
2488
  ...file
@@ -2370,6 +2518,9 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2370
2518
  return parseAst(input, options);
2371
2519
  }
2372
2520
  };
2521
+ function createPluginContext(args, ctx) {
2522
+ return new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
2523
+ }
2373
2524
  var LoadPluginContextImpl = class extends PluginContextImpl {
2374
2525
  inner;
2375
2526
  constructor(outputOptions, context, plugin, data, inner, moduleId, onLog, logLevelOption, watchMode) {
@@ -2417,36 +2568,19 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
2417
2568
  this.inner.sendMagicString(s);
2418
2569
  }
2419
2570
  };
2420
- function createPluginContext(args, ctx) {
2421
- return new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
2422
- }
2423
2571
  function bindingifyBuildStart(args) {
2424
- const hook = args.plugin.buildStart;
2425
- if (!hook) return {};
2426
- const { handler, meta } = normalizeHook(hook);
2427
- return {
2428
- plugin: async (ctx, opts) => {
2429
- await handler.call(createPluginContext(args, ctx), args.pluginContextData.getInputOptions(opts));
2430
- },
2431
- meta: bindingifyPluginHookMeta(meta)
2432
- };
2572
+ return bindingifyHook(args.plugin.buildStart, ({ handler }) => ({ plugin: async (ctx, opts) => {
2573
+ await handler.call(createPluginContext(args, ctx), args.pluginContextData.getInputOptions(opts));
2574
+ } }));
2433
2575
  }
2434
2576
  function bindingifyBuildEnd(args) {
2435
- const hook = args.plugin.buildEnd;
2436
- if (!hook) return {};
2437
- const { handler, meta } = normalizeHook(hook);
2438
- return {
2439
- plugin: async (ctx, err) => {
2440
- await handler.call(createPluginContext(args, ctx), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
2441
- },
2442
- meta: bindingifyPluginHookMeta(meta)
2443
- };
2577
+ return bindingifyHook(args.plugin.buildEnd, ({ handler }) => ({ plugin: async (ctx, err) => {
2578
+ await handler.call(createPluginContext(args, ctx), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
2579
+ } }));
2444
2580
  }
2445
2581
  function bindingifyResolveId(args) {
2446
2582
  const hook = args.plugin.resolveId;
2447
- if (!hook) return {};
2448
- const { handler, meta, options } = normalizeHook(hook);
2449
- return {
2583
+ return bindingifyHook(hook, ({ handler, options }) => ({
2450
2584
  plugin: async (ctx, specifier, importer, extraOptions) => {
2451
2585
  const contextResolveOptions = extraOptions.custom != null ? args.pluginContextData.getSavedResolveOptions(extraOptions.custom) : void 0;
2452
2586
  const ret = await handler.call(createPluginContext(args, ctx), specifier, importer ?? void 0, {
@@ -2476,44 +2610,34 @@ function bindingifyResolveId(args) {
2476
2610
  packageJsonPath: ret.packageJsonPath
2477
2611
  };
2478
2612
  },
2479
- meta: bindingifyPluginHookMeta(meta),
2480
2613
  filter: bindingifyResolveIdFilter(options.filter)
2481
- };
2614
+ }));
2482
2615
  }
2483
2616
  function bindingifyResolveDynamicImport(args) {
2484
- const hook = args.plugin.resolveDynamicImport;
2485
- if (!hook) return {};
2486
- const { handler, meta } = normalizeHook(hook);
2487
- return {
2488
- plugin: async (ctx, specifier, importer) => {
2489
- const ret = await handler.call(createPluginContext(args, ctx), specifier, importer ?? void 0);
2490
- if (ret == null) return;
2491
- if (ret === false) return {
2492
- id: specifier,
2493
- external: true
2494
- };
2495
- if (typeof ret === "string") return { id: ret };
2496
- const result = {
2497
- id: ret.id,
2498
- external: ret.external,
2499
- packageJsonPath: ret.packageJsonPath
2500
- };
2501
- if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
2502
- args.pluginContextData.updateModuleOption(ret.id, {
2503
- meta: ret.meta || {},
2504
- moduleSideEffects: ret.moduleSideEffects || null,
2505
- invalidate: false
2506
- });
2507
- return result;
2508
- },
2509
- meta: bindingifyPluginHookMeta(meta)
2510
- };
2617
+ return bindingifyHook(args.plugin.resolveDynamicImport, ({ handler }) => ({ plugin: async (ctx, specifier, importer) => {
2618
+ const ret = await handler.call(createPluginContext(args, ctx), specifier, importer ?? void 0);
2619
+ if (ret == null) return;
2620
+ if (ret === false) return {
2621
+ id: specifier,
2622
+ external: true
2623
+ };
2624
+ if (typeof ret === "string") return { id: ret };
2625
+ const result = {
2626
+ id: ret.id,
2627
+ external: ret.external,
2628
+ packageJsonPath: ret.packageJsonPath
2629
+ };
2630
+ if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
2631
+ args.pluginContextData.updateModuleOption(ret.id, {
2632
+ meta: ret.meta || {},
2633
+ moduleSideEffects: ret.moduleSideEffects || null,
2634
+ invalidate: false
2635
+ });
2636
+ return result;
2637
+ } }));
2511
2638
  }
2512
2639
  function bindingifyTransform(args) {
2513
- const hook = args.plugin.transform;
2514
- if (!hook) return {};
2515
- const { handler, meta, options } = normalizeHook(hook);
2516
- return {
2640
+ return bindingifyHook(args.plugin.transform, ({ handler, options }) => ({
2517
2641
  plugin: async (ctx, code, id, meta) => {
2518
2642
  let magicStringInstance, astInstance;
2519
2643
  Object.defineProperties(meta, {
@@ -2529,10 +2653,7 @@ function bindingifyTransform(args) {
2529
2653
  case "js":
2530
2654
  case "jsx":
2531
2655
  case "ts":
2532
- case "tsx":
2533
- lang = meta.moduleType;
2534
- break;
2535
- default: break;
2656
+ case "tsx": lang = meta.moduleType;
2536
2657
  }
2537
2658
  astInstance = parseAst(code, {
2538
2659
  astType: meta.moduleType.includes("ts") ? "ts" : "js",
@@ -2568,15 +2689,11 @@ function bindingifyTransform(args) {
2568
2689
  moduleType: ret.moduleType
2569
2690
  };
2570
2691
  },
2571
- meta: bindingifyPluginHookMeta(meta),
2572
2692
  filter: bindingifyTransformFilter(options.filter)
2573
- };
2693
+ }));
2574
2694
  }
2575
2695
  function bindingifyLoad(args) {
2576
- const hook = args.plugin.load;
2577
- if (!hook) return {};
2578
- const { handler, meta, options } = normalizeHook(hook);
2579
- return {
2696
+ return bindingifyHook(args.plugin.load, ({ handler, options }) => ({
2580
2697
  plugin: async (ctx, id) => {
2581
2698
  const ret = await handler.call(new LoadPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, args.onLog, args.logLevel, args.watchMode), id);
2582
2699
  if (ret == null) return;
@@ -2594,9 +2711,8 @@ function bindingifyLoad(args) {
2594
2711
  moduleSideEffects: moduleOption.moduleSideEffects ?? void 0
2595
2712
  };
2596
2713
  },
2597
- meta: bindingifyPluginHookMeta(meta),
2598
2714
  filter: bindingifyLoadFilter(options.filter)
2599
- };
2715
+ }));
2600
2716
  }
2601
2717
  function preProcessSourceMap(ret, id) {
2602
2718
  if (!ret.map) return;
@@ -2609,32 +2725,17 @@ function preProcessSourceMap(ret, id) {
2609
2725
  return map;
2610
2726
  }
2611
2727
  function bindingifyModuleParsed(args) {
2612
- const hook = args.plugin.moduleParsed;
2613
- if (!hook) return {};
2614
- const { handler, meta } = normalizeHook(hook);
2615
- return {
2616
- plugin: async (ctx, moduleInfo) => {
2617
- await handler.call(createPluginContext(args, ctx), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
2618
- },
2619
- meta: bindingifyPluginHookMeta(meta)
2620
- };
2728
+ return bindingifyHook(args.plugin.moduleParsed, ({ handler }) => ({ plugin: async (ctx, moduleInfo) => {
2729
+ await handler.call(createPluginContext(args, ctx), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
2730
+ } }));
2621
2731
  }
2622
2732
  function bindingifyRenderStart(args) {
2623
- const hook = args.plugin.renderStart;
2624
- if (!hook) return {};
2625
- const { handler, meta } = normalizeHook(hook);
2626
- return {
2627
- plugin: async (ctx, opts) => {
2628
- handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), args.pluginContextData.getOutputOptions(opts), args.pluginContextData.getInputOptions(opts));
2629
- },
2630
- meta: bindingifyPluginHookMeta(meta)
2631
- };
2733
+ return bindingifyHook(args.plugin.renderStart, ({ handler }) => ({ plugin: async (ctx, opts) => {
2734
+ await handler.call(createPluginContext(args, ctx), args.pluginContextData.getOutputOptions(opts), args.pluginContextData.getInputOptions(opts));
2735
+ } }));
2632
2736
  }
2633
2737
  function bindingifyRenderChunk(args) {
2634
- const hook = args.plugin.renderChunk;
2635
- if (!hook) return {};
2636
- const { handler, meta, options } = normalizeHook(hook);
2637
- return {
2738
+ return bindingifyHook(args.plugin.renderChunk, ({ handler, options }) => ({
2638
2739
  plugin: async (ctx, code, chunk, opts, meta) => {
2639
2740
  if (args.pluginContextData.getRenderChunkMeta() == null) args.pluginContextData.setRenderChunkMeta({ chunks: Object.fromEntries(Object.entries(meta.chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
2640
2741
  const renderChunkMeta = args.pluginContextData.getRenderChunkMeta();
@@ -2647,7 +2748,7 @@ function bindingifyRenderChunk(args) {
2647
2748
  },
2648
2749
  configurable: true
2649
2750
  });
2650
- const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), code, transformRenderedChunk(chunk), args.pluginContextData.getOutputOptions(opts), renderChunkMeta);
2751
+ const ret = await handler.call(createPluginContext(args, ctx), code, transformRenderedChunk(chunk), args.pluginContextData.getOutputOptions(opts), renderChunkMeta);
2651
2752
  if (ret == null) return;
2652
2753
  if (ret instanceof RolldownMagicString) {
2653
2754
  const normalizedCode = ret.toString();
@@ -2698,148 +2799,79 @@ function bindingifyRenderChunk(args) {
2698
2799
  map: bindingifySourcemap$1(ret.map)
2699
2800
  };
2700
2801
  },
2701
- meta: bindingifyPluginHookMeta(meta),
2702
2802
  filter: bindingifyRenderChunkFilter(options.filter)
2703
- };
2803
+ }));
2704
2804
  }
2705
2805
  function bindingifyAugmentChunkHash(args) {
2706
- const hook = args.plugin.augmentChunkHash;
2707
- if (!hook) return {};
2708
- const { handler, meta } = normalizeHook(hook);
2709
- return {
2710
- plugin: async (ctx, chunk) => {
2711
- return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
2712
- },
2713
- meta: bindingifyPluginHookMeta(meta)
2714
- };
2806
+ return bindingifyHook(args.plugin.augmentChunkHash, ({ handler }) => ({ plugin: async (ctx, chunk) => {
2807
+ return handler.call(createPluginContext(args, ctx), transformRenderedChunk(chunk));
2808
+ } }));
2809
+ }
2810
+ function bindingifyResolveFileUrl(args) {
2811
+ return bindingifyHook(args.plugin.resolveFileUrl, ({ handler }) => ({ plugin: async (ctx, resolveFileUrlArgs) => {
2812
+ return handler.call(createPluginContext(args, ctx), resolveFileUrlArgs);
2813
+ } }));
2715
2814
  }
2716
2815
  function bindingifyRenderError(args) {
2717
- const hook = args.plugin.renderError;
2718
- if (!hook) return {};
2719
- const { handler, meta } = normalizeHook(hook);
2816
+ return bindingifyHook(args.plugin.renderError, ({ handler }) => ({ plugin: async (ctx, err) => {
2817
+ await handler.call(createPluginContext(args, ctx), aggregateBindingErrorsIntoJsError(err));
2818
+ } }));
2819
+ }
2820
+ function createOutputBundle(args, ctx, bundle) {
2821
+ const changed = {
2822
+ updated: /* @__PURE__ */ new Set(),
2823
+ deleted: /* @__PURE__ */ new Set()
2824
+ };
2825
+ const context = createPluginContext(args, ctx);
2720
2826
  return {
2721
- plugin: async (ctx, err) => {
2722
- handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), aggregateBindingErrorsIntoJsError(err));
2723
- },
2724
- meta: bindingifyPluginHookMeta(meta)
2827
+ changed,
2828
+ context,
2829
+ output: transformToOutputBundle(context, unwrapBindingResult(bundle), changed)
2725
2830
  };
2726
2831
  }
2727
2832
  function bindingifyGenerateBundle(args) {
2728
- const hook = args.plugin.generateBundle;
2729
- if (!hook) return {};
2730
- const { handler, meta } = normalizeHook(hook);
2731
- return {
2732
- plugin: async (ctx, bundle, isWrite, opts) => {
2733
- const changed = {
2734
- updated: /* @__PURE__ */ new Set(),
2735
- deleted: /* @__PURE__ */ new Set()
2736
- };
2737
- const context = new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
2738
- const output = transformToOutputBundle(context, unwrapBindingResult(bundle), changed);
2739
- await handler.call(context, args.pluginContextData.getOutputOptions(opts), output, isWrite);
2740
- return collectChangedBundle(changed, output);
2741
- },
2742
- meta: bindingifyPluginHookMeta(meta)
2743
- };
2833
+ return bindingifyHook(args.plugin.generateBundle, ({ handler }) => ({ plugin: async (ctx, bundle, isWrite, opts) => {
2834
+ const { changed, context, output } = createOutputBundle(args, ctx, bundle);
2835
+ await handler.call(context, args.pluginContextData.getOutputOptions(opts), output, isWrite);
2836
+ return collectChangedBundle(changed, output);
2837
+ } }));
2744
2838
  }
2745
2839
  function bindingifyWriteBundle(args) {
2746
- const hook = args.plugin.writeBundle;
2747
- if (!hook) return {};
2748
- const { handler, meta } = normalizeHook(hook);
2749
- return {
2750
- plugin: async (ctx, bundle, opts) => {
2751
- const changed = {
2752
- updated: /* @__PURE__ */ new Set(),
2753
- deleted: /* @__PURE__ */ new Set()
2754
- };
2755
- const context = new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
2756
- const output = transformToOutputBundle(context, unwrapBindingResult(bundle), changed);
2757
- await handler.call(context, args.pluginContextData.getOutputOptions(opts), output);
2758
- return collectChangedBundle(changed, output);
2759
- },
2760
- meta: bindingifyPluginHookMeta(meta)
2761
- };
2840
+ return bindingifyHook(args.plugin.writeBundle, ({ handler }) => ({ plugin: async (ctx, bundle, opts) => {
2841
+ const { changed, context, output } = createOutputBundle(args, ctx, bundle);
2842
+ await handler.call(context, args.pluginContextData.getOutputOptions(opts), output);
2843
+ return collectChangedBundle(changed, output);
2844
+ } }));
2762
2845
  }
2763
2846
  function bindingifyCloseBundle(args) {
2764
- const hook = args.plugin.closeBundle;
2765
- if (!hook) return {};
2766
- const { handler, meta } = normalizeHook(hook);
2767
- return {
2768
- plugin: async (ctx, err) => {
2769
- await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
2770
- },
2771
- meta: bindingifyPluginHookMeta(meta)
2772
- };
2773
- }
2774
- function bindingifyBanner(args) {
2775
- const hook = args.plugin.banner;
2776
- if (!hook) return {};
2777
- const { handler, meta } = normalizeHook(hook);
2778
- return {
2779
- plugin: async (ctx, chunk) => {
2780
- if (typeof handler === "string") return handler;
2781
- return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
2782
- },
2783
- meta: bindingifyPluginHookMeta(meta)
2784
- };
2785
- }
2786
- function bindingifyFooter(args) {
2787
- const hook = args.plugin.footer;
2788
- if (!hook) return {};
2789
- const { handler, meta } = normalizeHook(hook);
2790
- return {
2791
- plugin: async (ctx, chunk) => {
2792
- if (typeof handler === "string") return handler;
2793
- return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
2794
- },
2795
- meta: bindingifyPluginHookMeta(meta)
2796
- };
2797
- }
2798
- function bindingifyIntro(args) {
2799
- const hook = args.plugin.intro;
2800
- if (!hook) return {};
2801
- const { handler, meta } = normalizeHook(hook);
2802
- return {
2803
- plugin: async (ctx, chunk) => {
2804
- if (typeof handler === "string") return handler;
2805
- return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
2806
- },
2807
- meta: bindingifyPluginHookMeta(meta)
2808
- };
2809
- }
2810
- function bindingifyOutro(args) {
2811
- const hook = args.plugin.outro;
2812
- if (!hook) return {};
2813
- const { handler, meta } = normalizeHook(hook);
2814
- return {
2815
- plugin: async (ctx, chunk) => {
2816
- if (typeof handler === "string") return handler;
2817
- return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
2818
- },
2819
- meta: bindingifyPluginHookMeta(meta)
2820
- };
2847
+ return bindingifyHook(args.plugin.closeBundle, ({ handler }) => ({ plugin: async (ctx, err) => {
2848
+ await handler.call(createPluginContext(args, ctx), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
2849
+ } }));
2850
+ }
2851
+ function bindingifyAddonHook(args, name) {
2852
+ return bindingifyHook(args.plugin[name], ({ handler }) => ({ plugin: async (ctx, chunk) => {
2853
+ if (typeof handler === "string") return handler;
2854
+ return handler.call(createPluginContext(args, ctx), transformRenderedChunk(chunk));
2855
+ } }));
2856
+ }
2857
+ function bindingifyHotUpdate(args) {
2858
+ return bindingifyHook(args.plugin.hotUpdate, ({ handler }) => ({ plugin: async (ctx, hookArgs) => {
2859
+ return await handler.call(createPluginContext(args, ctx), {
2860
+ type: hookArgs.kind,
2861
+ file: hookArgs.file,
2862
+ modules: hookArgs.modules
2863
+ }) ?? void 0;
2864
+ } }));
2821
2865
  }
2822
2866
  function bindingifyWatchChange(args) {
2823
- const hook = args.plugin.watchChange;
2824
- if (!hook) return {};
2825
- const { handler, meta } = normalizeHook(hook);
2826
- return {
2827
- plugin: async (ctx, id, event) => {
2828
- await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), id, { event });
2829
- },
2830
- meta: bindingifyPluginHookMeta(meta)
2831
- };
2867
+ return bindingifyHook(args.plugin.watchChange, ({ handler }) => ({ plugin: async (ctx, id, event) => {
2868
+ await handler.call(createPluginContext(args, ctx), id, { event });
2869
+ } }));
2832
2870
  }
2833
2871
  function bindingifyCloseWatcher(args) {
2834
- const hook = args.plugin.closeWatcher;
2835
- if (!hook) return {};
2836
- const { handler, meta } = normalizeHook(hook);
2837
- return {
2838
- plugin: async (ctx) => {
2839
- await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
2840
- },
2841
- meta: bindingifyPluginHookMeta(meta)
2842
- };
2872
+ return bindingifyHook(args.plugin.closeWatcher, ({ handler }) => ({ plugin: async (ctx) => {
2873
+ await handler.call(createPluginContext(args, ctx));
2874
+ } }));
2843
2875
  }
2844
2876
  var HookUsage = class {
2845
2877
  bitflag = BigInt(0);
@@ -2873,6 +2905,8 @@ function extractHookUsage(plugin) {
2873
2905
  if (plugin.footer) hookUsage.union(262144);
2874
2906
  if (plugin.intro) hookUsage.union(524288);
2875
2907
  if (plugin.outro) hookUsage.union(1048576);
2908
+ if (plugin.resolveFileUrl) hookUsage.union(2097152);
2909
+ if (plugin.hotUpdate) hookUsage.union(4194304);
2876
2910
  return hookUsage;
2877
2911
  }
2878
2912
  function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
@@ -2895,16 +2929,18 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
2895
2929
  const { plugin: load, meta: loadMeta, filter: loadFilter } = bindingifyLoad(args);
2896
2930
  const { plugin: renderChunk, meta: renderChunkMeta, filter: renderChunkFilter } = bindingifyRenderChunk(args);
2897
2931
  const { plugin: augmentChunkHash, meta: augmentChunkHashMeta } = bindingifyAugmentChunkHash(args);
2932
+ const { plugin: resolveFileUrl, meta: resolveFileUrlMeta } = bindingifyResolveFileUrl(args);
2898
2933
  const { plugin: renderStart, meta: renderStartMeta } = bindingifyRenderStart(args);
2899
2934
  const { plugin: renderError, meta: renderErrorMeta } = bindingifyRenderError(args);
2900
2935
  const { plugin: generateBundle, meta: generateBundleMeta } = bindingifyGenerateBundle(args);
2901
2936
  const { plugin: writeBundle, meta: writeBundleMeta } = bindingifyWriteBundle(args);
2902
2937
  const { plugin: closeBundle, meta: closeBundleMeta } = bindingifyCloseBundle(args);
2903
- const { plugin: banner, meta: bannerMeta } = bindingifyBanner(args);
2904
- const { plugin: footer, meta: footerMeta } = bindingifyFooter(args);
2905
- const { plugin: intro, meta: introMeta } = bindingifyIntro(args);
2906
- const { plugin: outro, meta: outroMeta } = bindingifyOutro(args);
2938
+ const { plugin: banner, meta: bannerMeta } = bindingifyAddonHook(args, "banner");
2939
+ const { plugin: footer, meta: footerMeta } = bindingifyAddonHook(args, "footer");
2940
+ const { plugin: intro, meta: introMeta } = bindingifyAddonHook(args, "intro");
2941
+ const { plugin: outro, meta: outroMeta } = bindingifyAddonHook(args, "outro");
2907
2942
  const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(args);
2943
+ const { plugin: hotUpdate, meta: hotUpdateMeta } = bindingifyHotUpdate(args);
2908
2944
  const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
2909
2945
  let hookUsage = extractHookUsage(plugin).inner();
2910
2946
  return wrapHandlers({
@@ -2931,6 +2967,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
2931
2967
  renderChunkFilter,
2932
2968
  augmentChunkHash,
2933
2969
  augmentChunkHashMeta,
2970
+ resolveFileUrl,
2971
+ resolveFileUrlMeta,
2934
2972
  renderStart,
2935
2973
  renderStartMeta,
2936
2974
  renderError,
@@ -2951,6 +2989,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
2951
2989
  outroMeta,
2952
2990
  watchChange,
2953
2991
  watchChangeMeta,
2992
+ hotUpdate,
2993
+ hotUpdateMeta,
2954
2994
  closeWatcher,
2955
2995
  closeWatcherMeta,
2956
2996
  hookUsage
@@ -2967,6 +3007,7 @@ function wrapHandlers(plugin) {
2967
3007
  "load",
2968
3008
  "renderChunk",
2969
3009
  "augmentChunkHash",
3010
+ "resolveFileUrl",
2970
3011
  "renderStart",
2971
3012
  "renderError",
2972
3013
  "generateBundle",
@@ -2977,6 +3018,7 @@ function wrapHandlers(plugin) {
2977
3018
  "intro",
2978
3019
  "outro",
2979
3020
  "watchChange",
3021
+ "hotUpdate",
2980
3022
  "closeWatcher"
2981
3023
  ]) {
2982
3024
  const handler = plugin[hookName];
@@ -3018,9 +3060,15 @@ function normalizeTransformOptions(inputOptions) {
3018
3060
  oxcTransformOptions
3019
3061
  };
3020
3062
  }
3063
+ function getDefaultDevRuntime(host = "localhost", port = 3e3) {
3064
+ const runtimeEntry = node_fs.default.readFileSync((0, node_url.fileURLToPath)({}.resolve("rolldown/experimental/runtime")), "utf8");
3065
+ const runtimeHelperImportEnd = runtimeEntry.indexOf("\n");
3066
+ if (!runtimeEntry.startsWith("import ") || runtimeHelperImportEnd === -1) throw new Error("Expected the standalone runtime to start with a helper import");
3067
+ return `${runtimeEntry.slice(runtimeHelperImportEnd + 1)}\n${node_fs.default.readFileSync((0, node_url.fileURLToPath)({}.resolve("#default-runtime")), "utf8").replaceAll("$ADDR", `${host}:${port}`)}`;
3068
+ }
3021
3069
  function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
3022
3070
  const plugins = rawPlugins.map((plugin) => {
3023
- if ("_parallel" in plugin) return;
3071
+ if (getParallelPluginInfo(plugin)) return;
3024
3072
  if (plugin instanceof BuiltinPlugin) switch (plugin.name) {
3025
3073
  case "builtin:vite-manifest": return bindingifyManifestPlugin(plugin, pluginContextData);
3026
3074
  default: return bindingifyBuiltInPlugin(plugin);
@@ -3070,16 +3118,24 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginC
3070
3118
  }
3071
3119
  function bindingifyDevMode(devMode) {
3072
3120
  if (devMode) {
3073
- if (typeof devMode === "boolean") return devMode ? {} : void 0;
3074
- return devMode;
3121
+ if (typeof devMode === "boolean") return devMode ? {
3122
+ implement: getDefaultDevRuntime(),
3123
+ skipCommonRuntimeInjection: true
3124
+ } : void 0;
3125
+ const usesDefaultRuntime = devMode.implement == null;
3126
+ return {
3127
+ ...devMode,
3128
+ implement: devMode.implement ?? getDefaultDevRuntime(devMode.host, devMode.port),
3129
+ skipCommonRuntimeInjection: usesDefaultRuntime ? true : devMode.skipCommonRuntimeInjection
3130
+ };
3075
3131
  }
3076
3132
  }
3077
3133
  function bindingifyAttachDebugInfo(attachDebugInfo) {
3078
3134
  switch (attachDebugInfo) {
3079
3135
  case void 0: return;
3080
- case "full": return import_binding$3.BindingAttachDebugInfo.Full;
3081
- case "simple": return import_binding$3.BindingAttachDebugInfo.Simple;
3082
- case "none": return import_binding$3.BindingAttachDebugInfo.None;
3136
+ case "full": return import_binding$4.BindingAttachDebugInfo.Full;
3137
+ case "simple": return import_binding$4.BindingAttachDebugInfo.Simple;
3138
+ case "none": return import_binding$4.BindingAttachDebugInfo.None;
3083
3139
  }
3084
3140
  }
3085
3141
  function bindingifyExternal(external) {
@@ -3092,13 +3148,13 @@ function bindingifyExternal(external) {
3092
3148
  }
3093
3149
  }
3094
3150
  function bindingifyExperimental(experimental) {
3095
- let chunkModulesOrder = import_binding$3.BindingChunkModuleOrderBy.ExecOrder;
3151
+ let chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ExecOrder;
3096
3152
  if (experimental?.chunkModulesOrder) switch (experimental.chunkModulesOrder) {
3097
3153
  case "exec-order":
3098
- chunkModulesOrder = import_binding$3.BindingChunkModuleOrderBy.ExecOrder;
3154
+ chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ExecOrder;
3099
3155
  break;
3100
3156
  case "module-id":
3101
- chunkModulesOrder = import_binding$3.BindingChunkModuleOrderBy.ModuleId;
3157
+ chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ModuleId;
3102
3158
  break;
3103
3159
  default: throw new Error(`Unexpected chunkModulesOrder: ${experimental.chunkModulesOrder}`);
3104
3160
  }
@@ -3158,10 +3214,10 @@ function bindingifyInject(inject) {
3158
3214
  }
3159
3215
  function bindingifyLogLevel(logLevel) {
3160
3216
  switch (logLevel) {
3161
- case "silent": return import_binding$3.BindingLogLevel.Silent;
3162
- case "debug": return import_binding$3.BindingLogLevel.Debug;
3163
- case "warn": return import_binding$3.BindingLogLevel.Warn;
3164
- case "info": return import_binding$3.BindingLogLevel.Info;
3217
+ case "silent": return import_binding$4.BindingLogLevel.Silent;
3218
+ case "debug": return import_binding$4.BindingLogLevel.Debug;
3219
+ case "warn": return import_binding$4.BindingLogLevel.Warn;
3220
+ case "info": return import_binding$4.BindingLogLevel.Info;
3165
3221
  default: throw new Error(`Unexpected log level: ${logLevel}`);
3166
3222
  }
3167
3223
  }
@@ -3211,21 +3267,15 @@ function bindingifyTreeshakeOptions(config) {
3211
3267
  };
3212
3268
  switch (config.propertyReadSideEffects) {
3213
3269
  case "always":
3214
- normalizedConfig.propertyReadSideEffects = import_binding$3.BindingPropertyReadSideEffects.Always;
3215
- break;
3216
- case false:
3217
- normalizedConfig.propertyReadSideEffects = import_binding$3.BindingPropertyReadSideEffects.False;
3270
+ normalizedConfig.propertyReadSideEffects = import_binding$4.BindingPropertyReadSideEffects.Always;
3218
3271
  break;
3219
- default:
3272
+ case false: normalizedConfig.propertyReadSideEffects = import_binding$4.BindingPropertyReadSideEffects.False;
3220
3273
  }
3221
3274
  switch (config.propertyWriteSideEffects) {
3222
3275
  case "always":
3223
- normalizedConfig.propertyWriteSideEffects = import_binding$3.BindingPropertyWriteSideEffects.Always;
3276
+ normalizedConfig.propertyWriteSideEffects = import_binding$4.BindingPropertyWriteSideEffects.Always;
3224
3277
  break;
3225
- case false:
3226
- normalizedConfig.propertyWriteSideEffects = import_binding$3.BindingPropertyWriteSideEffects.False;
3227
- break;
3228
- default:
3278
+ case false: normalizedConfig.propertyWriteSideEffects = import_binding$4.BindingPropertyWriteSideEffects.False;
3229
3279
  }
3230
3280
  if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
3231
3281
  else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
@@ -3257,8 +3307,7 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
3257
3307
  };
3258
3308
  }
3259
3309
  //#endregion
3260
- //#region ../../node_modules/rolldown/dist/shared/rolldown-build-DR0wzp0V.mjs
3261
- var import_binding$2 = /* @__PURE__ */ __toESM(require_binding(), 1);
3310
+ //#region ../../node_modules/rolldown/dist/shared/create-bundler-option-4QtiLLuz.mjs
3262
3311
  function getLogger(plugins, onLog, logLevel, watchMode) {
3263
3312
  const minimalPriority = logLevelPriority[logLevel];
3264
3313
  const logger = (level, log, skipped = /* @__PURE__ */ new Set()) => {
@@ -3277,7 +3326,7 @@ function getLogger(plugins, onLog, logLevel, watchMode) {
3277
3326
  info: getLogHandler("info"),
3278
3327
  meta: {
3279
3328
  rollupVersion: "4.23.0",
3280
- rolldownVersion: "1.1.3",
3329
+ rolldownVersion: "1.2.1",
3281
3330
  watchMode
3282
3331
  },
3283
3332
  warn: getLogHandler("warn"),
@@ -3351,7 +3400,8 @@ var ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES = [
3351
3400
  "renderStart",
3352
3401
  "renderError",
3353
3402
  "writeBundle",
3354
- "generateBundle"
3403
+ "generateBundle",
3404
+ "resolveFileUrl"
3355
3405
  ];
3356
3406
  var ENUMERATED_PLUGIN_HOOK_NAMES = [
3357
3407
  ...ENUMERATED_INPUT_PLUGIN_HOOK_NAMES,
@@ -3361,7 +3411,13 @@ var ENUMERATED_PLUGIN_HOOK_NAMES = [
3361
3411
  "intro",
3362
3412
  "outro"
3363
3413
  ];
3364
- ENUMERATED_PLUGIN_HOOK_NAMES[0], ENUMERATED_PLUGIN_HOOK_NAMES[0], ENUMERATED_PLUGIN_HOOK_NAMES[1], ENUMERATED_PLUGIN_HOOK_NAMES[1], ENUMERATED_PLUGIN_HOOK_NAMES[2], ENUMERATED_PLUGIN_HOOK_NAMES[2], ENUMERATED_PLUGIN_HOOK_NAMES[3], ENUMERATED_PLUGIN_HOOK_NAMES[3], ENUMERATED_PLUGIN_HOOK_NAMES[4], ENUMERATED_PLUGIN_HOOK_NAMES[4], ENUMERATED_PLUGIN_HOOK_NAMES[5], ENUMERATED_PLUGIN_HOOK_NAMES[5], ENUMERATED_PLUGIN_HOOK_NAMES[6], ENUMERATED_PLUGIN_HOOK_NAMES[6], ENUMERATED_PLUGIN_HOOK_NAMES[7], ENUMERATED_PLUGIN_HOOK_NAMES[7], ENUMERATED_PLUGIN_HOOK_NAMES[8], ENUMERATED_PLUGIN_HOOK_NAMES[8], ENUMERATED_PLUGIN_HOOK_NAMES[9], ENUMERATED_PLUGIN_HOOK_NAMES[9], ENUMERATED_PLUGIN_HOOK_NAMES[10], ENUMERATED_PLUGIN_HOOK_NAMES[10], ENUMERATED_PLUGIN_HOOK_NAMES[11], ENUMERATED_PLUGIN_HOOK_NAMES[11], ENUMERATED_PLUGIN_HOOK_NAMES[12], ENUMERATED_PLUGIN_HOOK_NAMES[12], ENUMERATED_PLUGIN_HOOK_NAMES[13], ENUMERATED_PLUGIN_HOOK_NAMES[13], ENUMERATED_PLUGIN_HOOK_NAMES[14], ENUMERATED_PLUGIN_HOOK_NAMES[14], ENUMERATED_PLUGIN_HOOK_NAMES[15], ENUMERATED_PLUGIN_HOOK_NAMES[15], ENUMERATED_PLUGIN_HOOK_NAMES[16], ENUMERATED_PLUGIN_HOOK_NAMES[16], ENUMERATED_PLUGIN_HOOK_NAMES[17], ENUMERATED_PLUGIN_HOOK_NAMES[17], ENUMERATED_PLUGIN_HOOK_NAMES[18], ENUMERATED_PLUGIN_HOOK_NAMES[18], ENUMERATED_PLUGIN_HOOK_NAMES[19], ENUMERATED_PLUGIN_HOOK_NAMES[19], ENUMERATED_PLUGIN_HOOK_NAMES[20], ENUMERATED_PLUGIN_HOOK_NAMES[20], ENUMERATED_PLUGIN_HOOK_NAMES[21], ENUMERATED_PLUGIN_HOOK_NAMES[21], ENUMERATED_PLUGIN_HOOK_NAMES[22], ENUMERATED_PLUGIN_HOOK_NAMES[22];
3414
+ ENUMERATED_PLUGIN_HOOK_NAMES[0], ENUMERATED_PLUGIN_HOOK_NAMES[0], ENUMERATED_PLUGIN_HOOK_NAMES[1], ENUMERATED_PLUGIN_HOOK_NAMES[1], ENUMERATED_PLUGIN_HOOK_NAMES[2], ENUMERATED_PLUGIN_HOOK_NAMES[2], ENUMERATED_PLUGIN_HOOK_NAMES[3], ENUMERATED_PLUGIN_HOOK_NAMES[3], ENUMERATED_PLUGIN_HOOK_NAMES[4], ENUMERATED_PLUGIN_HOOK_NAMES[4], ENUMERATED_PLUGIN_HOOK_NAMES[5], ENUMERATED_PLUGIN_HOOK_NAMES[5], ENUMERATED_PLUGIN_HOOK_NAMES[6], ENUMERATED_PLUGIN_HOOK_NAMES[6], ENUMERATED_PLUGIN_HOOK_NAMES[7], ENUMERATED_PLUGIN_HOOK_NAMES[7], ENUMERATED_PLUGIN_HOOK_NAMES[8], ENUMERATED_PLUGIN_HOOK_NAMES[8], ENUMERATED_PLUGIN_HOOK_NAMES[9], ENUMERATED_PLUGIN_HOOK_NAMES[9], ENUMERATED_PLUGIN_HOOK_NAMES[10], ENUMERATED_PLUGIN_HOOK_NAMES[10], ENUMERATED_PLUGIN_HOOK_NAMES[11], ENUMERATED_PLUGIN_HOOK_NAMES[11], ENUMERATED_PLUGIN_HOOK_NAMES[12], ENUMERATED_PLUGIN_HOOK_NAMES[12], ENUMERATED_PLUGIN_HOOK_NAMES[13], ENUMERATED_PLUGIN_HOOK_NAMES[13], ENUMERATED_PLUGIN_HOOK_NAMES[14], ENUMERATED_PLUGIN_HOOK_NAMES[14], ENUMERATED_PLUGIN_HOOK_NAMES[15], ENUMERATED_PLUGIN_HOOK_NAMES[15], ENUMERATED_PLUGIN_HOOK_NAMES[16], ENUMERATED_PLUGIN_HOOK_NAMES[16], ENUMERATED_PLUGIN_HOOK_NAMES[17], ENUMERATED_PLUGIN_HOOK_NAMES[17], ENUMERATED_PLUGIN_HOOK_NAMES[18], ENUMERATED_PLUGIN_HOOK_NAMES[18], ENUMERATED_PLUGIN_HOOK_NAMES[19], ENUMERATED_PLUGIN_HOOK_NAMES[19], ENUMERATED_PLUGIN_HOOK_NAMES[20], ENUMERATED_PLUGIN_HOOK_NAMES[20], ENUMERATED_PLUGIN_HOOK_NAMES[21], ENUMERATED_PLUGIN_HOOK_NAMES[21], ENUMERATED_PLUGIN_HOOK_NAMES[22], ENUMERATED_PLUGIN_HOOK_NAMES[22], ENUMERATED_PLUGIN_HOOK_NAMES[23], ENUMERATED_PLUGIN_HOOK_NAMES[23];
3415
+ /**
3416
+ * Names of the hidden hooks, alongside {@linkcode InternalFunctionPluginHooks}.
3417
+ * Kept separate from `ENUMERATED_INPUT_PLUGIN_HOOK_NAMES` so the names stay out
3418
+ * of the published `.d.ts` (that list's type is reachable from public types).
3419
+ */
3420
+ var INTERNAL_PLUGIN_HOOK_NAMES = ["hotUpdate"];
3365
3421
  async function asyncFlatten(array) {
3366
3422
  do
3367
3423
  array = (await Promise.all(array)).flat(Infinity);
@@ -3370,7 +3426,7 @@ async function asyncFlatten(array) {
3370
3426
  }
3371
3427
  var normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean);
3372
3428
  function checkOutputPluginOption(plugins, onLog) {
3373
- for (const plugin of plugins) for (const hook of ENUMERATED_INPUT_PLUGIN_HOOK_NAMES) if (hook in plugin) {
3429
+ for (const plugin of plugins) for (const hook of [...ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, ...INTERNAL_PLUGIN_HOOK_NAMES]) if (hook in plugin) {
3374
3430
  delete plugin[hook];
3375
3431
  onLog(LOG_LEVEL_WARN, logInputHookInOutputPlugin(plugin.name, hook));
3376
3432
  }
@@ -3378,9 +3434,10 @@ function checkOutputPluginOption(plugins, onLog) {
3378
3434
  }
3379
3435
  function normalizePlugins(plugins, anonymousPrefix) {
3380
3436
  for (const [index, plugin] of plugins.entries()) {
3381
- if ("_parallel" in plugin) continue;
3437
+ if (getParallelPluginInfo(plugin)) continue;
3382
3438
  if (plugin instanceof BuiltinPlugin) continue;
3383
- if (!plugin.name) plugin.name = `${anonymousPrefix}${index + 1}`;
3439
+ const objectPlugin = plugin;
3440
+ if (!objectPlugin.name) objectPlugin.name = `${anonymousPrefix}${index + 1}`;
3384
3441
  }
3385
3442
  return plugins;
3386
3443
  }
@@ -3419,7 +3476,7 @@ var PluginDriver = class {
3419
3476
  function getObjectPlugins(plugins) {
3420
3477
  return plugins.filter((plugin) => {
3421
3478
  if (!plugin) return;
3422
- if ("_parallel" in plugin) return;
3479
+ if (getParallelPluginInfo(plugin)) return;
3423
3480
  if (plugin instanceof BuiltinPlugin) return;
3424
3481
  return plugin;
3425
3482
  });
@@ -4692,6 +4749,7 @@ var MinifyOptionsSchema = /* @__PURE__ */ strictObject({
4692
4749
  function: /* @__PURE__ */ boolean(),
4693
4750
  class: /* @__PURE__ */ boolean()
4694
4751
  })])),
4752
+ reserved: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
4695
4753
  debug: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
4696
4754
  })])),
4697
4755
  codegen: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
@@ -4750,6 +4808,7 @@ var DevModeSchema = /* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE
4750
4808
  port: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
4751
4809
  host: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
4752
4810
  implement: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
4811
+ skipCommonRuntimeInjection: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
4753
4812
  lazy: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
4754
4813
  })]);
4755
4814
  var InputOptionsSchema = /* @__PURE__ */ strictObject({
@@ -4899,6 +4958,7 @@ var OutputOptionsSchema = /* @__PURE__ */ strictObject({
4899
4958
  /* @__PURE__ */ literal("hidden")
4900
4959
  ])), /* @__PURE__ */ description(`Generate sourcemap (\`-s inline\` for inline, or \`-s\` for \`.map\` file)`)),
4901
4960
  sourcemapBaseUrl: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Base URL used to prefix sourcemap paths")),
4961
+ sourcemapFileNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(ChunkFileNamesSchema), /* @__PURE__ */ description("Name pattern for emitted sourcemaps")),
4902
4962
  sourcemapDebugIds: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Inject sourcemap debug IDs")),
4903
4963
  sourcemapExcludeSources: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Exclude source content from sourcemaps")),
4904
4964
  sourcemapIgnoreList: /* @__PURE__ */ optional(/* @__PURE__ */ union([
@@ -4950,7 +5010,7 @@ var OutputOptionsSchema = /* @__PURE__ */ strictObject({
4950
5010
  topLevelVar: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Rewrite top-level declarations to use `var`.")),
4951
5011
  cleanDir: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Clean output directory before emitting output")),
4952
5012
  keepNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Keep function and class names after bundling")),
4953
- strictExecutionOrder: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Lets modules be executed in the order they are declared.")),
5013
+ strictExecutionOrder: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Preserve source module execution order across generated chunks.")),
4954
5014
  strict: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("auto")])), /* @__PURE__ */ description("Whether to always output `\"use strict\"` directive in non-ES module outputs."))
4955
5015
  });
4956
5016
  var getAddonDescription = (placement, wrapper) => {
@@ -4972,7 +5032,7 @@ var OutputCliOverrideSchema = /* @__PURE__ */ strictObject({
4972
5032
  codeSplitting: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
4973
5033
  minSize: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum size of the chunk")),
4974
5034
  minShareCount: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum share count of the chunk"))
4975
- })])), /* @__PURE__ */ description("Code splitting options (true, false, or object)")),
5035
+ })])), /* @__PURE__ */ description("Code splitting options. Enabled by default; use `--no-codeSplitting` to disable, or `--codeSplitting.minSize` / `--codeSplitting.minShareCount` to configure")),
4976
5036
  advancedChunks: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
4977
5037
  minSize: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum size of the chunk")),
4978
5038
  minShareCount: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum share count of the chunk"))
@@ -5020,28 +5080,6 @@ function validateOption(key, options) {
5020
5080
  if (errors.length) console.warn(`\x1b[33mWarning: Invalid ${key} options (${errors.length} issue${errors.length === 1 ? "" : "s"} found)\n${errors.join("\n")}\x1b[0m`);
5021
5081
  }
5022
5082
  }
5023
- var RolldownOutputImpl = class extends PlainObjectLike {
5024
- bindingOutputs;
5025
- constructor(bindingOutputs) {
5026
- super();
5027
- this.bindingOutputs = bindingOutputs;
5028
- }
5029
- get output() {
5030
- return transformToRollupOutput(this.bindingOutputs).output;
5031
- }
5032
- __rolldown_external_memory_handle__(keepDataAlive) {
5033
- const results = this.output.map((item) => item.__rolldown_external_memory_handle__(keepDataAlive));
5034
- if (!results.every((r) => r.freed)) {
5035
- const reasons = results.filter((r) => !r.freed).map((r) => r.reason).filter(Boolean);
5036
- return {
5037
- freed: false,
5038
- reason: `Failed to free ${reasons.length} item(s): ${reasons.join("; ")}`
5039
- };
5040
- }
5041
- return { freed: true };
5042
- }
5043
- };
5044
- __decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
5045
5083
  var ChunkingContextImpl = class {
5046
5084
  context;
5047
5085
  pluginContextData;
@@ -5464,10 +5502,11 @@ ${indent}`);
5464
5502
  return causedPrefix + message + "\n" + stack + causedError;
5465
5503
  }
5466
5504
  formatArgs(args, opts) {
5467
- return (0, node_util.formatWithOptions)(opts, ...args.map((arg) => {
5505
+ const _args = args.map((arg) => {
5468
5506
  if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
5469
5507
  return arg;
5470
- }));
5508
+ });
5509
+ return (0, node_util.formatWithOptions)(opts, ..._args);
5471
5510
  }
5472
5511
  formatDate(date, opts) {
5473
5512
  return opts.date ? date.toLocaleTimeString() : "";
@@ -5681,13 +5720,15 @@ function box(text, _opts = {}) {
5681
5720
  if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
5682
5721
  return boxLines.join("\n");
5683
5722
  }
5684
- var r = Object.create(null), i = (e) => globalThis.process?.env || {
5723
+ var r = Object.create(null);
5724
+ var i = (e) => globalThis.process?.env || {
5685
5725
  "BASE_URL": "/",
5686
5726
  "DEV": false,
5687
5727
  "MODE": "production",
5688
5728
  "PROD": true,
5689
5729
  "SSR": false
5690
- }, o = new Proxy(r, {
5730
+ };
5731
+ var o = new Proxy(r, {
5691
5732
  get(e, s) {
5692
5733
  return i()[s] ?? r[s];
5693
5734
  },
@@ -5707,7 +5748,9 @@ var r = Object.create(null), i = (e) => globalThis.process?.env || {
5707
5748
  const e = i(true);
5708
5749
  return Object.keys(e);
5709
5750
  }
5710
- }), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
5751
+ });
5752
+ var t = typeof process < "u" && process.env && process.env.NODE_ENV || "";
5753
+ var f = [
5711
5754
  ["APPVEYOR"],
5712
5755
  [
5713
5756
  "AWS_AMPLIFY",
@@ -5819,19 +5862,31 @@ l.name;
5819
5862
  function n(e) {
5820
5863
  return e ? e !== "false" : false;
5821
5864
  }
5822
- var I = globalThis.process?.platform || "", T = n(o.CI) || l.ci !== false, a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY), g = n(o.DEBUG), R = t === "test" || n(o.TEST);
5865
+ var I = globalThis.process?.platform || "";
5866
+ var T = n(o.CI) || l.ci !== false;
5867
+ var a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY);
5868
+ var g = n(o.DEBUG);
5869
+ var R = t === "test" || n(o.TEST);
5823
5870
  o.MINIMAL;
5824
5871
  var A = /^win/i.test(I);
5825
5872
  !n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM);
5826
5873
  var C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
5827
5874
  Number(C?.split(".")[0]);
5828
- var y = globalThis.process || Object.create(null), _ = { versions: {} };
5875
+ var y = globalThis.process || Object.create(null);
5876
+ var _ = { versions: {} };
5829
5877
  new Proxy(y, { get(e, s) {
5830
5878
  if (s === "env") return o;
5831
5879
  if (s in e) return e[s];
5832
5880
  if (s in _) return _[s];
5833
5881
  } });
5834
- var c = globalThis.process?.release?.name === "node", O = !!globalThis.Bun || !!globalThis.process?.versions?.bun, D = !!globalThis.Deno, L = !!globalThis.fastly, S = !!globalThis.Netlify, u = !!globalThis.EdgeRuntime, N = globalThis.navigator?.userAgent === "Cloudflare-Workers", F = [
5882
+ var c = globalThis.process?.release?.name === "node";
5883
+ var O = !!globalThis.Bun || !!globalThis.process?.versions?.bun;
5884
+ var D = !!globalThis.Deno;
5885
+ var L = !!globalThis.fastly;
5886
+ var S = !!globalThis.Netlify;
5887
+ var u = !!globalThis.EdgeRuntime;
5888
+ var N = globalThis.navigator?.userAgent === "Cloudflare-Workers";
5889
+ var F = [
5835
5890
  [S, "netlify"],
5836
5891
  [u, "edge-light"],
5837
5892
  [N, "workerd"],
@@ -5989,7 +6044,7 @@ function createConsola(options = {}) {
5989
6044
  defaults: { level },
5990
6045
  stdout: process.stdout,
5991
6046
  stderr: process.stderr,
5992
- prompt: (...args) => Promise.resolve().then(() => require("./prompt-B1Yc1NPt.cjs")).then((m) => m.prompt(...args)),
6047
+ prompt: (...args) => Promise.resolve().then(() => require("./prompt-CH6TK0bC.cjs")).then((m) => m.prompt(...args)),
5993
6048
  reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
5994
6049
  ...options
5995
6050
  });
@@ -6026,7 +6081,7 @@ function createTestingLogger() {
6026
6081
  return ret;
6027
6082
  }
6028
6083
  function bindingifyOutputOptions(outputOptions, pluginContextData) {
6029
- const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapExcludeSources, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, banner, footer, postBanner, postFooter, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, comments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir, strictExecutionOrder } = outputOptions;
6084
+ const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapFileNames, sourcemapExcludeSources, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, banner, footer, postBanner, postFooter, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, comments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir, strictExecutionOrder } = outputOptions;
6030
6085
  if (legalComments != null) logger.warn("`legalComments` option is deprecated, please use `comments.legal` instead.");
6031
6086
  const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks, pluginContextData);
6032
6087
  return {
@@ -6038,6 +6093,7 @@ function bindingifyOutputOptions(outputOptions, pluginContextData) {
6038
6093
  sourcemap: bindingifySourcemap(sourcemap),
6039
6094
  sourcemapBaseUrl,
6040
6095
  sourcemapDebugIds,
6096
+ sourcemapFileNames,
6041
6097
  sourcemapExcludeSources,
6042
6098
  sourcemapIgnoreList: sourcemapIgnoreList ?? /node_modules/,
6043
6099
  sourcemapPathTransform,
@@ -6178,19 +6234,23 @@ function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, adva
6178
6234
  advancedChunks: advancedChunksResult
6179
6235
  };
6180
6236
  }
6237
+ var import_binding$3 = /* @__PURE__ */ __toESM(require_binding(), 1);
6181
6238
  async function initializeParallelPlugins(plugins) {
6182
6239
  const pluginInfos = [];
6183
- for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
6184
- const { fileUrl, options } = plugin._parallel;
6185
- pluginInfos.push({
6186
- index,
6187
- fileUrl,
6188
- options
6189
- });
6240
+ for (const [index, plugin] of plugins.entries()) {
6241
+ const parallel = getParallelPluginInfo(plugin);
6242
+ if (parallel) {
6243
+ const { fileUrl, options } = parallel;
6244
+ pluginInfos.push({
6245
+ index,
6246
+ fileUrl,
6247
+ options
6248
+ });
6249
+ }
6190
6250
  }
6191
6251
  if (pluginInfos.length <= 0) return;
6192
6252
  const count = availableParallelism();
6193
- const parallelJsPluginRegistry = new import_binding$2.ParallelJsPluginRegistry(count);
6253
+ const parallelJsPluginRegistry = new import_binding$3.ParallelJsPluginRegistry(count);
6194
6254
  const registryId = parallelJsPluginRegistry.id;
6195
6255
  const workers = await initializeWorkers(registryId, count, pluginInfos);
6196
6256
  const stopWorkers = async () => {
@@ -6266,113 +6326,8 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
6266
6326
  throw e;
6267
6327
  }
6268
6328
  }
6269
- Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
6270
- /**
6271
- * The bundle object returned by {@linkcode rolldown} function.
6272
- *
6273
- * @category Programmatic APIs
6274
- */
6275
- var RolldownBuild = class RolldownBuild {
6276
- #inputOptions;
6277
- #bundler;
6278
- #stopWorkers;
6279
- /** @internal */
6280
- static asyncRuntimeShutdown = false;
6281
- /** @hidden should not be used directly */
6282
- constructor(inputOptions) {
6283
- this.#inputOptions = inputOptions;
6284
- this.#bundler = new import_binding$2.BindingBundler();
6285
- }
6286
- /**
6287
- * Whether the bundle has been closed.
6288
- *
6289
- * If the bundle is closed, calling other methods will throw an error.
6290
- */
6291
- get closed() {
6292
- return this.#bundler.closed;
6293
- }
6294
- /**
6295
- * Generate bundles in-memory.
6296
- *
6297
- * If you directly want to write bundles to disk, use the {@linkcode write} method instead.
6298
- *
6299
- * @param outputOptions The output options.
6300
- * @returns The generated bundle.
6301
- * @throws {@linkcode BundleError} When an error occurs during the build.
6302
- */
6303
- async generate(outputOptions = {}) {
6304
- return this.#build(false, outputOptions);
6305
- }
6306
- /**
6307
- * Generate and write bundles to disk.
6308
- *
6309
- * If you want to generate bundles in-memory, use the {@linkcode generate} method instead.
6310
- *
6311
- * @param outputOptions The output options.
6312
- * @returns The generated bundle.
6313
- * @throws {@linkcode BundleError} When an error occurs during the build.
6314
- */
6315
- async write(outputOptions = {}) {
6316
- return this.#build(true, outputOptions);
6317
- }
6318
- /**
6319
- * Close the bundle and free resources.
6320
- *
6321
- * This method should be called even if the {@linkcode generate} method
6322
- * or the {@linkcode write} method threw an error. It should be called
6323
- * even if neither of the methods are called.
6324
- *
6325
- * This method is called automatically when using `using` syntax.
6326
- *
6327
- * @example
6328
- * ```js
6329
- * import { rolldown } from 'rolldown';
6330
- *
6331
- * {
6332
- * using bundle = await rolldown({ input: 'src/main.js' });
6333
- * const output = await bundle.generate({ format: 'esm' });
6334
- * console.log(output);
6335
- * // bundle.close() is called automatically here
6336
- * }
6337
- * ```
6338
- */
6339
- async close() {
6340
- await this.#stopWorkers?.();
6341
- await this.#bundler.close();
6342
- (0, import_binding$2.shutdownAsyncRuntime)();
6343
- RolldownBuild.asyncRuntimeShutdown = true;
6344
- this.#stopWorkers = void 0;
6345
- }
6346
- /** @hidden documented in close method */
6347
- async [Symbol.asyncDispose]() {
6348
- await this.close();
6349
- }
6350
- /**
6351
- * @experimental
6352
- * @hidden not ready for public usage yet
6353
- */
6354
- get watchFiles() {
6355
- return Promise.resolve(this.#bundler.getWatchFiles());
6356
- }
6357
- async #build(isWrite, outputOptions) {
6358
- validateOption("output", outputOptions);
6359
- await this.#stopWorkers?.();
6360
- const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
6361
- if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding$2.startAsyncRuntime)();
6362
- try {
6363
- this.#stopWorkers = option.stopWorkers;
6364
- let output;
6365
- if (isWrite) output = await this.#bundler.write(option.bundlerOptions);
6366
- else output = await this.#bundler.generate(option.bundlerOptions);
6367
- return new RolldownOutputImpl(unwrapBindingResult(output));
6368
- } catch (e) {
6369
- await option.stopWorkers?.();
6370
- throw e;
6371
- }
6372
- }
6373
- };
6374
6329
  //#endregion
6375
- //#region ../../node_modules/rolldown/dist/shared/watch-FrHSqg24.mjs
6330
+ //#region ../../node_modules/rolldown/dist/shared/watch-Cwq-cFUy.mjs
6376
6331
  /**
6377
6332
  * This is not the set of all possible signals.
6378
6333
  *
@@ -6579,7 +6534,138 @@ function onExit(...args) {
6579
6534
  }
6580
6535
  require_binding();
6581
6536
  //#endregion
6582
- //#region ../../node_modules/rolldown/dist/shared/rolldown-Brph2NSU.mjs
6537
+ //#region ../../node_modules/rolldown/dist/shared/rolldown-DP_p9pd3.mjs
6538
+ var import_binding$1 = /* @__PURE__ */ __toESM(require_binding(), 1);
6539
+ var RolldownOutputImpl = class extends PlainObjectLike {
6540
+ bindingOutputs;
6541
+ constructor(bindingOutputs) {
6542
+ super();
6543
+ this.bindingOutputs = bindingOutputs;
6544
+ }
6545
+ get output() {
6546
+ return transformToRollupOutput(this.bindingOutputs).output;
6547
+ }
6548
+ __rolldown_external_memory_handle__(keepDataAlive) {
6549
+ const results = this.output.map((item) => item.__rolldown_external_memory_handle__(keepDataAlive));
6550
+ if (!results.every((r) => r.freed)) {
6551
+ const reasons = results.filter((r) => !r.freed).map((r) => r.reason).filter(Boolean);
6552
+ return {
6553
+ freed: false,
6554
+ reason: `Failed to free ${reasons.length} item(s): ${reasons.join("; ")}`
6555
+ };
6556
+ }
6557
+ return { freed: true };
6558
+ }
6559
+ };
6560
+ __decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
6561
+ Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
6562
+ /**
6563
+ * The bundle object returned by {@linkcode rolldown} function.
6564
+ *
6565
+ * @category Programmatic APIs
6566
+ */
6567
+ var RolldownBuild = class {
6568
+ #inputOptions;
6569
+ #bundler;
6570
+ #stopWorkers;
6571
+ #asyncRuntimeReleased = false;
6572
+ /** @hidden should not be used directly */
6573
+ constructor(inputOptions) {
6574
+ this.#inputOptions = inputOptions;
6575
+ this.#bundler = new import_binding$1.BindingBundler();
6576
+ (0, import_binding$1.startAsyncRuntime)();
6577
+ }
6578
+ /**
6579
+ * Whether the bundle has been closed.
6580
+ *
6581
+ * If the bundle is closed, calling other methods will throw an error.
6582
+ */
6583
+ get closed() {
6584
+ return this.#bundler.closed;
6585
+ }
6586
+ /**
6587
+ * Generate bundles in-memory.
6588
+ *
6589
+ * If you directly want to write bundles to disk, use the {@linkcode write} method instead.
6590
+ *
6591
+ * @param outputOptions The output options.
6592
+ * @returns The generated bundle.
6593
+ * @throws {@linkcode BundleError} When an error occurs during the build.
6594
+ */
6595
+ async generate(outputOptions = {}) {
6596
+ return this.#build(false, outputOptions);
6597
+ }
6598
+ /**
6599
+ * Generate and write bundles to disk.
6600
+ *
6601
+ * If you want to generate bundles in-memory, use the {@linkcode generate} method instead.
6602
+ *
6603
+ * @param outputOptions The output options.
6604
+ * @returns The generated bundle.
6605
+ * @throws {@linkcode BundleError} When an error occurs during the build.
6606
+ */
6607
+ async write(outputOptions = {}) {
6608
+ return this.#build(true, outputOptions);
6609
+ }
6610
+ /**
6611
+ * Close the bundle and free resources.
6612
+ *
6613
+ * This method should be called even if the {@linkcode generate} method
6614
+ * or the {@linkcode write} method threw an error. It should be called
6615
+ * even if neither of the methods are called.
6616
+ *
6617
+ * This method is called automatically when using `using` syntax.
6618
+ *
6619
+ * @example
6620
+ * ```js
6621
+ * import { rolldown } from 'rolldown';
6622
+ *
6623
+ * {
6624
+ * using bundle = await rolldown({ input: 'src/main.js' });
6625
+ * const output = await bundle.generate({ format: 'esm' });
6626
+ * console.log(output);
6627
+ * // bundle.close() is called automatically here
6628
+ * }
6629
+ * ```
6630
+ */
6631
+ async close() {
6632
+ const shouldRelease = !this.#asyncRuntimeReleased;
6633
+ this.#asyncRuntimeReleased = true;
6634
+ try {
6635
+ await this.#stopWorkers?.();
6636
+ await this.#bundler.close();
6637
+ this.#stopWorkers = void 0;
6638
+ } finally {
6639
+ if (shouldRelease) (0, import_binding$1.shutdownAsyncRuntime)();
6640
+ }
6641
+ }
6642
+ /** @hidden documented in close method */
6643
+ async [Symbol.asyncDispose]() {
6644
+ await this.close();
6645
+ }
6646
+ /**
6647
+ * @experimental
6648
+ * @hidden not ready for public usage yet
6649
+ */
6650
+ get watchFiles() {
6651
+ return Promise.resolve(this.#bundler.getWatchFiles());
6652
+ }
6653
+ async #build(isWrite, outputOptions) {
6654
+ validateOption("output", outputOptions);
6655
+ await this.#stopWorkers?.();
6656
+ const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
6657
+ try {
6658
+ this.#stopWorkers = option.stopWorkers;
6659
+ let output;
6660
+ if (isWrite) output = await this.#bundler.write(option.bundlerOptions);
6661
+ else output = await this.#bundler.generate(option.bundlerOptions);
6662
+ return new RolldownOutputImpl(unwrapBindingResult(output));
6663
+ } catch (e) {
6664
+ await option.stopWorkers?.();
6665
+ throw e;
6666
+ }
6667
+ }
6668
+ };
6583
6669
  /**
6584
6670
  * The API compatible with Rollup's `rollup` function.
6585
6671
  *