@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.mjs 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
  *
@@ -33,7 +33,9 @@
33
33
  * @preserve
34
34
  * @license
35
35
  */
36
+ import fs from "node:fs";
36
37
  import path, { sep } from "node:path";
38
+ import { fileURLToPath } from "node:url";
37
39
  import { createRequire } from "node:module";
38
40
  import fsp from "node:fs/promises";
39
41
  import { Worker, isMainThread } from "node:worker_threads";
@@ -41,7 +43,7 @@ import { formatWithOptions, styleText } from "node:util";
41
43
  import g$1 from "node:process";
42
44
  import * as tty from "node:tty";
43
45
  import os from "node:os";
44
- //#region ../../node_modules/rolldown/dist/shared/binding-Dh6LYCIB.mjs
46
+ //#region ../../node_modules/rolldown/dist/shared/binding-Cv62mM1i.mjs
45
47
  var __create = Object.create;
46
48
  var __defProp = Object.defineProperty;
47
49
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -59,7 +61,7 @@ var __copyProps = (to, from, except, desc) => {
59
61
  }
60
62
  return to;
61
63
  };
62
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
64
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
63
65
  value: mod,
64
66
  enumerable: true
65
67
  }) : target, mod));
@@ -141,7 +143,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
141
143
  try {
142
144
  const binding = __require("@rolldown/binding-android-arm64");
143
145
  const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
144
- 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.`);
146
+ 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.`);
145
147
  return binding;
146
148
  } catch (e) {
147
149
  loadErrors.push(e);
@@ -155,7 +157,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
155
157
  try {
156
158
  const binding = __require("@rolldown/binding-android-arm-eabi");
157
159
  const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
158
- 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.`);
160
+ 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.`);
159
161
  return binding;
160
162
  } catch (e) {
161
163
  loadErrors.push(e);
@@ -170,7 +172,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
170
172
  try {
171
173
  const binding = __require("@rolldown/binding-win32-x64-gnu");
172
174
  const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
173
- 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.`);
175
+ 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.`);
174
176
  return binding;
175
177
  } catch (e) {
176
178
  loadErrors.push(e);
@@ -184,7 +186,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
184
186
  try {
185
187
  const binding = __require("@rolldown/binding-win32-x64-msvc");
186
188
  const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
187
- 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.`);
189
+ 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.`);
188
190
  return binding;
189
191
  } catch (e) {
190
192
  loadErrors.push(e);
@@ -199,7 +201,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
199
201
  try {
200
202
  const binding = __require("@rolldown/binding-win32-ia32-msvc");
201
203
  const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
202
- 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.`);
204
+ 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.`);
203
205
  return binding;
204
206
  } catch (e) {
205
207
  loadErrors.push(e);
@@ -213,7 +215,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
213
215
  try {
214
216
  const binding = __require("@rolldown/binding-win32-arm64-msvc");
215
217
  const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
216
- 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.`);
218
+ 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.`);
217
219
  return binding;
218
220
  } catch (e) {
219
221
  loadErrors.push(e);
@@ -228,7 +230,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
228
230
  try {
229
231
  const binding = __require("@rolldown/binding-darwin-universal");
230
232
  const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
231
- 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.`);
233
+ 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.`);
232
234
  return binding;
233
235
  } catch (e) {
234
236
  loadErrors.push(e);
@@ -242,7 +244,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
242
244
  try {
243
245
  const binding = __require("@rolldown/binding-darwin-x64");
244
246
  const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
245
- 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.`);
247
+ 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.`);
246
248
  return binding;
247
249
  } catch (e) {
248
250
  loadErrors.push(e);
@@ -256,7 +258,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
256
258
  try {
257
259
  const binding = __require("@rolldown/binding-darwin-arm64");
258
260
  const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
259
- 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.`);
261
+ 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.`);
260
262
  return binding;
261
263
  } catch (e) {
262
264
  loadErrors.push(e);
@@ -271,7 +273,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
271
273
  try {
272
274
  const binding = __require("@rolldown/binding-freebsd-x64");
273
275
  const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
274
- 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.`);
276
+ 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.`);
275
277
  return binding;
276
278
  } catch (e) {
277
279
  loadErrors.push(e);
@@ -285,7 +287,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
285
287
  try {
286
288
  const binding = __require("@rolldown/binding-freebsd-arm64");
287
289
  const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
288
- 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.`);
290
+ 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.`);
289
291
  return binding;
290
292
  } catch (e) {
291
293
  loadErrors.push(e);
@@ -300,7 +302,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
300
302
  try {
301
303
  const binding = __require("@rolldown/binding-linux-x64-musl");
302
304
  const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
303
- 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.`);
305
+ 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.`);
304
306
  return binding;
305
307
  } catch (e) {
306
308
  loadErrors.push(e);
@@ -314,7 +316,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
314
316
  try {
315
317
  const binding = __require("@rolldown/binding-linux-x64-gnu");
316
318
  const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
317
- 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.`);
319
+ 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.`);
318
320
  return binding;
319
321
  } catch (e) {
320
322
  loadErrors.push(e);
@@ -329,7 +331,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
329
331
  try {
330
332
  const binding = __require("@rolldown/binding-linux-arm64-musl");
331
333
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
332
- 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.`);
334
+ 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.`);
333
335
  return binding;
334
336
  } catch (e) {
335
337
  loadErrors.push(e);
@@ -343,7 +345,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
343
345
  try {
344
346
  const binding = __require("@rolldown/binding-linux-arm64-gnu");
345
347
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
346
- 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.`);
348
+ 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.`);
347
349
  return binding;
348
350
  } catch (e) {
349
351
  loadErrors.push(e);
@@ -358,7 +360,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
358
360
  try {
359
361
  const binding = __require("@rolldown/binding-linux-arm-musleabihf");
360
362
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
361
- 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.`);
363
+ 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.`);
362
364
  return binding;
363
365
  } catch (e) {
364
366
  loadErrors.push(e);
@@ -372,7 +374,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
372
374
  try {
373
375
  const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
374
376
  const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
375
- 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.`);
377
+ 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.`);
376
378
  return binding;
377
379
  } catch (e) {
378
380
  loadErrors.push(e);
@@ -387,7 +389,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
387
389
  try {
388
390
  const binding = __require("@rolldown/binding-linux-loong64-musl");
389
391
  const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
390
- 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.`);
392
+ 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.`);
391
393
  return binding;
392
394
  } catch (e) {
393
395
  loadErrors.push(e);
@@ -401,7 +403,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
401
403
  try {
402
404
  const binding = __require("@rolldown/binding-linux-loong64-gnu");
403
405
  const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
404
- 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.`);
406
+ 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.`);
405
407
  return binding;
406
408
  } catch (e) {
407
409
  loadErrors.push(e);
@@ -416,7 +418,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
416
418
  try {
417
419
  const binding = __require("@rolldown/binding-linux-riscv64-musl");
418
420
  const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
419
- 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.`);
421
+ 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.`);
420
422
  return binding;
421
423
  } catch (e) {
422
424
  loadErrors.push(e);
@@ -430,7 +432,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
430
432
  try {
431
433
  const binding = __require("@rolldown/binding-linux-riscv64-gnu");
432
434
  const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
433
- 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.`);
435
+ 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.`);
434
436
  return binding;
435
437
  } catch (e) {
436
438
  loadErrors.push(e);
@@ -445,7 +447,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
445
447
  try {
446
448
  const binding = __require("@rolldown/binding-linux-ppc64-gnu");
447
449
  const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
448
- 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.`);
450
+ 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.`);
449
451
  return binding;
450
452
  } catch (e) {
451
453
  loadErrors.push(e);
@@ -459,7 +461,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
459
461
  try {
460
462
  const binding = __require("@rolldown/binding-linux-s390x-gnu");
461
463
  const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
462
- 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.`);
464
+ 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.`);
463
465
  return binding;
464
466
  } catch (e) {
465
467
  loadErrors.push(e);
@@ -474,7 +476,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
474
476
  try {
475
477
  const binding = __require("@rolldown/binding-openharmony-arm64");
476
478
  const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
477
- 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.`);
479
+ 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.`);
478
480
  return binding;
479
481
  } catch (e) {
480
482
  loadErrors.push(e);
@@ -488,7 +490,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
488
490
  try {
489
491
  const binding = __require("@rolldown/binding-openharmony-x64");
490
492
  const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
491
- 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.`);
493
+ 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.`);
492
494
  return binding;
493
495
  } catch (e) {
494
496
  loadErrors.push(e);
@@ -502,7 +504,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
502
504
  try {
503
505
  const binding = __require("@rolldown/binding-openharmony-arm");
504
506
  const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
505
- 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.`);
507
+ 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.`);
506
508
  return binding;
507
509
  } catch (e) {
508
510
  loadErrors.push(e);
@@ -510,30 +512,107 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
510
512
  } else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
511
513
  else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
512
514
  }
513
- nativeBinding = requireNative();
514
- const forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || process.env.NAPI_RS_FORCE_WASI === "error";
515
+ function createLoadErrorChain(errors) {
516
+ return errors.reduce((previous, current) => {
517
+ let message;
518
+ try {
519
+ message = current && typeof current.message === "string" ? current.message : String(current);
520
+ } catch {
521
+ message = "Unknown error";
522
+ }
523
+ const error = new Error(message);
524
+ error.cause = previous;
525
+ return error;
526
+ }, null);
527
+ }
528
+ const __napiWasiFlavors = ["wasm32-wasi"];
529
+ const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR;
530
+ const __napiWasiFlavorRequested = typeof __napiWasiFlavor === "string" && __napiWasiFlavor.length > 0;
531
+ if (__napiWasiFlavorRequested && __napiWasiFlavors.indexOf(__napiWasiFlavor) === -1) throw new Error("Unsupported WASI flavor \"" + __napiWasiFlavor + "\". Available flavors: " + __napiWasiFlavors.join(", "));
532
+ const forceWasiError = process.env.NAPI_RS_FORCE_WASI === "error";
533
+ const forceWasi = process.env.NAPI_RS_FORCE_WASI === "true" || forceWasiError || __napiWasiFlavorRequested;
534
+ if (!forceWasi) nativeBinding = requireNative();
515
535
  if (!nativeBinding || forceWasi) {
516
536
  let wasiBinding = null;
517
- let wasiBindingError = null;
518
- try {
519
- wasiBinding = __require("../rolldown-binding.wasi.cjs");
520
- nativeBinding = wasiBinding;
521
- } catch (err) {
522
- if (forceWasi) wasiBindingError = err;
537
+ let wasiBindingLoaded = false;
538
+ const wasiBindingErrors = [];
539
+ const __napiWasiResolveCandidate = (specifier, isPackage, localArtifacts) => {
540
+ try {
541
+ __require.resolve(specifier);
542
+ } catch (resolveError) {
543
+ if (!resolveError || resolveError.code !== "MODULE_NOT_FOUND") throw resolveError;
544
+ if (isPackage) {
545
+ try {
546
+ __require.resolve(specifier + "/package.json");
547
+ } catch (packageError) {
548
+ if (packageError && packageError.code === "MODULE_NOT_FOUND") return resolveError;
549
+ throw resolveError;
550
+ }
551
+ throw resolveError;
552
+ }
553
+ return resolveError;
554
+ }
555
+ if (localArtifacts) {
556
+ let artifactError = null;
557
+ for (let i = 0; i < localArtifacts.length; i++) try {
558
+ __require.resolve(localArtifacts[i]);
559
+ return null;
560
+ } catch (resolveError) {
561
+ if (!resolveError || resolveError.code !== "MODULE_NOT_FOUND") throw resolveError;
562
+ artifactError = resolveError;
563
+ }
564
+ return artifactError;
565
+ }
566
+ return null;
567
+ };
568
+ if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
569
+ let candidateError = null;
570
+ let candidateFailed = false;
571
+ try {
572
+ candidateError = __napiWasiResolveCandidate("./rolldown-binding.wasi.cjs", false, ["./rolldown-binding.wasm32-wasi.debug.wasm", "./rolldown-binding.wasm32-wasi.wasm"]);
573
+ candidateFailed = candidateError !== null;
574
+ if (!candidateFailed) {
575
+ wasiBinding = __require("../rolldown-binding.wasi.cjs");
576
+ nativeBinding = wasiBinding;
577
+ wasiBindingLoaded = true;
578
+ }
579
+ } catch (err) {
580
+ candidateError = err;
581
+ candidateFailed = true;
582
+ }
583
+ if (candidateFailed) {
584
+ wasiBindingErrors.push(candidateError);
585
+ loadErrors.push(candidateError);
586
+ }
523
587
  }
524
- if (!nativeBinding || forceWasi) try {
525
- wasiBinding = __require("@rolldown/binding-wasm32-wasi");
526
- nativeBinding = wasiBinding;
527
- } catch (err) {
528
- if (forceWasi) {
529
- if (!wasiBindingError) wasiBindingError = err;
530
- else wasiBindingError.cause = err;
531
- loadErrors.push(err);
588
+ if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
589
+ let candidateError = null;
590
+ let candidateFailed = false;
591
+ try {
592
+ candidateError = __napiWasiResolveCandidate("@rolldown/binding-wasm32-wasi", true, void 0);
593
+ candidateFailed = candidateError !== null;
594
+ if (!candidateFailed) {
595
+ if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
596
+ const bindingPackageVersion = __require("@rolldown/binding-wasm32-wasi/package.json").version;
597
+ 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.`);
598
+ }
599
+ wasiBinding = __require("@rolldown/binding-wasm32-wasi");
600
+ nativeBinding = wasiBinding;
601
+ wasiBindingLoaded = true;
602
+ }
603
+ } catch (err) {
604
+ candidateError = err;
605
+ candidateFailed = true;
606
+ }
607
+ if (candidateFailed) {
608
+ wasiBindingErrors.push(candidateError);
609
+ loadErrors.push(candidateError);
532
610
  }
533
611
  }
534
- if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
535
- const error = /* @__PURE__ */ new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
536
- error.cause = wasiBindingError;
612
+ if (!wasiBindingLoaded && forceWasi && !forceWasiError && !__napiWasiFlavorRequested) nativeBinding = requireNative();
613
+ if ((forceWasiError || __napiWasiFlavorRequested) && !wasiBindingLoaded) {
614
+ 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");
615
+ error.cause = createLoadErrorChain(wasiBindingErrors);
537
616
  throw error;
538
617
  }
539
618
  }
@@ -545,10 +624,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
545
624
  if (!nativeBinding) {
546
625
  if (loadErrors.length > 0) {
547
626
  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.");
548
- error.cause = loadErrors.reduce((err, cur) => {
549
- cur.cause = err;
550
- return cur;
551
- });
627
+ error.cause = createLoadErrorChain(loadErrors);
552
628
  throw error;
553
629
  }
554
630
  throw new Error(`Failed to load native binding`);
@@ -601,7 +677,6 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
601
677
  module.exports.BindingWatcherChangeData = nativeBinding.BindingWatcherChangeData;
602
678
  module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
603
679
  module.exports.ParallelJsPluginRegistry = nativeBinding.ParallelJsPluginRegistry;
604
- module.exports.ScheduledBuild = nativeBinding.ScheduledBuild;
605
680
  module.exports.TraceSubscriberGuard = nativeBinding.TraceSubscriberGuard;
606
681
  module.exports.TsconfigCache = nativeBinding.TsconfigCache;
607
682
  module.exports.BindingAttachDebugInfo = nativeBinding.BindingAttachDebugInfo;
@@ -624,7 +699,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
624
699
  module.exports.startAsyncRuntime = nativeBinding.startAsyncRuntime;
625
700
  }));
626
701
  //#endregion
627
- //#region ../../node_modules/rolldown/dist/shared/logs-aMKUxRpj.mjs
702
+ //#region ../../node_modules/rolldown/dist/shared/logs-DmYCAKcW.mjs
628
703
  function spaces(index) {
629
704
  let result = "";
630
705
  while (index--) result += " ";
@@ -719,7 +794,12 @@ function getLocator(source, options = {}) {
719
794
  function locate(source, search, options) {
720
795
  return getLocator(source, options)(search, options && options.startIndex);
721
796
  }
722
- 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";
797
+ var INVALID_LOG_POSITION = "INVALID_LOG_POSITION";
798
+ var PLUGIN_ERROR = "PLUGIN_ERROR";
799
+ var INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN";
800
+ var CYCLE_LOADING = "CYCLE_LOADING";
801
+ var PARSE_ERROR = "PARSE_ERROR";
802
+ var VALIDATION_ERROR = "VALIDATION_ERROR";
723
803
  function logParseError(message, id, pos) {
724
804
  return {
725
805
  code: PARSE_ERROR,
@@ -728,6 +808,12 @@ function logParseError(message, id, pos) {
728
808
  pos
729
809
  };
730
810
  }
811
+ function logFailedValidation(message) {
812
+ return {
813
+ code: VALIDATION_ERROR,
814
+ message
815
+ };
816
+ }
731
817
  function logInvalidLogPosition(pluginName) {
732
818
  return {
733
819
  code: INVALID_LOG_POSITION,
@@ -830,7 +916,7 @@ function isReadonlyArray(input) {
830
916
  return Array.isArray(input);
831
917
  }
832
918
  //#endregion
833
- //#region ../../node_modules/rolldown/dist/shared/misc-CoQm4NHO.mjs
919
+ //#region ../../node_modules/rolldown/dist/shared/misc-DOSKtd97.mjs
834
920
  function arraify(value) {
835
921
  return Array.isArray(value) ? value : [value];
836
922
  }
@@ -846,8 +932,16 @@ function unsupported(info) {
846
932
  throw new Error(`UNSUPPORTED: ${info}`);
847
933
  }
848
934
  function noop(..._args) {}
935
+ var ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/;
936
+ /**
937
+ * Whether `name` is a path fragment — an absolute or relative path. Emitted file
938
+ * names, `[name]` substitutions and file-name patterns can be neither.
939
+ */
940
+ function isPathFragment(name) {
941
+ return name[0] === "/" || name[0] === "." && (name[1] === "/" || name[1] === ".") || ABSOLUTE_PATH_REGEX.test(name);
942
+ }
849
943
  //#endregion
850
- //#region ../../node_modules/rolldown/dist/shared/error-B68YLzl3.mjs
944
+ //#region ../../node_modules/rolldown/dist/shared/error-BgfXq0Tb.mjs
851
945
  function bindingifySourcemap$1(map) {
852
946
  if (map == null) return;
853
947
  return { inner: typeof map === "string" ? map : {
@@ -926,8 +1020,8 @@ function joinNewLine(s1, s2) {
926
1020
  return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
927
1021
  }
928
1022
  //#endregion
929
- //#region ../../node_modules/rolldown/dist/shared/parse-CTgsjpo8.mjs
930
- var import_binding$4 = /* @__PURE__ */ __toESM(require_binding(), 1);
1023
+ //#region ../../node_modules/rolldown/dist/shared/parse-DQIYJwT4.mjs
1024
+ var import_binding$5 = /* @__PURE__ */ __toESM(require_binding(), 1);
931
1025
  function wrap$1(result) {
932
1026
  let program, module, comments, errors;
933
1027
  return {
@@ -975,7 +1069,7 @@ function applyFix(program, fixPath) {
975
1069
  * @category Utilities
976
1070
  */
977
1071
  function parseSync(filename, sourceText, options) {
978
- return wrap$1((0, import_binding$4.parseSync)(filename, sourceText, options));
1072
+ return wrap$1((0, import_binding$5.parseSync)(filename, sourceText, options));
979
1073
  }
980
1074
  //#endregion
981
1075
  //#region ../../node_modules/rolldown/dist/parse-ast-index.mjs
@@ -1109,7 +1203,7 @@ function exclude(expr) {
1109
1203
  *
1110
1204
  * @category Plugin APIs
1111
1205
  */
1112
- var VERSION = "1.1.3";
1206
+ var VERSION = "1.2.1";
1113
1207
  var LOG_LEVEL_SILENT = "silent";
1114
1208
  var LOG_LEVEL_WARN = "warn";
1115
1209
  var LOG_LEVEL_INFO = "info";
@@ -1148,6 +1242,24 @@ function normalizeHook(hook) {
1148
1242
  }
1149
1243
  unreachable("Invalid hook type");
1150
1244
  }
1245
+ /**
1246
+ * Returns the `_parallel` marker of a parallel plugin, or `undefined` if the
1247
+ * given plugin is not one.
1248
+ *
1249
+ * Detection is descriptor-based instead of using the `in` operator: only an
1250
+ * own data property named `_parallel` with the expected shape counts. This
1251
+ * avoids false positives from inherited or accessor `_parallel` properties on
1252
+ * regular plugins, and guarantees that callers can safely read `fileUrl` and
1253
+ * `options` from the returned value.
1254
+ */
1255
+ function getParallelPluginInfo(plugin) {
1256
+ if (plugin === null || typeof plugin !== "object") return;
1257
+ const descriptor = Object.getOwnPropertyDescriptor(plugin, "_parallel");
1258
+ if (!descriptor || !("value" in descriptor)) return;
1259
+ const parallel = descriptor.value;
1260
+ if (parallel === null || typeof parallel !== "object" || typeof parallel.fileUrl !== "string") return;
1261
+ return parallel;
1262
+ }
1151
1263
  var MinimalPluginContextImpl = class {
1152
1264
  pluginName;
1153
1265
  hookName;
@@ -1171,7 +1283,7 @@ var MinimalPluginContextImpl = class {
1171
1283
  return error(logPluginError(normalizeLog(e), this.pluginName, { hook: this.hookName }));
1172
1284
  }
1173
1285
  };
1174
- var import_binding$3 = /* @__PURE__ */ __toESM(require_binding(), 1);
1286
+ var import_binding$4 = /* @__PURE__ */ __toESM(require_binding(), 1);
1175
1287
  var LAZY_FIELDS_KEY = Symbol("__lazy_fields__");
1176
1288
  /**
1177
1289
  * Base class for classes that use `@lazyProp` decorated properties.
@@ -1687,6 +1799,9 @@ var NormalizedOutputOptionsImpl = class extends PlainObjectLike {
1687
1799
  get sourcemap() {
1688
1800
  return this.inner.sourcemap;
1689
1801
  }
1802
+ get sourcemapFileNames() {
1803
+ return this.inner.sourcemapFilenames || this.outputOptions.sourcemapFileNames;
1804
+ }
1690
1805
  get sourcemapBaseUrl() {
1691
1806
  return this.inner.sourcemapBaseUrl ?? void 0;
1692
1807
  }
@@ -1808,6 +1923,7 @@ __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "assetFileNames",
1808
1923
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "format", null);
1809
1924
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "exports", null);
1810
1925
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemap", null);
1926
+ __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapFileNames", null);
1811
1927
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapBaseUrl", null);
1812
1928
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "shimMissingExports", null);
1813
1929
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "name", null);
@@ -1963,7 +2079,7 @@ var PluginContextData = class {
1963
2079
  this.loadModulePromiseMap.clear();
1964
2080
  }
1965
2081
  };
1966
- Object.defineProperty(import_binding$3.BindingMagicString.prototype, "isRolldownMagicString", {
2082
+ Object.defineProperty(import_binding$4.BindingMagicString.prototype, "isRolldownMagicString", {
1967
2083
  value: true,
1968
2084
  writable: false,
1969
2085
  configurable: false
@@ -1971,49 +2087,49 @@ Object.defineProperty(import_binding$3.BindingMagicString.prototype, "isRolldown
1971
2087
  function assertString(content, msg) {
1972
2088
  if (typeof content !== "string") throw new TypeError(msg);
1973
2089
  }
1974
- var nativeAppend = import_binding$3.BindingMagicString.prototype.append;
1975
- var nativePrepend = import_binding$3.BindingMagicString.prototype.prepend;
1976
- var nativeAppendLeft = import_binding$3.BindingMagicString.prototype.appendLeft;
1977
- var nativeAppendRight = import_binding$3.BindingMagicString.prototype.appendRight;
1978
- var nativePrependLeft = import_binding$3.BindingMagicString.prototype.prependLeft;
1979
- var nativePrependRight = import_binding$3.BindingMagicString.prototype.prependRight;
1980
- var nativeOverwrite = import_binding$3.BindingMagicString.prototype.overwrite;
1981
- var nativeUpdate = import_binding$3.BindingMagicString.prototype.update;
1982
- import_binding$3.BindingMagicString.prototype.append = function(content) {
2090
+ var nativeAppend = import_binding$4.BindingMagicString.prototype.append;
2091
+ var nativePrepend = import_binding$4.BindingMagicString.prototype.prepend;
2092
+ var nativeAppendLeft = import_binding$4.BindingMagicString.prototype.appendLeft;
2093
+ var nativeAppendRight = import_binding$4.BindingMagicString.prototype.appendRight;
2094
+ var nativePrependLeft = import_binding$4.BindingMagicString.prototype.prependLeft;
2095
+ var nativePrependRight = import_binding$4.BindingMagicString.prototype.prependRight;
2096
+ var nativeOverwrite = import_binding$4.BindingMagicString.prototype.overwrite;
2097
+ var nativeUpdate = import_binding$4.BindingMagicString.prototype.update;
2098
+ import_binding$4.BindingMagicString.prototype.append = function(content) {
1983
2099
  assertString(content, "outro content must be a string");
1984
2100
  return nativeAppend.call(this, content);
1985
2101
  };
1986
- import_binding$3.BindingMagicString.prototype.prepend = function(content) {
2102
+ import_binding$4.BindingMagicString.prototype.prepend = function(content) {
1987
2103
  assertString(content, "outro content must be a string");
1988
2104
  return nativePrepend.call(this, content);
1989
2105
  };
1990
- import_binding$3.BindingMagicString.prototype.appendLeft = function(index, content) {
2106
+ import_binding$4.BindingMagicString.prototype.appendLeft = function(index, content) {
1991
2107
  assertString(content, "inserted content must be a string");
1992
2108
  return nativeAppendLeft.call(this, index, content);
1993
2109
  };
1994
- import_binding$3.BindingMagicString.prototype.appendRight = function(index, content) {
2110
+ import_binding$4.BindingMagicString.prototype.appendRight = function(index, content) {
1995
2111
  assertString(content, "inserted content must be a string");
1996
2112
  return nativeAppendRight.call(this, index, content);
1997
2113
  };
1998
- import_binding$3.BindingMagicString.prototype.prependLeft = function(index, content) {
2114
+ import_binding$4.BindingMagicString.prototype.prependLeft = function(index, content) {
1999
2115
  assertString(content, "inserted content must be a string");
2000
2116
  return nativePrependLeft.call(this, index, content);
2001
2117
  };
2002
- import_binding$3.BindingMagicString.prototype.prependRight = function(index, content) {
2118
+ import_binding$4.BindingMagicString.prototype.prependRight = function(index, content) {
2003
2119
  assertString(content, "inserted content must be a string");
2004
2120
  return nativePrependRight.call(this, index, content);
2005
2121
  };
2006
- import_binding$3.BindingMagicString.prototype.overwrite = function(start, end, content, options) {
2122
+ import_binding$4.BindingMagicString.prototype.overwrite = function(start, end, content, options) {
2007
2123
  assertString(content, "replacement content must be a string");
2008
2124
  return nativeOverwrite.call(this, start, end, content, options);
2009
2125
  };
2010
- import_binding$3.BindingMagicString.prototype.update = function(start, end, content, options) {
2126
+ import_binding$4.BindingMagicString.prototype.update = function(start, end, content, options) {
2011
2127
  assertString(content, "replacement content must be a string");
2012
2128
  return nativeUpdate.call(this, start, end, content, options);
2013
2129
  };
2014
- var nativeReplace = import_binding$3.BindingMagicString.prototype.replace;
2015
- var nativeReplaceAll = import_binding$3.BindingMagicString.prototype.replaceAll;
2016
- import_binding$3.BindingMagicString.prototype.replace = function(searchValue, replacement) {
2130
+ var nativeReplace = import_binding$4.BindingMagicString.prototype.replace;
2131
+ var nativeReplaceAll = import_binding$4.BindingMagicString.prototype.replaceAll;
2132
+ import_binding$4.BindingMagicString.prototype.replace = function(searchValue, replacement) {
2017
2133
  if (typeof searchValue === "string") return nativeReplace.call(this, searchValue, replacement);
2018
2134
  if (searchValue.global) searchValue.lastIndex = 0;
2019
2135
  const lastMatchEnd = this.replaceRegex(searchValue, replacement);
@@ -2021,7 +2137,7 @@ import_binding$3.BindingMagicString.prototype.replace = function(searchValue, re
2021
2137
  else if (searchValue.sticky) searchValue.lastIndex = lastMatchEnd === -1 ? 0 : lastMatchEnd;
2022
2138
  return this;
2023
2139
  };
2024
- import_binding$3.BindingMagicString.prototype.replaceAll = function(searchValue, replacement) {
2140
+ import_binding$4.BindingMagicString.prototype.replaceAll = function(searchValue, replacement) {
2025
2141
  if (typeof searchValue === "string") return nativeReplaceAll.call(this, searchValue, replacement);
2026
2142
  if (!searchValue.global) throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");
2027
2143
  searchValue.lastIndex = 0;
@@ -2034,7 +2150,7 @@ import_binding$3.BindingMagicString.prototype.replaceAll = function(searchValue,
2034
2150
  *
2035
2151
  * @experimental
2036
2152
  */
2037
- var RolldownMagicString = import_binding$3.BindingMagicString;
2153
+ var RolldownMagicString = import_binding$4.BindingMagicString;
2038
2154
  function isEmptySourcemapFiled(array) {
2039
2155
  if (!array) return true;
2040
2156
  if (array.length === 0 || !array[0]) return true;
@@ -2127,6 +2243,20 @@ function containsImporterId(expr) {
2127
2243
  function assertNoImporterId(filterExprs, hookName) {
2128
2244
  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.`);
2129
2245
  }
2246
+ function containsStringId(expr) {
2247
+ switch (expr.kind) {
2248
+ case "and":
2249
+ case "or": return expr.args.some(containsStringId);
2250
+ case "not":
2251
+ case "include":
2252
+ case "exclude": return containsStringId(expr.expr);
2253
+ case "id": return typeof expr.pattern === "string";
2254
+ default: return false;
2255
+ }
2256
+ }
2257
+ function assertNoStringId(filterExprs, hookName) {
2258
+ 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.`);
2259
+ }
2130
2260
  function bindingifyFilterExprImpl(expr, list) {
2131
2261
  switch (expr.kind) {
2132
2262
  case "and": {
@@ -2200,8 +2330,11 @@ function bindingifyFilterExprImpl(expr, list) {
2200
2330
  }
2201
2331
  function bindingifyResolveIdFilter(filterOption) {
2202
2332
  if (!filterOption) return;
2203
- if (Array.isArray(filterOption)) return { value: filterOption.map(bindingifyFilterExpr) };
2204
- return filterOption.id ? bindingifyGeneralHookFilter("id", filterOption.id) : void 0;
2333
+ const filterExprs = Array.isArray(filterOption) ? filterOption : filterOption.id ? generalHookFilterMatcherToFilterExprs(filterOption.id, "id") : void 0;
2334
+ assertNoStringId(filterExprs, "resolveId");
2335
+ if (!filterExprs) return;
2336
+ const value = filterExprs.map(bindingifyFilterExpr);
2337
+ return value.length > 0 ? { value } : void 0;
2205
2338
  }
2206
2339
  function bindingifyLoadFilter(filterOption) {
2207
2340
  if (!filterOption) return;
@@ -2232,13 +2365,21 @@ function bindingifyPluginHookMeta(options) {
2232
2365
  }
2233
2366
  function bindingPluginOrder(order) {
2234
2367
  switch (order) {
2235
- case "post": return import_binding$3.BindingPluginOrder.Post;
2236
- case "pre": return import_binding$3.BindingPluginOrder.Pre;
2368
+ case "post": return import_binding$4.BindingPluginOrder.Post;
2369
+ case "pre": return import_binding$4.BindingPluginOrder.Pre;
2237
2370
  case null:
2238
2371
  case void 0: return;
2239
2372
  default: throw new Error(`Unknown plugin order: ${order}`);
2240
2373
  }
2241
2374
  }
2375
+ function bindingifyHook(hook, build) {
2376
+ if (!hook) return {};
2377
+ const normalized = normalizeHook(hook);
2378
+ return {
2379
+ ...build(normalized),
2380
+ meta: bindingifyPluginHookMeta(normalized.meta)
2381
+ };
2382
+ }
2242
2383
  var fsModule = {
2243
2384
  appendFile: fsp.appendFile,
2244
2385
  copyFile: fsp.copyFile,
@@ -2318,17 +2459,23 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2318
2459
  };
2319
2460
  }
2320
2461
  emitFile = (file) => {
2321
- if (file.type === "prebuilt-chunk") return this.context.emitPrebuiltChunk({
2322
- fileName: file.fileName,
2323
- name: file.name,
2324
- code: file.code,
2325
- exports: file.exports,
2326
- map: bindingifySourcemap$1(file.map),
2327
- sourcemapFileName: file.sourcemapFileName,
2328
- facadeModuleId: file.facadeModuleId,
2329
- isEntry: file.isEntry,
2330
- isDynamicEntry: file.isDynamicEntry
2331
- });
2462
+ if (file.type === "prebuilt-chunk") {
2463
+ if (typeof file.code !== "string") return error(logFailedValidation(`Emitted prebuilt chunks need to have a valid string code, received "${file.code}".`));
2464
+ 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}".`));
2465
+ return this.context.emitPrebuiltChunk({
2466
+ fileName: file.fileName,
2467
+ name: file.name,
2468
+ code: file.code,
2469
+ exports: file.exports,
2470
+ map: bindingifySourcemap$1(file.map),
2471
+ sourcemapFileName: file.sourcemapFileName,
2472
+ facadeModuleId: file.facadeModuleId,
2473
+ isEntry: file.isEntry,
2474
+ isDynamicEntry: file.isDynamicEntry
2475
+ });
2476
+ }
2477
+ const validatedName = file.fileName || file.name;
2478
+ 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}".`));
2332
2479
  if (file.type === "chunk") return this.context.emitChunk({
2333
2480
  preserveEntrySignatures: bindingifyPreserveEntrySignatures(file.preserveSignature),
2334
2481
  ...file
@@ -2364,6 +2511,9 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2364
2511
  return parseAst(input, options);
2365
2512
  }
2366
2513
  };
2514
+ function createPluginContext(args, ctx) {
2515
+ return new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
2516
+ }
2367
2517
  var LoadPluginContextImpl = class extends PluginContextImpl {
2368
2518
  inner;
2369
2519
  constructor(outputOptions, context, plugin, data, inner, moduleId, onLog, logLevelOption, watchMode) {
@@ -2411,36 +2561,19 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
2411
2561
  this.inner.sendMagicString(s);
2412
2562
  }
2413
2563
  };
2414
- function createPluginContext(args, ctx) {
2415
- return new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
2416
- }
2417
2564
  function bindingifyBuildStart(args) {
2418
- const hook = args.plugin.buildStart;
2419
- if (!hook) return {};
2420
- const { handler, meta } = normalizeHook(hook);
2421
- return {
2422
- plugin: async (ctx, opts) => {
2423
- await handler.call(createPluginContext(args, ctx), args.pluginContextData.getInputOptions(opts));
2424
- },
2425
- meta: bindingifyPluginHookMeta(meta)
2426
- };
2565
+ return bindingifyHook(args.plugin.buildStart, ({ handler }) => ({ plugin: async (ctx, opts) => {
2566
+ await handler.call(createPluginContext(args, ctx), args.pluginContextData.getInputOptions(opts));
2567
+ } }));
2427
2568
  }
2428
2569
  function bindingifyBuildEnd(args) {
2429
- const hook = args.plugin.buildEnd;
2430
- if (!hook) return {};
2431
- const { handler, meta } = normalizeHook(hook);
2432
- return {
2433
- plugin: async (ctx, err) => {
2434
- await handler.call(createPluginContext(args, ctx), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
2435
- },
2436
- meta: bindingifyPluginHookMeta(meta)
2437
- };
2570
+ return bindingifyHook(args.plugin.buildEnd, ({ handler }) => ({ plugin: async (ctx, err) => {
2571
+ await handler.call(createPluginContext(args, ctx), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
2572
+ } }));
2438
2573
  }
2439
2574
  function bindingifyResolveId(args) {
2440
2575
  const hook = args.plugin.resolveId;
2441
- if (!hook) return {};
2442
- const { handler, meta, options } = normalizeHook(hook);
2443
- return {
2576
+ return bindingifyHook(hook, ({ handler, options }) => ({
2444
2577
  plugin: async (ctx, specifier, importer, extraOptions) => {
2445
2578
  const contextResolveOptions = extraOptions.custom != null ? args.pluginContextData.getSavedResolveOptions(extraOptions.custom) : void 0;
2446
2579
  const ret = await handler.call(createPluginContext(args, ctx), specifier, importer ?? void 0, {
@@ -2470,44 +2603,34 @@ function bindingifyResolveId(args) {
2470
2603
  packageJsonPath: ret.packageJsonPath
2471
2604
  };
2472
2605
  },
2473
- meta: bindingifyPluginHookMeta(meta),
2474
2606
  filter: bindingifyResolveIdFilter(options.filter)
2475
- };
2607
+ }));
2476
2608
  }
2477
2609
  function bindingifyResolveDynamicImport(args) {
2478
- const hook = args.plugin.resolveDynamicImport;
2479
- if (!hook) return {};
2480
- const { handler, meta } = normalizeHook(hook);
2481
- return {
2482
- plugin: async (ctx, specifier, importer) => {
2483
- const ret = await handler.call(createPluginContext(args, ctx), specifier, importer ?? void 0);
2484
- if (ret == null) return;
2485
- if (ret === false) return {
2486
- id: specifier,
2487
- external: true
2488
- };
2489
- if (typeof ret === "string") return { id: ret };
2490
- const result = {
2491
- id: ret.id,
2492
- external: ret.external,
2493
- packageJsonPath: ret.packageJsonPath
2494
- };
2495
- if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
2496
- args.pluginContextData.updateModuleOption(ret.id, {
2497
- meta: ret.meta || {},
2498
- moduleSideEffects: ret.moduleSideEffects || null,
2499
- invalidate: false
2500
- });
2501
- return result;
2502
- },
2503
- meta: bindingifyPluginHookMeta(meta)
2504
- };
2610
+ return bindingifyHook(args.plugin.resolveDynamicImport, ({ handler }) => ({ plugin: async (ctx, specifier, importer) => {
2611
+ const ret = await handler.call(createPluginContext(args, ctx), specifier, importer ?? void 0);
2612
+ if (ret == null) return;
2613
+ if (ret === false) return {
2614
+ id: specifier,
2615
+ external: true
2616
+ };
2617
+ if (typeof ret === "string") return { id: ret };
2618
+ const result = {
2619
+ id: ret.id,
2620
+ external: ret.external,
2621
+ packageJsonPath: ret.packageJsonPath
2622
+ };
2623
+ if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
2624
+ args.pluginContextData.updateModuleOption(ret.id, {
2625
+ meta: ret.meta || {},
2626
+ moduleSideEffects: ret.moduleSideEffects || null,
2627
+ invalidate: false
2628
+ });
2629
+ return result;
2630
+ } }));
2505
2631
  }
2506
2632
  function bindingifyTransform(args) {
2507
- const hook = args.plugin.transform;
2508
- if (!hook) return {};
2509
- const { handler, meta, options } = normalizeHook(hook);
2510
- return {
2633
+ return bindingifyHook(args.plugin.transform, ({ handler, options }) => ({
2511
2634
  plugin: async (ctx, code, id, meta) => {
2512
2635
  let magicStringInstance, astInstance;
2513
2636
  Object.defineProperties(meta, {
@@ -2523,10 +2646,7 @@ function bindingifyTransform(args) {
2523
2646
  case "js":
2524
2647
  case "jsx":
2525
2648
  case "ts":
2526
- case "tsx":
2527
- lang = meta.moduleType;
2528
- break;
2529
- default: break;
2649
+ case "tsx": lang = meta.moduleType;
2530
2650
  }
2531
2651
  astInstance = parseAst(code, {
2532
2652
  astType: meta.moduleType.includes("ts") ? "ts" : "js",
@@ -2562,15 +2682,11 @@ function bindingifyTransform(args) {
2562
2682
  moduleType: ret.moduleType
2563
2683
  };
2564
2684
  },
2565
- meta: bindingifyPluginHookMeta(meta),
2566
2685
  filter: bindingifyTransformFilter(options.filter)
2567
- };
2686
+ }));
2568
2687
  }
2569
2688
  function bindingifyLoad(args) {
2570
- const hook = args.plugin.load;
2571
- if (!hook) return {};
2572
- const { handler, meta, options } = normalizeHook(hook);
2573
- return {
2689
+ return bindingifyHook(args.plugin.load, ({ handler, options }) => ({
2574
2690
  plugin: async (ctx, id) => {
2575
2691
  const ret = await handler.call(new LoadPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, args.onLog, args.logLevel, args.watchMode), id);
2576
2692
  if (ret == null) return;
@@ -2588,9 +2704,8 @@ function bindingifyLoad(args) {
2588
2704
  moduleSideEffects: moduleOption.moduleSideEffects ?? void 0
2589
2705
  };
2590
2706
  },
2591
- meta: bindingifyPluginHookMeta(meta),
2592
2707
  filter: bindingifyLoadFilter(options.filter)
2593
- };
2708
+ }));
2594
2709
  }
2595
2710
  function preProcessSourceMap(ret, id) {
2596
2711
  if (!ret.map) return;
@@ -2603,32 +2718,17 @@ function preProcessSourceMap(ret, id) {
2603
2718
  return map;
2604
2719
  }
2605
2720
  function bindingifyModuleParsed(args) {
2606
- const hook = args.plugin.moduleParsed;
2607
- if (!hook) return {};
2608
- const { handler, meta } = normalizeHook(hook);
2609
- return {
2610
- plugin: async (ctx, moduleInfo) => {
2611
- await handler.call(createPluginContext(args, ctx), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
2612
- },
2613
- meta: bindingifyPluginHookMeta(meta)
2614
- };
2721
+ return bindingifyHook(args.plugin.moduleParsed, ({ handler }) => ({ plugin: async (ctx, moduleInfo) => {
2722
+ await handler.call(createPluginContext(args, ctx), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
2723
+ } }));
2615
2724
  }
2616
2725
  function bindingifyRenderStart(args) {
2617
- const hook = args.plugin.renderStart;
2618
- if (!hook) return {};
2619
- const { handler, meta } = normalizeHook(hook);
2620
- return {
2621
- plugin: async (ctx, opts) => {
2622
- 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));
2623
- },
2624
- meta: bindingifyPluginHookMeta(meta)
2625
- };
2726
+ return bindingifyHook(args.plugin.renderStart, ({ handler }) => ({ plugin: async (ctx, opts) => {
2727
+ await handler.call(createPluginContext(args, ctx), args.pluginContextData.getOutputOptions(opts), args.pluginContextData.getInputOptions(opts));
2728
+ } }));
2626
2729
  }
2627
2730
  function bindingifyRenderChunk(args) {
2628
- const hook = args.plugin.renderChunk;
2629
- if (!hook) return {};
2630
- const { handler, meta, options } = normalizeHook(hook);
2631
- return {
2731
+ return bindingifyHook(args.plugin.renderChunk, ({ handler, options }) => ({
2632
2732
  plugin: async (ctx, code, chunk, opts, meta) => {
2633
2733
  if (args.pluginContextData.getRenderChunkMeta() == null) args.pluginContextData.setRenderChunkMeta({ chunks: Object.fromEntries(Object.entries(meta.chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
2634
2734
  const renderChunkMeta = args.pluginContextData.getRenderChunkMeta();
@@ -2641,7 +2741,7 @@ function bindingifyRenderChunk(args) {
2641
2741
  },
2642
2742
  configurable: true
2643
2743
  });
2644
- 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);
2744
+ const ret = await handler.call(createPluginContext(args, ctx), code, transformRenderedChunk(chunk), args.pluginContextData.getOutputOptions(opts), renderChunkMeta);
2645
2745
  if (ret == null) return;
2646
2746
  if (ret instanceof RolldownMagicString) {
2647
2747
  const normalizedCode = ret.toString();
@@ -2692,148 +2792,79 @@ function bindingifyRenderChunk(args) {
2692
2792
  map: bindingifySourcemap$1(ret.map)
2693
2793
  };
2694
2794
  },
2695
- meta: bindingifyPluginHookMeta(meta),
2696
2795
  filter: bindingifyRenderChunkFilter(options.filter)
2697
- };
2796
+ }));
2698
2797
  }
2699
2798
  function bindingifyAugmentChunkHash(args) {
2700
- const hook = args.plugin.augmentChunkHash;
2701
- if (!hook) return {};
2702
- const { handler, meta } = normalizeHook(hook);
2703
- return {
2704
- plugin: async (ctx, chunk) => {
2705
- return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
2706
- },
2707
- meta: bindingifyPluginHookMeta(meta)
2708
- };
2799
+ return bindingifyHook(args.plugin.augmentChunkHash, ({ handler }) => ({ plugin: async (ctx, chunk) => {
2800
+ return handler.call(createPluginContext(args, ctx), transformRenderedChunk(chunk));
2801
+ } }));
2802
+ }
2803
+ function bindingifyResolveFileUrl(args) {
2804
+ return bindingifyHook(args.plugin.resolveFileUrl, ({ handler }) => ({ plugin: async (ctx, resolveFileUrlArgs) => {
2805
+ return handler.call(createPluginContext(args, ctx), resolveFileUrlArgs);
2806
+ } }));
2709
2807
  }
2710
2808
  function bindingifyRenderError(args) {
2711
- const hook = args.plugin.renderError;
2712
- if (!hook) return {};
2713
- const { handler, meta } = normalizeHook(hook);
2809
+ return bindingifyHook(args.plugin.renderError, ({ handler }) => ({ plugin: async (ctx, err) => {
2810
+ await handler.call(createPluginContext(args, ctx), aggregateBindingErrorsIntoJsError(err));
2811
+ } }));
2812
+ }
2813
+ function createOutputBundle(args, ctx, bundle) {
2814
+ const changed = {
2815
+ updated: /* @__PURE__ */ new Set(),
2816
+ deleted: /* @__PURE__ */ new Set()
2817
+ };
2818
+ const context = createPluginContext(args, ctx);
2714
2819
  return {
2715
- plugin: async (ctx, err) => {
2716
- handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), aggregateBindingErrorsIntoJsError(err));
2717
- },
2718
- meta: bindingifyPluginHookMeta(meta)
2820
+ changed,
2821
+ context,
2822
+ output: transformToOutputBundle(context, unwrapBindingResult(bundle), changed)
2719
2823
  };
2720
2824
  }
2721
2825
  function bindingifyGenerateBundle(args) {
2722
- const hook = args.plugin.generateBundle;
2723
- if (!hook) return {};
2724
- const { handler, meta } = normalizeHook(hook);
2725
- return {
2726
- plugin: async (ctx, bundle, isWrite, opts) => {
2727
- const changed = {
2728
- updated: /* @__PURE__ */ new Set(),
2729
- deleted: /* @__PURE__ */ new Set()
2730
- };
2731
- const context = new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
2732
- const output = transformToOutputBundle(context, unwrapBindingResult(bundle), changed);
2733
- await handler.call(context, args.pluginContextData.getOutputOptions(opts), output, isWrite);
2734
- return collectChangedBundle(changed, output);
2735
- },
2736
- meta: bindingifyPluginHookMeta(meta)
2737
- };
2826
+ return bindingifyHook(args.plugin.generateBundle, ({ handler }) => ({ plugin: async (ctx, bundle, isWrite, opts) => {
2827
+ const { changed, context, output } = createOutputBundle(args, ctx, bundle);
2828
+ await handler.call(context, args.pluginContextData.getOutputOptions(opts), output, isWrite);
2829
+ return collectChangedBundle(changed, output);
2830
+ } }));
2738
2831
  }
2739
2832
  function bindingifyWriteBundle(args) {
2740
- const hook = args.plugin.writeBundle;
2741
- if (!hook) return {};
2742
- const { handler, meta } = normalizeHook(hook);
2743
- return {
2744
- plugin: async (ctx, bundle, opts) => {
2745
- const changed = {
2746
- updated: /* @__PURE__ */ new Set(),
2747
- deleted: /* @__PURE__ */ new Set()
2748
- };
2749
- const context = new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
2750
- const output = transformToOutputBundle(context, unwrapBindingResult(bundle), changed);
2751
- await handler.call(context, args.pluginContextData.getOutputOptions(opts), output);
2752
- return collectChangedBundle(changed, output);
2753
- },
2754
- meta: bindingifyPluginHookMeta(meta)
2755
- };
2833
+ return bindingifyHook(args.plugin.writeBundle, ({ handler }) => ({ plugin: async (ctx, bundle, opts) => {
2834
+ const { changed, context, output } = createOutputBundle(args, ctx, bundle);
2835
+ await handler.call(context, args.pluginContextData.getOutputOptions(opts), output);
2836
+ return collectChangedBundle(changed, output);
2837
+ } }));
2756
2838
  }
2757
2839
  function bindingifyCloseBundle(args) {
2758
- const hook = args.plugin.closeBundle;
2759
- if (!hook) return {};
2760
- const { handler, meta } = normalizeHook(hook);
2761
- return {
2762
- plugin: async (ctx, err) => {
2763
- await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
2764
- },
2765
- meta: bindingifyPluginHookMeta(meta)
2766
- };
2767
- }
2768
- function bindingifyBanner(args) {
2769
- const hook = args.plugin.banner;
2770
- if (!hook) return {};
2771
- const { handler, meta } = normalizeHook(hook);
2772
- return {
2773
- plugin: async (ctx, chunk) => {
2774
- if (typeof handler === "string") return handler;
2775
- return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
2776
- },
2777
- meta: bindingifyPluginHookMeta(meta)
2778
- };
2779
- }
2780
- function bindingifyFooter(args) {
2781
- const hook = args.plugin.footer;
2782
- if (!hook) return {};
2783
- const { handler, meta } = normalizeHook(hook);
2784
- return {
2785
- plugin: async (ctx, chunk) => {
2786
- if (typeof handler === "string") return handler;
2787
- return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
2788
- },
2789
- meta: bindingifyPluginHookMeta(meta)
2790
- };
2791
- }
2792
- function bindingifyIntro(args) {
2793
- const hook = args.plugin.intro;
2794
- if (!hook) return {};
2795
- const { handler, meta } = normalizeHook(hook);
2796
- return {
2797
- plugin: async (ctx, chunk) => {
2798
- if (typeof handler === "string") return handler;
2799
- return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
2800
- },
2801
- meta: bindingifyPluginHookMeta(meta)
2802
- };
2803
- }
2804
- function bindingifyOutro(args) {
2805
- const hook = args.plugin.outro;
2806
- if (!hook) return {};
2807
- const { handler, meta } = normalizeHook(hook);
2808
- return {
2809
- plugin: async (ctx, chunk) => {
2810
- if (typeof handler === "string") return handler;
2811
- return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
2812
- },
2813
- meta: bindingifyPluginHookMeta(meta)
2814
- };
2840
+ return bindingifyHook(args.plugin.closeBundle, ({ handler }) => ({ plugin: async (ctx, err) => {
2841
+ await handler.call(createPluginContext(args, ctx), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
2842
+ } }));
2843
+ }
2844
+ function bindingifyAddonHook(args, name) {
2845
+ return bindingifyHook(args.plugin[name], ({ handler }) => ({ plugin: async (ctx, chunk) => {
2846
+ if (typeof handler === "string") return handler;
2847
+ return handler.call(createPluginContext(args, ctx), transformRenderedChunk(chunk));
2848
+ } }));
2849
+ }
2850
+ function bindingifyHotUpdate(args) {
2851
+ return bindingifyHook(args.plugin.hotUpdate, ({ handler }) => ({ plugin: async (ctx, hookArgs) => {
2852
+ return await handler.call(createPluginContext(args, ctx), {
2853
+ type: hookArgs.kind,
2854
+ file: hookArgs.file,
2855
+ modules: hookArgs.modules
2856
+ }) ?? void 0;
2857
+ } }));
2815
2858
  }
2816
2859
  function bindingifyWatchChange(args) {
2817
- const hook = args.plugin.watchChange;
2818
- if (!hook) return {};
2819
- const { handler, meta } = normalizeHook(hook);
2820
- return {
2821
- plugin: async (ctx, id, event) => {
2822
- await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), id, { event });
2823
- },
2824
- meta: bindingifyPluginHookMeta(meta)
2825
- };
2860
+ return bindingifyHook(args.plugin.watchChange, ({ handler }) => ({ plugin: async (ctx, id, event) => {
2861
+ await handler.call(createPluginContext(args, ctx), id, { event });
2862
+ } }));
2826
2863
  }
2827
2864
  function bindingifyCloseWatcher(args) {
2828
- const hook = args.plugin.closeWatcher;
2829
- if (!hook) return {};
2830
- const { handler, meta } = normalizeHook(hook);
2831
- return {
2832
- plugin: async (ctx) => {
2833
- await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
2834
- },
2835
- meta: bindingifyPluginHookMeta(meta)
2836
- };
2865
+ return bindingifyHook(args.plugin.closeWatcher, ({ handler }) => ({ plugin: async (ctx) => {
2866
+ await handler.call(createPluginContext(args, ctx));
2867
+ } }));
2837
2868
  }
2838
2869
  var HookUsage = class {
2839
2870
  bitflag = BigInt(0);
@@ -2867,6 +2898,8 @@ function extractHookUsage(plugin) {
2867
2898
  if (plugin.footer) hookUsage.union(262144);
2868
2899
  if (plugin.intro) hookUsage.union(524288);
2869
2900
  if (plugin.outro) hookUsage.union(1048576);
2901
+ if (plugin.resolveFileUrl) hookUsage.union(2097152);
2902
+ if (plugin.hotUpdate) hookUsage.union(4194304);
2870
2903
  return hookUsage;
2871
2904
  }
2872
2905
  function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
@@ -2889,16 +2922,18 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
2889
2922
  const { plugin: load, meta: loadMeta, filter: loadFilter } = bindingifyLoad(args);
2890
2923
  const { plugin: renderChunk, meta: renderChunkMeta, filter: renderChunkFilter } = bindingifyRenderChunk(args);
2891
2924
  const { plugin: augmentChunkHash, meta: augmentChunkHashMeta } = bindingifyAugmentChunkHash(args);
2925
+ const { plugin: resolveFileUrl, meta: resolveFileUrlMeta } = bindingifyResolveFileUrl(args);
2892
2926
  const { plugin: renderStart, meta: renderStartMeta } = bindingifyRenderStart(args);
2893
2927
  const { plugin: renderError, meta: renderErrorMeta } = bindingifyRenderError(args);
2894
2928
  const { plugin: generateBundle, meta: generateBundleMeta } = bindingifyGenerateBundle(args);
2895
2929
  const { plugin: writeBundle, meta: writeBundleMeta } = bindingifyWriteBundle(args);
2896
2930
  const { plugin: closeBundle, meta: closeBundleMeta } = bindingifyCloseBundle(args);
2897
- const { plugin: banner, meta: bannerMeta } = bindingifyBanner(args);
2898
- const { plugin: footer, meta: footerMeta } = bindingifyFooter(args);
2899
- const { plugin: intro, meta: introMeta } = bindingifyIntro(args);
2900
- const { plugin: outro, meta: outroMeta } = bindingifyOutro(args);
2931
+ const { plugin: banner, meta: bannerMeta } = bindingifyAddonHook(args, "banner");
2932
+ const { plugin: footer, meta: footerMeta } = bindingifyAddonHook(args, "footer");
2933
+ const { plugin: intro, meta: introMeta } = bindingifyAddonHook(args, "intro");
2934
+ const { plugin: outro, meta: outroMeta } = bindingifyAddonHook(args, "outro");
2901
2935
  const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(args);
2936
+ const { plugin: hotUpdate, meta: hotUpdateMeta } = bindingifyHotUpdate(args);
2902
2937
  const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
2903
2938
  let hookUsage = extractHookUsage(plugin).inner();
2904
2939
  return wrapHandlers({
@@ -2925,6 +2960,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
2925
2960
  renderChunkFilter,
2926
2961
  augmentChunkHash,
2927
2962
  augmentChunkHashMeta,
2963
+ resolveFileUrl,
2964
+ resolveFileUrlMeta,
2928
2965
  renderStart,
2929
2966
  renderStartMeta,
2930
2967
  renderError,
@@ -2945,6 +2982,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
2945
2982
  outroMeta,
2946
2983
  watchChange,
2947
2984
  watchChangeMeta,
2985
+ hotUpdate,
2986
+ hotUpdateMeta,
2948
2987
  closeWatcher,
2949
2988
  closeWatcherMeta,
2950
2989
  hookUsage
@@ -2961,6 +3000,7 @@ function wrapHandlers(plugin) {
2961
3000
  "load",
2962
3001
  "renderChunk",
2963
3002
  "augmentChunkHash",
3003
+ "resolveFileUrl",
2964
3004
  "renderStart",
2965
3005
  "renderError",
2966
3006
  "generateBundle",
@@ -2971,6 +3011,7 @@ function wrapHandlers(plugin) {
2971
3011
  "intro",
2972
3012
  "outro",
2973
3013
  "watchChange",
3014
+ "hotUpdate",
2974
3015
  "closeWatcher"
2975
3016
  ]) {
2976
3017
  const handler = plugin[hookName];
@@ -3012,9 +3053,15 @@ function normalizeTransformOptions(inputOptions) {
3012
3053
  oxcTransformOptions
3013
3054
  };
3014
3055
  }
3056
+ function getDefaultDevRuntime(host = "localhost", port = 3e3) {
3057
+ const runtimeEntry = fs.readFileSync(fileURLToPath(import.meta.resolve("rolldown/experimental/runtime")), "utf8");
3058
+ const runtimeHelperImportEnd = runtimeEntry.indexOf("\n");
3059
+ if (!runtimeEntry.startsWith("import ") || runtimeHelperImportEnd === -1) throw new Error("Expected the standalone runtime to start with a helper import");
3060
+ return `${runtimeEntry.slice(runtimeHelperImportEnd + 1)}\n${fs.readFileSync(fileURLToPath(import.meta.resolve("#default-runtime")), "utf8").replaceAll("$ADDR", `${host}:${port}`)}`;
3061
+ }
3015
3062
  function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
3016
3063
  const plugins = rawPlugins.map((plugin) => {
3017
- if ("_parallel" in plugin) return;
3064
+ if (getParallelPluginInfo(plugin)) return;
3018
3065
  if (plugin instanceof BuiltinPlugin) switch (plugin.name) {
3019
3066
  case "builtin:vite-manifest": return bindingifyManifestPlugin(plugin, pluginContextData);
3020
3067
  default: return bindingifyBuiltInPlugin(plugin);
@@ -3064,16 +3111,24 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginC
3064
3111
  }
3065
3112
  function bindingifyDevMode(devMode) {
3066
3113
  if (devMode) {
3067
- if (typeof devMode === "boolean") return devMode ? {} : void 0;
3068
- return devMode;
3114
+ if (typeof devMode === "boolean") return devMode ? {
3115
+ implement: getDefaultDevRuntime(),
3116
+ skipCommonRuntimeInjection: true
3117
+ } : void 0;
3118
+ const usesDefaultRuntime = devMode.implement == null;
3119
+ return {
3120
+ ...devMode,
3121
+ implement: devMode.implement ?? getDefaultDevRuntime(devMode.host, devMode.port),
3122
+ skipCommonRuntimeInjection: usesDefaultRuntime ? true : devMode.skipCommonRuntimeInjection
3123
+ };
3069
3124
  }
3070
3125
  }
3071
3126
  function bindingifyAttachDebugInfo(attachDebugInfo) {
3072
3127
  switch (attachDebugInfo) {
3073
3128
  case void 0: return;
3074
- case "full": return import_binding$3.BindingAttachDebugInfo.Full;
3075
- case "simple": return import_binding$3.BindingAttachDebugInfo.Simple;
3076
- case "none": return import_binding$3.BindingAttachDebugInfo.None;
3129
+ case "full": return import_binding$4.BindingAttachDebugInfo.Full;
3130
+ case "simple": return import_binding$4.BindingAttachDebugInfo.Simple;
3131
+ case "none": return import_binding$4.BindingAttachDebugInfo.None;
3077
3132
  }
3078
3133
  }
3079
3134
  function bindingifyExternal(external) {
@@ -3086,13 +3141,13 @@ function bindingifyExternal(external) {
3086
3141
  }
3087
3142
  }
3088
3143
  function bindingifyExperimental(experimental) {
3089
- let chunkModulesOrder = import_binding$3.BindingChunkModuleOrderBy.ExecOrder;
3144
+ let chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ExecOrder;
3090
3145
  if (experimental?.chunkModulesOrder) switch (experimental.chunkModulesOrder) {
3091
3146
  case "exec-order":
3092
- chunkModulesOrder = import_binding$3.BindingChunkModuleOrderBy.ExecOrder;
3147
+ chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ExecOrder;
3093
3148
  break;
3094
3149
  case "module-id":
3095
- chunkModulesOrder = import_binding$3.BindingChunkModuleOrderBy.ModuleId;
3150
+ chunkModulesOrder = import_binding$4.BindingChunkModuleOrderBy.ModuleId;
3096
3151
  break;
3097
3152
  default: throw new Error(`Unexpected chunkModulesOrder: ${experimental.chunkModulesOrder}`);
3098
3153
  }
@@ -3152,10 +3207,10 @@ function bindingifyInject(inject) {
3152
3207
  }
3153
3208
  function bindingifyLogLevel(logLevel) {
3154
3209
  switch (logLevel) {
3155
- case "silent": return import_binding$3.BindingLogLevel.Silent;
3156
- case "debug": return import_binding$3.BindingLogLevel.Debug;
3157
- case "warn": return import_binding$3.BindingLogLevel.Warn;
3158
- case "info": return import_binding$3.BindingLogLevel.Info;
3210
+ case "silent": return import_binding$4.BindingLogLevel.Silent;
3211
+ case "debug": return import_binding$4.BindingLogLevel.Debug;
3212
+ case "warn": return import_binding$4.BindingLogLevel.Warn;
3213
+ case "info": return import_binding$4.BindingLogLevel.Info;
3159
3214
  default: throw new Error(`Unexpected log level: ${logLevel}`);
3160
3215
  }
3161
3216
  }
@@ -3205,21 +3260,15 @@ function bindingifyTreeshakeOptions(config) {
3205
3260
  };
3206
3261
  switch (config.propertyReadSideEffects) {
3207
3262
  case "always":
3208
- normalizedConfig.propertyReadSideEffects = import_binding$3.BindingPropertyReadSideEffects.Always;
3209
- break;
3210
- case false:
3211
- normalizedConfig.propertyReadSideEffects = import_binding$3.BindingPropertyReadSideEffects.False;
3263
+ normalizedConfig.propertyReadSideEffects = import_binding$4.BindingPropertyReadSideEffects.Always;
3212
3264
  break;
3213
- default:
3265
+ case false: normalizedConfig.propertyReadSideEffects = import_binding$4.BindingPropertyReadSideEffects.False;
3214
3266
  }
3215
3267
  switch (config.propertyWriteSideEffects) {
3216
3268
  case "always":
3217
- normalizedConfig.propertyWriteSideEffects = import_binding$3.BindingPropertyWriteSideEffects.Always;
3269
+ normalizedConfig.propertyWriteSideEffects = import_binding$4.BindingPropertyWriteSideEffects.Always;
3218
3270
  break;
3219
- case false:
3220
- normalizedConfig.propertyWriteSideEffects = import_binding$3.BindingPropertyWriteSideEffects.False;
3221
- break;
3222
- default:
3271
+ case false: normalizedConfig.propertyWriteSideEffects = import_binding$4.BindingPropertyWriteSideEffects.False;
3223
3272
  }
3224
3273
  if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
3225
3274
  else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
@@ -3251,8 +3300,7 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
3251
3300
  };
3252
3301
  }
3253
3302
  //#endregion
3254
- //#region ../../node_modules/rolldown/dist/shared/rolldown-build-DR0wzp0V.mjs
3255
- var import_binding$2 = /* @__PURE__ */ __toESM(require_binding(), 1);
3303
+ //#region ../../node_modules/rolldown/dist/shared/create-bundler-option-4QtiLLuz.mjs
3256
3304
  function getLogger(plugins, onLog, logLevel, watchMode) {
3257
3305
  const minimalPriority = logLevelPriority[logLevel];
3258
3306
  const logger = (level, log, skipped = /* @__PURE__ */ new Set()) => {
@@ -3271,7 +3319,7 @@ function getLogger(plugins, onLog, logLevel, watchMode) {
3271
3319
  info: getLogHandler("info"),
3272
3320
  meta: {
3273
3321
  rollupVersion: "4.23.0",
3274
- rolldownVersion: "1.1.3",
3322
+ rolldownVersion: "1.2.1",
3275
3323
  watchMode
3276
3324
  },
3277
3325
  warn: getLogHandler("warn"),
@@ -3345,7 +3393,8 @@ var ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES = [
3345
3393
  "renderStart",
3346
3394
  "renderError",
3347
3395
  "writeBundle",
3348
- "generateBundle"
3396
+ "generateBundle",
3397
+ "resolveFileUrl"
3349
3398
  ];
3350
3399
  var ENUMERATED_PLUGIN_HOOK_NAMES = [
3351
3400
  ...ENUMERATED_INPUT_PLUGIN_HOOK_NAMES,
@@ -3355,7 +3404,13 @@ var ENUMERATED_PLUGIN_HOOK_NAMES = [
3355
3404
  "intro",
3356
3405
  "outro"
3357
3406
  ];
3358
- 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];
3407
+ 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];
3408
+ /**
3409
+ * Names of the hidden hooks, alongside {@linkcode InternalFunctionPluginHooks}.
3410
+ * Kept separate from `ENUMERATED_INPUT_PLUGIN_HOOK_NAMES` so the names stay out
3411
+ * of the published `.d.ts` (that list's type is reachable from public types).
3412
+ */
3413
+ var INTERNAL_PLUGIN_HOOK_NAMES = ["hotUpdate"];
3359
3414
  async function asyncFlatten(array) {
3360
3415
  do
3361
3416
  array = (await Promise.all(array)).flat(Infinity);
@@ -3364,7 +3419,7 @@ async function asyncFlatten(array) {
3364
3419
  }
3365
3420
  var normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean);
3366
3421
  function checkOutputPluginOption(plugins, onLog) {
3367
- for (const plugin of plugins) for (const hook of ENUMERATED_INPUT_PLUGIN_HOOK_NAMES) if (hook in plugin) {
3422
+ for (const plugin of plugins) for (const hook of [...ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, ...INTERNAL_PLUGIN_HOOK_NAMES]) if (hook in plugin) {
3368
3423
  delete plugin[hook];
3369
3424
  onLog(LOG_LEVEL_WARN, logInputHookInOutputPlugin(plugin.name, hook));
3370
3425
  }
@@ -3372,9 +3427,10 @@ function checkOutputPluginOption(plugins, onLog) {
3372
3427
  }
3373
3428
  function normalizePlugins(plugins, anonymousPrefix) {
3374
3429
  for (const [index, plugin] of plugins.entries()) {
3375
- if ("_parallel" in plugin) continue;
3430
+ if (getParallelPluginInfo(plugin)) continue;
3376
3431
  if (plugin instanceof BuiltinPlugin) continue;
3377
- if (!plugin.name) plugin.name = `${anonymousPrefix}${index + 1}`;
3432
+ const objectPlugin = plugin;
3433
+ if (!objectPlugin.name) objectPlugin.name = `${anonymousPrefix}${index + 1}`;
3378
3434
  }
3379
3435
  return plugins;
3380
3436
  }
@@ -3413,7 +3469,7 @@ var PluginDriver = class {
3413
3469
  function getObjectPlugins(plugins) {
3414
3470
  return plugins.filter((plugin) => {
3415
3471
  if (!plugin) return;
3416
- if ("_parallel" in plugin) return;
3472
+ if (getParallelPluginInfo(plugin)) return;
3417
3473
  if (plugin instanceof BuiltinPlugin) return;
3418
3474
  return plugin;
3419
3475
  });
@@ -4686,6 +4742,7 @@ var MinifyOptionsSchema = /* @__PURE__ */ strictObject({
4686
4742
  function: /* @__PURE__ */ boolean(),
4687
4743
  class: /* @__PURE__ */ boolean()
4688
4744
  })])),
4745
+ reserved: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
4689
4746
  debug: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
4690
4747
  })])),
4691
4748
  codegen: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
@@ -4744,6 +4801,7 @@ var DevModeSchema = /* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE
4744
4801
  port: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
4745
4802
  host: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
4746
4803
  implement: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
4804
+ skipCommonRuntimeInjection: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
4747
4805
  lazy: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
4748
4806
  })]);
4749
4807
  var InputOptionsSchema = /* @__PURE__ */ strictObject({
@@ -4893,6 +4951,7 @@ var OutputOptionsSchema = /* @__PURE__ */ strictObject({
4893
4951
  /* @__PURE__ */ literal("hidden")
4894
4952
  ])), /* @__PURE__ */ description(`Generate sourcemap (\`-s inline\` for inline, or \`-s\` for \`.map\` file)`)),
4895
4953
  sourcemapBaseUrl: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Base URL used to prefix sourcemap paths")),
4954
+ sourcemapFileNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(ChunkFileNamesSchema), /* @__PURE__ */ description("Name pattern for emitted sourcemaps")),
4896
4955
  sourcemapDebugIds: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Inject sourcemap debug IDs")),
4897
4956
  sourcemapExcludeSources: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Exclude source content from sourcemaps")),
4898
4957
  sourcemapIgnoreList: /* @__PURE__ */ optional(/* @__PURE__ */ union([
@@ -4944,7 +5003,7 @@ var OutputOptionsSchema = /* @__PURE__ */ strictObject({
4944
5003
  topLevelVar: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Rewrite top-level declarations to use `var`.")),
4945
5004
  cleanDir: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Clean output directory before emitting output")),
4946
5005
  keepNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Keep function and class names after bundling")),
4947
- strictExecutionOrder: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Lets modules be executed in the order they are declared.")),
5006
+ strictExecutionOrder: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Preserve source module execution order across generated chunks.")),
4948
5007
  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."))
4949
5008
  });
4950
5009
  var getAddonDescription = (placement, wrapper) => {
@@ -4966,7 +5025,7 @@ var OutputCliOverrideSchema = /* @__PURE__ */ strictObject({
4966
5025
  codeSplitting: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
4967
5026
  minSize: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum size of the chunk")),
4968
5027
  minShareCount: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum share count of the chunk"))
4969
- })])), /* @__PURE__ */ description("Code splitting options (true, false, or object)")),
5028
+ })])), /* @__PURE__ */ description("Code splitting options. Enabled by default; use `--no-codeSplitting` to disable, or `--codeSplitting.minSize` / `--codeSplitting.minShareCount` to configure")),
4970
5029
  advancedChunks: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
4971
5030
  minSize: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum size of the chunk")),
4972
5031
  minShareCount: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum share count of the chunk"))
@@ -5014,28 +5073,6 @@ function validateOption(key, options) {
5014
5073
  if (errors.length) console.warn(`\x1b[33mWarning: Invalid ${key} options (${errors.length} issue${errors.length === 1 ? "" : "s"} found)\n${errors.join("\n")}\x1b[0m`);
5015
5074
  }
5016
5075
  }
5017
- var RolldownOutputImpl = class extends PlainObjectLike {
5018
- bindingOutputs;
5019
- constructor(bindingOutputs) {
5020
- super();
5021
- this.bindingOutputs = bindingOutputs;
5022
- }
5023
- get output() {
5024
- return transformToRollupOutput(this.bindingOutputs).output;
5025
- }
5026
- __rolldown_external_memory_handle__(keepDataAlive) {
5027
- const results = this.output.map((item) => item.__rolldown_external_memory_handle__(keepDataAlive));
5028
- if (!results.every((r) => r.freed)) {
5029
- const reasons = results.filter((r) => !r.freed).map((r) => r.reason).filter(Boolean);
5030
- return {
5031
- freed: false,
5032
- reason: `Failed to free ${reasons.length} item(s): ${reasons.join("; ")}`
5033
- };
5034
- }
5035
- return { freed: true };
5036
- }
5037
- };
5038
- __decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
5039
5076
  var ChunkingContextImpl = class {
5040
5077
  context;
5041
5078
  pluginContextData;
@@ -5458,10 +5495,11 @@ ${indent}`);
5458
5495
  return causedPrefix + message + "\n" + stack + causedError;
5459
5496
  }
5460
5497
  formatArgs(args, opts) {
5461
- return formatWithOptions(opts, ...args.map((arg) => {
5498
+ const _args = args.map((arg) => {
5462
5499
  if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
5463
5500
  return arg;
5464
- }));
5501
+ });
5502
+ return formatWithOptions(opts, ..._args);
5465
5503
  }
5466
5504
  formatDate(date, opts) {
5467
5505
  return opts.date ? date.toLocaleTimeString() : "";
@@ -5675,13 +5713,15 @@ function box(text, _opts = {}) {
5675
5713
  if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
5676
5714
  return boxLines.join("\n");
5677
5715
  }
5678
- var r = Object.create(null), i = (e) => globalThis.process?.env || {
5716
+ var r = Object.create(null);
5717
+ var i = (e) => globalThis.process?.env || {
5679
5718
  "BASE_URL": "/",
5680
5719
  "DEV": false,
5681
5720
  "MODE": "production",
5682
5721
  "PROD": true,
5683
5722
  "SSR": false
5684
- }, o = new Proxy(r, {
5723
+ };
5724
+ var o = new Proxy(r, {
5685
5725
  get(e, s) {
5686
5726
  return i()[s] ?? r[s];
5687
5727
  },
@@ -5701,7 +5741,9 @@ var r = Object.create(null), i = (e) => globalThis.process?.env || {
5701
5741
  const e = i(true);
5702
5742
  return Object.keys(e);
5703
5743
  }
5704
- }), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
5744
+ });
5745
+ var t = typeof process < "u" && process.env && process.env.NODE_ENV || "";
5746
+ var f = [
5705
5747
  ["APPVEYOR"],
5706
5748
  [
5707
5749
  "AWS_AMPLIFY",
@@ -5813,19 +5855,31 @@ l.name;
5813
5855
  function n(e) {
5814
5856
  return e ? e !== "false" : false;
5815
5857
  }
5816
- 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);
5858
+ var I = globalThis.process?.platform || "";
5859
+ var T = n(o.CI) || l.ci !== false;
5860
+ var a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY);
5861
+ var g = n(o.DEBUG);
5862
+ var R = t === "test" || n(o.TEST);
5817
5863
  o.MINIMAL;
5818
5864
  var A = /^win/i.test(I);
5819
5865
  !n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM);
5820
5866
  var C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
5821
5867
  Number(C?.split(".")[0]);
5822
- var y = globalThis.process || Object.create(null), _ = { versions: {} };
5868
+ var y = globalThis.process || Object.create(null);
5869
+ var _ = { versions: {} };
5823
5870
  new Proxy(y, { get(e, s) {
5824
5871
  if (s === "env") return o;
5825
5872
  if (s in e) return e[s];
5826
5873
  if (s in _) return _[s];
5827
5874
  } });
5828
- 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 = [
5875
+ var c = globalThis.process?.release?.name === "node";
5876
+ var O = !!globalThis.Bun || !!globalThis.process?.versions?.bun;
5877
+ var D = !!globalThis.Deno;
5878
+ var L = !!globalThis.fastly;
5879
+ var S = !!globalThis.Netlify;
5880
+ var u = !!globalThis.EdgeRuntime;
5881
+ var N = globalThis.navigator?.userAgent === "Cloudflare-Workers";
5882
+ var F = [
5829
5883
  [S, "netlify"],
5830
5884
  [u, "edge-light"],
5831
5885
  [N, "workerd"],
@@ -5983,7 +6037,7 @@ function createConsola(options = {}) {
5983
6037
  defaults: { level },
5984
6038
  stdout: process.stdout,
5985
6039
  stderr: process.stderr,
5986
- prompt: (...args) => import("./prompt-B1Yc1NPt.mjs").then((m) => m.prompt(...args)),
6040
+ prompt: (...args) => import("./prompt-CH6TK0bC.mjs").then((m) => m.prompt(...args)),
5987
6041
  reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
5988
6042
  ...options
5989
6043
  });
@@ -6020,7 +6074,7 @@ function createTestingLogger() {
6020
6074
  return ret;
6021
6075
  }
6022
6076
  function bindingifyOutputOptions(outputOptions, pluginContextData) {
6023
- 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;
6077
+ 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;
6024
6078
  if (legalComments != null) logger.warn("`legalComments` option is deprecated, please use `comments.legal` instead.");
6025
6079
  const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks, pluginContextData);
6026
6080
  return {
@@ -6032,6 +6086,7 @@ function bindingifyOutputOptions(outputOptions, pluginContextData) {
6032
6086
  sourcemap: bindingifySourcemap(sourcemap),
6033
6087
  sourcemapBaseUrl,
6034
6088
  sourcemapDebugIds,
6089
+ sourcemapFileNames,
6035
6090
  sourcemapExcludeSources,
6036
6091
  sourcemapIgnoreList: sourcemapIgnoreList ?? /node_modules/,
6037
6092
  sourcemapPathTransform,
@@ -6172,19 +6227,23 @@ function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, adva
6172
6227
  advancedChunks: advancedChunksResult
6173
6228
  };
6174
6229
  }
6230
+ var import_binding$3 = /* @__PURE__ */ __toESM(require_binding(), 1);
6175
6231
  async function initializeParallelPlugins(plugins) {
6176
6232
  const pluginInfos = [];
6177
- for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
6178
- const { fileUrl, options } = plugin._parallel;
6179
- pluginInfos.push({
6180
- index,
6181
- fileUrl,
6182
- options
6183
- });
6233
+ for (const [index, plugin] of plugins.entries()) {
6234
+ const parallel = getParallelPluginInfo(plugin);
6235
+ if (parallel) {
6236
+ const { fileUrl, options } = parallel;
6237
+ pluginInfos.push({
6238
+ index,
6239
+ fileUrl,
6240
+ options
6241
+ });
6242
+ }
6184
6243
  }
6185
6244
  if (pluginInfos.length <= 0) return;
6186
6245
  const count = availableParallelism();
6187
- const parallelJsPluginRegistry = new import_binding$2.ParallelJsPluginRegistry(count);
6246
+ const parallelJsPluginRegistry = new import_binding$3.ParallelJsPluginRegistry(count);
6188
6247
  const registryId = parallelJsPluginRegistry.id;
6189
6248
  const workers = await initializeWorkers(registryId, count, pluginInfos);
6190
6249
  const stopWorkers = async () => {
@@ -6260,113 +6319,8 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
6260
6319
  throw e;
6261
6320
  }
6262
6321
  }
6263
- Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
6264
- /**
6265
- * The bundle object returned by {@linkcode rolldown} function.
6266
- *
6267
- * @category Programmatic APIs
6268
- */
6269
- var RolldownBuild = class RolldownBuild {
6270
- #inputOptions;
6271
- #bundler;
6272
- #stopWorkers;
6273
- /** @internal */
6274
- static asyncRuntimeShutdown = false;
6275
- /** @hidden should not be used directly */
6276
- constructor(inputOptions) {
6277
- this.#inputOptions = inputOptions;
6278
- this.#bundler = new import_binding$2.BindingBundler();
6279
- }
6280
- /**
6281
- * Whether the bundle has been closed.
6282
- *
6283
- * If the bundle is closed, calling other methods will throw an error.
6284
- */
6285
- get closed() {
6286
- return this.#bundler.closed;
6287
- }
6288
- /**
6289
- * Generate bundles in-memory.
6290
- *
6291
- * If you directly want to write bundles to disk, use the {@linkcode write} method instead.
6292
- *
6293
- * @param outputOptions The output options.
6294
- * @returns The generated bundle.
6295
- * @throws {@linkcode BundleError} When an error occurs during the build.
6296
- */
6297
- async generate(outputOptions = {}) {
6298
- return this.#build(false, outputOptions);
6299
- }
6300
- /**
6301
- * Generate and write bundles to disk.
6302
- *
6303
- * If you want to generate bundles in-memory, use the {@linkcode generate} method instead.
6304
- *
6305
- * @param outputOptions The output options.
6306
- * @returns The generated bundle.
6307
- * @throws {@linkcode BundleError} When an error occurs during the build.
6308
- */
6309
- async write(outputOptions = {}) {
6310
- return this.#build(true, outputOptions);
6311
- }
6312
- /**
6313
- * Close the bundle and free resources.
6314
- *
6315
- * This method should be called even if the {@linkcode generate} method
6316
- * or the {@linkcode write} method threw an error. It should be called
6317
- * even if neither of the methods are called.
6318
- *
6319
- * This method is called automatically when using `using` syntax.
6320
- *
6321
- * @example
6322
- * ```js
6323
- * import { rolldown } from 'rolldown';
6324
- *
6325
- * {
6326
- * using bundle = await rolldown({ input: 'src/main.js' });
6327
- * const output = await bundle.generate({ format: 'esm' });
6328
- * console.log(output);
6329
- * // bundle.close() is called automatically here
6330
- * }
6331
- * ```
6332
- */
6333
- async close() {
6334
- await this.#stopWorkers?.();
6335
- await this.#bundler.close();
6336
- (0, import_binding$2.shutdownAsyncRuntime)();
6337
- RolldownBuild.asyncRuntimeShutdown = true;
6338
- this.#stopWorkers = void 0;
6339
- }
6340
- /** @hidden documented in close method */
6341
- async [Symbol.asyncDispose]() {
6342
- await this.close();
6343
- }
6344
- /**
6345
- * @experimental
6346
- * @hidden not ready for public usage yet
6347
- */
6348
- get watchFiles() {
6349
- return Promise.resolve(this.#bundler.getWatchFiles());
6350
- }
6351
- async #build(isWrite, outputOptions) {
6352
- validateOption("output", outputOptions);
6353
- await this.#stopWorkers?.();
6354
- const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
6355
- if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding$2.startAsyncRuntime)();
6356
- try {
6357
- this.#stopWorkers = option.stopWorkers;
6358
- let output;
6359
- if (isWrite) output = await this.#bundler.write(option.bundlerOptions);
6360
- else output = await this.#bundler.generate(option.bundlerOptions);
6361
- return new RolldownOutputImpl(unwrapBindingResult(output));
6362
- } catch (e) {
6363
- await option.stopWorkers?.();
6364
- throw e;
6365
- }
6366
- }
6367
- };
6368
6322
  //#endregion
6369
- //#region ../../node_modules/rolldown/dist/shared/watch-FrHSqg24.mjs
6323
+ //#region ../../node_modules/rolldown/dist/shared/watch-Cwq-cFUy.mjs
6370
6324
  /**
6371
6325
  * This is not the set of all possible signals.
6372
6326
  *
@@ -6573,7 +6527,138 @@ function onExit(...args) {
6573
6527
  }
6574
6528
  require_binding();
6575
6529
  //#endregion
6576
- //#region ../../node_modules/rolldown/dist/shared/rolldown-Brph2NSU.mjs
6530
+ //#region ../../node_modules/rolldown/dist/shared/rolldown-DP_p9pd3.mjs
6531
+ var import_binding$1 = /* @__PURE__ */ __toESM(require_binding(), 1);
6532
+ var RolldownOutputImpl = class extends PlainObjectLike {
6533
+ bindingOutputs;
6534
+ constructor(bindingOutputs) {
6535
+ super();
6536
+ this.bindingOutputs = bindingOutputs;
6537
+ }
6538
+ get output() {
6539
+ return transformToRollupOutput(this.bindingOutputs).output;
6540
+ }
6541
+ __rolldown_external_memory_handle__(keepDataAlive) {
6542
+ const results = this.output.map((item) => item.__rolldown_external_memory_handle__(keepDataAlive));
6543
+ if (!results.every((r) => r.freed)) {
6544
+ const reasons = results.filter((r) => !r.freed).map((r) => r.reason).filter(Boolean);
6545
+ return {
6546
+ freed: false,
6547
+ reason: `Failed to free ${reasons.length} item(s): ${reasons.join("; ")}`
6548
+ };
6549
+ }
6550
+ return { freed: true };
6551
+ }
6552
+ };
6553
+ __decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
6554
+ Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
6555
+ /**
6556
+ * The bundle object returned by {@linkcode rolldown} function.
6557
+ *
6558
+ * @category Programmatic APIs
6559
+ */
6560
+ var RolldownBuild = class {
6561
+ #inputOptions;
6562
+ #bundler;
6563
+ #stopWorkers;
6564
+ #asyncRuntimeReleased = false;
6565
+ /** @hidden should not be used directly */
6566
+ constructor(inputOptions) {
6567
+ this.#inputOptions = inputOptions;
6568
+ this.#bundler = new import_binding$1.BindingBundler();
6569
+ (0, import_binding$1.startAsyncRuntime)();
6570
+ }
6571
+ /**
6572
+ * Whether the bundle has been closed.
6573
+ *
6574
+ * If the bundle is closed, calling other methods will throw an error.
6575
+ */
6576
+ get closed() {
6577
+ return this.#bundler.closed;
6578
+ }
6579
+ /**
6580
+ * Generate bundles in-memory.
6581
+ *
6582
+ * If you directly want to write bundles to disk, use the {@linkcode write} method instead.
6583
+ *
6584
+ * @param outputOptions The output options.
6585
+ * @returns The generated bundle.
6586
+ * @throws {@linkcode BundleError} When an error occurs during the build.
6587
+ */
6588
+ async generate(outputOptions = {}) {
6589
+ return this.#build(false, outputOptions);
6590
+ }
6591
+ /**
6592
+ * Generate and write bundles to disk.
6593
+ *
6594
+ * If you want to generate bundles in-memory, use the {@linkcode generate} method instead.
6595
+ *
6596
+ * @param outputOptions The output options.
6597
+ * @returns The generated bundle.
6598
+ * @throws {@linkcode BundleError} When an error occurs during the build.
6599
+ */
6600
+ async write(outputOptions = {}) {
6601
+ return this.#build(true, outputOptions);
6602
+ }
6603
+ /**
6604
+ * Close the bundle and free resources.
6605
+ *
6606
+ * This method should be called even if the {@linkcode generate} method
6607
+ * or the {@linkcode write} method threw an error. It should be called
6608
+ * even if neither of the methods are called.
6609
+ *
6610
+ * This method is called automatically when using `using` syntax.
6611
+ *
6612
+ * @example
6613
+ * ```js
6614
+ * import { rolldown } from 'rolldown';
6615
+ *
6616
+ * {
6617
+ * using bundle = await rolldown({ input: 'src/main.js' });
6618
+ * const output = await bundle.generate({ format: 'esm' });
6619
+ * console.log(output);
6620
+ * // bundle.close() is called automatically here
6621
+ * }
6622
+ * ```
6623
+ */
6624
+ async close() {
6625
+ const shouldRelease = !this.#asyncRuntimeReleased;
6626
+ this.#asyncRuntimeReleased = true;
6627
+ try {
6628
+ await this.#stopWorkers?.();
6629
+ await this.#bundler.close();
6630
+ this.#stopWorkers = void 0;
6631
+ } finally {
6632
+ if (shouldRelease) (0, import_binding$1.shutdownAsyncRuntime)();
6633
+ }
6634
+ }
6635
+ /** @hidden documented in close method */
6636
+ async [Symbol.asyncDispose]() {
6637
+ await this.close();
6638
+ }
6639
+ /**
6640
+ * @experimental
6641
+ * @hidden not ready for public usage yet
6642
+ */
6643
+ get watchFiles() {
6644
+ return Promise.resolve(this.#bundler.getWatchFiles());
6645
+ }
6646
+ async #build(isWrite, outputOptions) {
6647
+ validateOption("output", outputOptions);
6648
+ await this.#stopWorkers?.();
6649
+ const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
6650
+ try {
6651
+ this.#stopWorkers = option.stopWorkers;
6652
+ let output;
6653
+ if (isWrite) output = await this.#bundler.write(option.bundlerOptions);
6654
+ else output = await this.#bundler.generate(option.bundlerOptions);
6655
+ return new RolldownOutputImpl(unwrapBindingResult(output));
6656
+ } catch (e) {
6657
+ await option.stopWorkers?.();
6658
+ throw e;
6659
+ }
6660
+ }
6661
+ };
6577
6662
  /**
6578
6663
  * The API compatible with Rollup's `rollup` function.
6579
6664
  *