@coderline/alphatab-vite 1.9.0-alpha.1883 → 1.9.0-alpha.1962
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.
- package/dist/AlphaTabVitePluginOptions.cjs +1 -1
- package/dist/AlphaTabVitePluginOptions.mjs +1 -1
- package/dist/alphaTab.vite.cjs +1 -1
- package/dist/alphaTab.vite.mjs +1 -1
- package/dist/alphaTabVitePlugin.cjs +1 -1
- package/dist/alphaTabVitePlugin.mjs +1 -1
- package/dist/bridge/asset.cjs +1 -1
- package/dist/bridge/asset.mjs +1 -1
- package/dist/bridge/build.cjs +1 -1
- package/dist/bridge/build.mjs +1 -1
- package/dist/bridge/bundler.cjs +1 -1
- package/dist/bridge/bundler.mjs +1 -1
- package/dist/bridge/config.cjs +1 -1
- package/dist/bridge/config.mjs +1 -1
- package/dist/bridge/constants.cjs +1 -1
- package/dist/bridge/constants.mjs +1 -1
- package/dist/bridge/fsUtils.cjs +1 -1
- package/dist/bridge/fsUtils.mjs +1 -1
- package/dist/bridge/index.cjs +1 -1
- package/dist/bridge/index.mjs +1 -1
- package/dist/bridge/optimizer.cjs +1 -1
- package/dist/bridge/optimizer.mjs +1 -1
- package/dist/bridge/plugins.cjs +1 -1
- package/dist/bridge/plugins.mjs +1 -1
- package/dist/bridge/resolve.cjs +1 -1
- package/dist/bridge/resolve.mjs +1 -1
- package/dist/bridge/typeUtils.cjs +1 -1
- package/dist/bridge/typeUtils.mjs +1 -1
- package/dist/bridge/utils.cjs +1 -1
- package/dist/bridge/utils.mjs +1 -1
- package/dist/bridge/worker.cjs +1 -1
- package/dist/bridge/worker.mjs +1 -1
- package/dist/copyAssetsPlugin.cjs +1 -1
- package/dist/copyAssetsPlugin.mjs +1 -1
- package/dist/detectionGlobalPlugin.cjs +1 -1
- package/dist/detectionGlobalPlugin.mjs +1 -1
- package/dist/dist.cjs +707 -397
- package/dist/dist.mjs +707 -397
- package/dist/importMetaPlugin.cjs +1 -1
- package/dist/importMetaPlugin.mjs +1 -1
- package/dist/prompt-CH6TK0bC.cjs +1 -1
- package/dist/prompt-CH6TK0bC.mjs +1 -1
- package/dist/rolldown-runtime.cjs +1 -1
- package/dist/workerPlugin.cjs +1 -1
- package/dist/workerPlugin.mjs +1 -1
- package/package.json +10 -10
package/dist/dist.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* alphaTab Vite Plugin v1.9.0-alpha.
|
|
2
|
+
* alphaTab Vite Plugin v1.9.0-alpha.1962 (develop, build 1962)
|
|
3
3
|
*
|
|
4
4
|
* Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
5
|
*
|
|
@@ -50,7 +50,7 @@ let node_tty = require("node:tty");
|
|
|
50
50
|
node_tty = require_rolldown_runtime.__toESM(node_tty, 1);
|
|
51
51
|
let node_os = require("node:os");
|
|
52
52
|
node_os = require_rolldown_runtime.__toESM(node_os, 1);
|
|
53
|
-
//#region ../../node_modules/rolldown/dist/shared/binding-
|
|
53
|
+
//#region ../../node_modules/rolldown/dist/shared/binding-DH95uVkp.mjs
|
|
54
54
|
var __create = Object.create;
|
|
55
55
|
var __defProp = Object.defineProperty;
|
|
56
56
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -141,94 +141,97 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
141
141
|
} catch (err) {
|
|
142
142
|
loadErrors.push(err);
|
|
143
143
|
}
|
|
144
|
-
else if (process.platform === "android")
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
144
|
+
else if (process.platform === "android") {
|
|
145
|
+
if (process.arch === "arm64") {
|
|
146
|
+
try {
|
|
147
|
+
return __require("./rolldown-binding.android-arm64.node");
|
|
148
|
+
} catch (e) {
|
|
149
|
+
loadErrors.push(e);
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
const binding = __require("@rolldown/binding-android-arm64");
|
|
153
|
+
const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
|
|
154
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
155
|
+
return binding;
|
|
156
|
+
} catch (e) {
|
|
157
|
+
loadErrors.push(e);
|
|
158
|
+
}
|
|
159
|
+
} else if (process.arch === "arm") {
|
|
160
|
+
try {
|
|
161
|
+
return __require("./rolldown-binding.android-arm-eabi.node");
|
|
162
|
+
} catch (e) {
|
|
163
|
+
loadErrors.push(e);
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
const binding = __require("@rolldown/binding-android-arm-eabi");
|
|
167
|
+
const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
|
|
168
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
169
|
+
return binding;
|
|
170
|
+
} catch (e) {
|
|
171
|
+
loadErrors.push(e);
|
|
172
|
+
}
|
|
173
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
174
|
+
} else if (process.platform === "win32") {
|
|
175
|
+
if (process.arch === "x64") {
|
|
176
|
+
if (process.config && process.config.variables && process.config.variables.shlib_suffix === "dll.a" || process.config && process.config.variables && process.config.variables.node_target_type === "shared_library") {
|
|
177
|
+
try {
|
|
178
|
+
return __require("./rolldown-binding.win32-x64-gnu.node");
|
|
179
|
+
} catch (e) {
|
|
180
|
+
loadErrors.push(e);
|
|
181
|
+
}
|
|
182
|
+
try {
|
|
183
|
+
const binding = __require("@rolldown/binding-win32-x64-gnu");
|
|
184
|
+
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
|
|
185
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
186
|
+
return binding;
|
|
187
|
+
} catch (e) {
|
|
188
|
+
loadErrors.push(e);
|
|
189
|
+
}
|
|
190
|
+
} else {
|
|
191
|
+
try {
|
|
192
|
+
return __require("./rolldown-binding.win32-x64-msvc.node");
|
|
193
|
+
} catch (e) {
|
|
194
|
+
loadErrors.push(e);
|
|
195
|
+
}
|
|
196
|
+
try {
|
|
197
|
+
const binding = __require("@rolldown/binding-win32-x64-msvc");
|
|
198
|
+
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
|
|
199
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
200
|
+
return binding;
|
|
201
|
+
} catch (e) {
|
|
202
|
+
loadErrors.push(e);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
} else if (process.arch === "ia32") {
|
|
206
|
+
try {
|
|
207
|
+
return __require("./rolldown-binding.win32-ia32-msvc.node");
|
|
208
|
+
} catch (e) {
|
|
209
|
+
loadErrors.push(e);
|
|
210
|
+
}
|
|
211
|
+
try {
|
|
212
|
+
const binding = __require("@rolldown/binding-win32-ia32-msvc");
|
|
213
|
+
const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
|
|
214
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
215
|
+
return binding;
|
|
216
|
+
} catch (e) {
|
|
217
|
+
loadErrors.push(e);
|
|
218
|
+
}
|
|
219
|
+
} else if (process.arch === "arm64") {
|
|
220
|
+
try {
|
|
221
|
+
return __require("./rolldown-binding.win32-arm64-msvc.node");
|
|
222
|
+
} catch (e) {
|
|
223
|
+
loadErrors.push(e);
|
|
224
|
+
}
|
|
225
|
+
try {
|
|
226
|
+
const binding = __require("@rolldown/binding-win32-arm64-msvc");
|
|
227
|
+
const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
|
|
228
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
229
|
+
return binding;
|
|
230
|
+
} catch (e) {
|
|
231
|
+
loadErrors.push(e);
|
|
232
|
+
}
|
|
233
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
234
|
+
} else if (process.platform === "darwin") {
|
|
232
235
|
try {
|
|
233
236
|
return __require("./rolldown-binding.darwin-universal.node");
|
|
234
237
|
} catch (e) {
|
|
@@ -237,7 +240,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
237
240
|
try {
|
|
238
241
|
const binding = __require("@rolldown/binding-darwin-universal");
|
|
239
242
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
|
|
240
|
-
if (bindingPackageVersion !== "1.2.
|
|
243
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
241
244
|
return binding;
|
|
242
245
|
} catch (e) {
|
|
243
246
|
loadErrors.push(e);
|
|
@@ -251,7 +254,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
251
254
|
try {
|
|
252
255
|
const binding = __require("@rolldown/binding-darwin-x64");
|
|
253
256
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
|
|
254
|
-
if (bindingPackageVersion !== "1.2.
|
|
257
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
255
258
|
return binding;
|
|
256
259
|
} catch (e) {
|
|
257
260
|
loadErrors.push(e);
|
|
@@ -265,259 +268,267 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
265
268
|
try {
|
|
266
269
|
const binding = __require("@rolldown/binding-darwin-arm64");
|
|
267
270
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
|
|
268
|
-
if (bindingPackageVersion !== "1.2.
|
|
271
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
269
272
|
return binding;
|
|
270
273
|
} catch (e) {
|
|
271
274
|
loadErrors.push(e);
|
|
272
275
|
}
|
|
273
276
|
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
274
|
-
} else if (process.platform === "freebsd")
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
277
|
+
} else if (process.platform === "freebsd") {
|
|
278
|
+
if (process.arch === "x64") {
|
|
279
|
+
try {
|
|
280
|
+
return __require("./rolldown-binding.freebsd-x64.node");
|
|
281
|
+
} catch (e) {
|
|
282
|
+
loadErrors.push(e);
|
|
283
|
+
}
|
|
284
|
+
try {
|
|
285
|
+
const binding = __require("@rolldown/binding-freebsd-x64");
|
|
286
|
+
const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
|
|
287
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
288
|
+
return binding;
|
|
289
|
+
} catch (e) {
|
|
290
|
+
loadErrors.push(e);
|
|
291
|
+
}
|
|
292
|
+
} else if (process.arch === "arm64") {
|
|
293
|
+
try {
|
|
294
|
+
return __require("./rolldown-binding.freebsd-arm64.node");
|
|
295
|
+
} catch (e) {
|
|
296
|
+
loadErrors.push(e);
|
|
297
|
+
}
|
|
298
|
+
try {
|
|
299
|
+
const binding = __require("@rolldown/binding-freebsd-arm64");
|
|
300
|
+
const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
|
|
301
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
302
|
+
return binding;
|
|
303
|
+
} catch (e) {
|
|
304
|
+
loadErrors.push(e);
|
|
305
|
+
}
|
|
306
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
307
|
+
} else if (process.platform === "linux") {
|
|
308
|
+
if (process.arch === "x64") {
|
|
309
|
+
if (isMusl()) {
|
|
310
|
+
try {
|
|
311
|
+
return __require("./rolldown-binding.linux-x64-musl.node");
|
|
312
|
+
} catch (e) {
|
|
313
|
+
loadErrors.push(e);
|
|
314
|
+
}
|
|
315
|
+
try {
|
|
316
|
+
const binding = __require("@rolldown/binding-linux-x64-musl");
|
|
317
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
|
|
318
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
319
|
+
return binding;
|
|
320
|
+
} catch (e) {
|
|
321
|
+
loadErrors.push(e);
|
|
322
|
+
}
|
|
323
|
+
} else {
|
|
324
|
+
try {
|
|
325
|
+
return __require("../rolldown-binding.linux-x64-gnu.node");
|
|
326
|
+
} catch (e) {
|
|
327
|
+
loadErrors.push(e);
|
|
328
|
+
}
|
|
329
|
+
try {
|
|
330
|
+
const binding = __require("@rolldown/binding-linux-x64-gnu");
|
|
331
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
|
|
332
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
333
|
+
return binding;
|
|
334
|
+
} catch (e) {
|
|
335
|
+
loadErrors.push(e);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
} else if (process.arch === "arm64") {
|
|
339
|
+
if (isMusl()) {
|
|
340
|
+
try {
|
|
341
|
+
return __require("./rolldown-binding.linux-arm64-musl.node");
|
|
342
|
+
} catch (e) {
|
|
343
|
+
loadErrors.push(e);
|
|
344
|
+
}
|
|
345
|
+
try {
|
|
346
|
+
const binding = __require("@rolldown/binding-linux-arm64-musl");
|
|
347
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
|
|
348
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
349
|
+
return binding;
|
|
350
|
+
} catch (e) {
|
|
351
|
+
loadErrors.push(e);
|
|
352
|
+
}
|
|
353
|
+
} else {
|
|
354
|
+
try {
|
|
355
|
+
return __require("./rolldown-binding.linux-arm64-gnu.node");
|
|
356
|
+
} catch (e) {
|
|
357
|
+
loadErrors.push(e);
|
|
358
|
+
}
|
|
359
|
+
try {
|
|
360
|
+
const binding = __require("@rolldown/binding-linux-arm64-gnu");
|
|
361
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
|
|
362
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
363
|
+
return binding;
|
|
364
|
+
} catch (e) {
|
|
365
|
+
loadErrors.push(e);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
} else if (process.arch === "arm") {
|
|
369
|
+
if (isMusl()) {
|
|
370
|
+
try {
|
|
371
|
+
return __require("./rolldown-binding.linux-arm-musleabihf.node");
|
|
372
|
+
} catch (e) {
|
|
373
|
+
loadErrors.push(e);
|
|
374
|
+
}
|
|
375
|
+
try {
|
|
376
|
+
const binding = __require("@rolldown/binding-linux-arm-musleabihf");
|
|
377
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
|
|
378
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
379
|
+
return binding;
|
|
380
|
+
} catch (e) {
|
|
381
|
+
loadErrors.push(e);
|
|
382
|
+
}
|
|
383
|
+
} else {
|
|
384
|
+
try {
|
|
385
|
+
return __require("./rolldown-binding.linux-arm-gnueabihf.node");
|
|
386
|
+
} catch (e) {
|
|
387
|
+
loadErrors.push(e);
|
|
388
|
+
}
|
|
389
|
+
try {
|
|
390
|
+
const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
|
|
391
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
|
|
392
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
393
|
+
return binding;
|
|
394
|
+
} catch (e) {
|
|
395
|
+
loadErrors.push(e);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
} else if (process.arch === "loong64") {
|
|
399
|
+
if (isMusl()) {
|
|
400
|
+
try {
|
|
401
|
+
return __require("./rolldown-binding.linux-loong64-musl.node");
|
|
402
|
+
} catch (e) {
|
|
403
|
+
loadErrors.push(e);
|
|
404
|
+
}
|
|
405
|
+
try {
|
|
406
|
+
const binding = __require("@rolldown/binding-linux-loong64-musl");
|
|
407
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
|
|
408
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
409
|
+
return binding;
|
|
410
|
+
} catch (e) {
|
|
411
|
+
loadErrors.push(e);
|
|
412
|
+
}
|
|
413
|
+
} else {
|
|
414
|
+
try {
|
|
415
|
+
return __require("./rolldown-binding.linux-loong64-gnu.node");
|
|
416
|
+
} catch (e) {
|
|
417
|
+
loadErrors.push(e);
|
|
418
|
+
}
|
|
419
|
+
try {
|
|
420
|
+
const binding = __require("@rolldown/binding-linux-loong64-gnu");
|
|
421
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
|
|
422
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
423
|
+
return binding;
|
|
424
|
+
} catch (e) {
|
|
425
|
+
loadErrors.push(e);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
} else if (process.arch === "riscv64") {
|
|
429
|
+
if (isMusl()) {
|
|
430
|
+
try {
|
|
431
|
+
return __require("./rolldown-binding.linux-riscv64-musl.node");
|
|
432
|
+
} catch (e) {
|
|
433
|
+
loadErrors.push(e);
|
|
434
|
+
}
|
|
435
|
+
try {
|
|
436
|
+
const binding = __require("@rolldown/binding-linux-riscv64-musl");
|
|
437
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
|
|
438
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
439
|
+
return binding;
|
|
440
|
+
} catch (e) {
|
|
441
|
+
loadErrors.push(e);
|
|
442
|
+
}
|
|
443
|
+
} else {
|
|
444
|
+
try {
|
|
445
|
+
return __require("./rolldown-binding.linux-riscv64-gnu.node");
|
|
446
|
+
} catch (e) {
|
|
447
|
+
loadErrors.push(e);
|
|
448
|
+
}
|
|
449
|
+
try {
|
|
450
|
+
const binding = __require("@rolldown/binding-linux-riscv64-gnu");
|
|
451
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
|
|
452
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
453
|
+
return binding;
|
|
454
|
+
} catch (e) {
|
|
455
|
+
loadErrors.push(e);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
} else if (process.arch === "ppc64") {
|
|
459
|
+
try {
|
|
460
|
+
return __require("./rolldown-binding.linux-ppc64-gnu.node");
|
|
461
|
+
} catch (e) {
|
|
462
|
+
loadErrors.push(e);
|
|
463
|
+
}
|
|
464
|
+
try {
|
|
465
|
+
const binding = __require("@rolldown/binding-linux-ppc64-gnu");
|
|
466
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
|
|
467
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
468
|
+
return binding;
|
|
469
|
+
} catch (e) {
|
|
470
|
+
loadErrors.push(e);
|
|
471
|
+
}
|
|
472
|
+
} else if (process.arch === "s390x") {
|
|
473
|
+
try {
|
|
474
|
+
return __require("./rolldown-binding.linux-s390x-gnu.node");
|
|
475
|
+
} catch (e) {
|
|
476
|
+
loadErrors.push(e);
|
|
477
|
+
}
|
|
478
|
+
try {
|
|
479
|
+
const binding = __require("@rolldown/binding-linux-s390x-gnu");
|
|
480
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
|
|
481
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
482
|
+
return binding;
|
|
483
|
+
} catch (e) {
|
|
484
|
+
loadErrors.push(e);
|
|
485
|
+
}
|
|
486
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
487
|
+
} else if (process.platform === "openharmony") {
|
|
488
|
+
if (process.arch === "arm64") {
|
|
489
|
+
try {
|
|
490
|
+
return __require("./rolldown-binding.openharmony-arm64.node");
|
|
491
|
+
} catch (e) {
|
|
492
|
+
loadErrors.push(e);
|
|
493
|
+
}
|
|
494
|
+
try {
|
|
495
|
+
const binding = __require("@rolldown/binding-openharmony-arm64");
|
|
496
|
+
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
|
|
497
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
498
|
+
return binding;
|
|
499
|
+
} catch (e) {
|
|
500
|
+
loadErrors.push(e);
|
|
501
|
+
}
|
|
502
|
+
} else if (process.arch === "x64") {
|
|
503
|
+
try {
|
|
504
|
+
return __require("./rolldown-binding.openharmony-x64.node");
|
|
505
|
+
} catch (e) {
|
|
506
|
+
loadErrors.push(e);
|
|
507
|
+
}
|
|
508
|
+
try {
|
|
509
|
+
const binding = __require("@rolldown/binding-openharmony-x64");
|
|
510
|
+
const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
|
|
511
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
512
|
+
return binding;
|
|
513
|
+
} catch (e) {
|
|
514
|
+
loadErrors.push(e);
|
|
515
|
+
}
|
|
516
|
+
} else if (process.arch === "arm") {
|
|
517
|
+
try {
|
|
518
|
+
return __require("./rolldown-binding.openharmony-arm.node");
|
|
519
|
+
} catch (e) {
|
|
520
|
+
loadErrors.push(e);
|
|
521
|
+
}
|
|
522
|
+
try {
|
|
523
|
+
const binding = __require("@rolldown/binding-openharmony-arm");
|
|
524
|
+
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
|
|
525
|
+
if (bindingPackageVersion !== "1.2.8" && 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.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
526
|
+
return binding;
|
|
527
|
+
} catch (e) {
|
|
528
|
+
loadErrors.push(e);
|
|
529
|
+
}
|
|
530
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
531
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
521
532
|
}
|
|
522
533
|
function createLoadErrorChain(errors) {
|
|
523
534
|
return errors.reduce((previous, current) => {
|
|
@@ -601,7 +612,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
601
612
|
if (!candidateFailed) {
|
|
602
613
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
|
|
603
614
|
const bindingPackageVersion = __require("@rolldown/binding-wasm32-wasi/package.json").version;
|
|
604
|
-
if (bindingPackageVersion !== "1.2.
|
|
615
|
+
if (bindingPackageVersion !== "1.2.8") throw new Error(`WASI binding package version mismatch, expected 1.2.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
605
616
|
}
|
|
606
617
|
wasiBinding = __require("@rolldown/binding-wasm32-wasi");
|
|
607
618
|
nativeBinding = wasiBinding;
|
|
@@ -699,8 +710,10 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
699
710
|
module.exports.enhancedTransform = nativeBinding.enhancedTransform;
|
|
700
711
|
module.exports.enhancedTransformSync = nativeBinding.enhancedTransformSync;
|
|
701
712
|
module.exports.FilterTokenKind = nativeBinding.FilterTokenKind;
|
|
713
|
+
module.exports.getNativeMemoryStats = nativeBinding.getNativeMemoryStats;
|
|
702
714
|
module.exports.initTraceSubscriber = nativeBinding.initTraceSubscriber;
|
|
703
715
|
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
|
716
|
+
module.exports.resetNativeMemoryStats = nativeBinding.resetNativeMemoryStats;
|
|
704
717
|
module.exports.resolveTsconfig = nativeBinding.resolveTsconfig;
|
|
705
718
|
module.exports.shutdownAsyncRuntime = nativeBinding.shutdownAsyncRuntime;
|
|
706
719
|
module.exports.startAsyncRuntime = nativeBinding.startAsyncRuntime;
|
|
@@ -948,7 +961,7 @@ function isPathFragment(name) {
|
|
|
948
961
|
return name[0] === "/" || name[0] === "." && (name[1] === "/" || name[1] === ".") || ABSOLUTE_PATH_REGEX.test(name);
|
|
949
962
|
}
|
|
950
963
|
//#endregion
|
|
951
|
-
//#region ../../node_modules/rolldown/dist/shared/error-
|
|
964
|
+
//#region ../../node_modules/rolldown/dist/shared/error-CRNyaqoL.mjs
|
|
952
965
|
function bindingifySourcemap$1(map) {
|
|
953
966
|
if (map == null) return;
|
|
954
967
|
return { inner: typeof map === "string" ? map : {
|
|
@@ -1027,7 +1040,7 @@ function joinNewLine(s1, s2) {
|
|
|
1027
1040
|
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
|
1028
1041
|
}
|
|
1029
1042
|
//#endregion
|
|
1030
|
-
//#region ../../node_modules/rolldown/dist/shared/parse-
|
|
1043
|
+
//#region ../../node_modules/rolldown/dist/shared/parse-BtiCBYra.mjs
|
|
1031
1044
|
var import_binding$5 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
1032
1045
|
function wrap$1(result) {
|
|
1033
1046
|
let program, module, comments, errors;
|
|
@@ -1210,7 +1223,7 @@ function exclude(expr) {
|
|
|
1210
1223
|
*
|
|
1211
1224
|
* @category Plugin APIs
|
|
1212
1225
|
*/
|
|
1213
|
-
var VERSION = "1.2.
|
|
1226
|
+
var VERSION = "1.2.8";
|
|
1214
1227
|
var LOG_LEVEL_SILENT = "silent";
|
|
1215
1228
|
var LOG_LEVEL_WARN = "warn";
|
|
1216
1229
|
var LOG_LEVEL_INFO = "info";
|
|
@@ -1681,7 +1694,9 @@ function transformToMutableRollupOutputAsset(bindingAsset, changed) {
|
|
|
1681
1694
|
}
|
|
1682
1695
|
function transformToRollupOutput(output) {
|
|
1683
1696
|
const { chunks, assets } = output;
|
|
1684
|
-
|
|
1697
|
+
const transformed = { output: [...chunks.map((chunk) => transformToRollupOutputChunk(chunk)), ...assets.map((asset) => transformToRollupOutputAsset(asset))] };
|
|
1698
|
+
if (output.mangleCache !== void 0) transformed.mangleCache = output.mangleCache;
|
|
1699
|
+
return transformed;
|
|
1685
1700
|
}
|
|
1686
1701
|
function transformToMutableRollupOutput(output, changed) {
|
|
1687
1702
|
const { chunks, assets } = output;
|
|
@@ -2909,7 +2924,218 @@ function extractHookUsage(plugin) {
|
|
|
2909
2924
|
if (plugin.hotUpdate) hookUsage.union(4194304);
|
|
2910
2925
|
return hookUsage;
|
|
2911
2926
|
}
|
|
2912
|
-
|
|
2927
|
+
/**
|
|
2928
|
+
* Measure what plugin hooks cost, from inside the JavaScript callback.
|
|
2929
|
+
*
|
|
2930
|
+
* Internal to Rolldown. Nothing here is on a public entry point, and the measurement is not
|
|
2931
|
+
* offered as an API — the only consumer is the core, which pulls it while the build closes.
|
|
2932
|
+
*
|
|
2933
|
+
* The bundler core can only bracket *dispatch* and *completion*. For a hook it invokes
|
|
2934
|
+
* concurrently those two points are separated mostly by the queue the call waited in on
|
|
2935
|
+
* JavaScript's single thread, and the queue is deepest behind whichever callback is doing
|
|
2936
|
+
* the most work — so the hook blocking the thread dilutes its own credit while cheap hooks
|
|
2937
|
+
* collect credit for waiting. Ranking from those numbers reliably puts the *cheapest* hook
|
|
2938
|
+
* first.
|
|
2939
|
+
*
|
|
2940
|
+
* The missing quantity is when the callback began running, and that is known here. Starting
|
|
2941
|
+
* the clock inside the callback removes the dispatch queue by construction.
|
|
2942
|
+
*
|
|
2943
|
+
* ## `maxInFlight` decides whether a total means anything
|
|
2944
|
+
*
|
|
2945
|
+
* Entry-to-exit spans may be summed only if they never overlap. A synchronous callback
|
|
2946
|
+
* cannot overlap: it holds the thread until it returns. An `async` one can — it may suspend
|
|
2947
|
+
* at an `await` and let another call of the same hook begin, and then both spans cover the
|
|
2948
|
+
* same wall clock and the sum counts it twice.
|
|
2949
|
+
*
|
|
2950
|
+
* Overlap also changes what the span is measuring. A hook that awaits the bundler (say
|
|
2951
|
+
* `this.resolve`) spends most of its span waiting for Rust, so the number describes the
|
|
2952
|
+
* bundler rather than the plugin. Observed on a real build: one `resolveId` accumulated
|
|
2953
|
+
* ~47,000s of span inside a 44s module-loading window.
|
|
2954
|
+
*
|
|
2955
|
+
* So overlap is measured rather than assumed, per hook: `overlapMs` is the wall time
|
|
2956
|
+
* double counted in `ms` because two or more calls were in flight together. A hook is
|
|
2957
|
+
* reported with a number when that is a negligible share of its span, and named without one
|
|
2958
|
+
* when it is not.
|
|
2959
|
+
*
|
|
2960
|
+
* The test is deliberately a tolerance rather than "did this ever happen". A peak in-flight
|
|
2961
|
+
* count of 2 can mean one incidental overlap in twenty thousand calls, and discarding a
|
|
2962
|
+
* twelve-second measurement over that both throws away good data and makes the report
|
|
2963
|
+
* depend on scheduling luck — the same hook would appear in one run and vanish in the next.
|
|
2964
|
+
*
|
|
2965
|
+
* This keeps the rule the core followed — never present a number that cannot be defended —
|
|
2966
|
+
* while narrowing "cannot measure" from a property of the *call site* to a property of the
|
|
2967
|
+
* *callback*, which is where it actually lives. A hook dispatched concurrently but whose
|
|
2968
|
+
* body barely overlaps is measured to within the tolerance.
|
|
2969
|
+
*
|
|
2970
|
+
* A measured row is still wall time for that callback rather than CPU: a hook that awaits
|
|
2971
|
+
* I/O without overlapping another call of itself is charged for the wait. Excluding the
|
|
2972
|
+
* dispatch queue is what this buys; it does not distinguish running from awaiting.
|
|
2973
|
+
*/
|
|
2974
|
+
/**
|
|
2975
|
+
* How much of a hook's span may be double counted before its total stops being reportable,
|
|
2976
|
+
* as a fraction of that span.
|
|
2977
|
+
*/
|
|
2978
|
+
var OVERLAP_TOLERANCE = .01;
|
|
2979
|
+
/**
|
|
2980
|
+
* One recorder per build, keyed on the object that identifies it.
|
|
2981
|
+
*
|
|
2982
|
+
* Counters cannot be module-global. A plugin is free to run a nested `rolldown()` build of
|
|
2983
|
+
* its own, which finishes first; shared counters would let it flush the outer build's
|
|
2984
|
+
* half-accumulated totals and report a window belonging to neither.
|
|
2985
|
+
*/
|
|
2986
|
+
var recorders = /* @__PURE__ */ new WeakMap();
|
|
2987
|
+
/** The recorder for one build, created on first use. */
|
|
2988
|
+
function pluginTimingsRecorderFor(key) {
|
|
2989
|
+
let recorder = recorders.get(key);
|
|
2990
|
+
if (recorder === void 0) {
|
|
2991
|
+
recorder = {
|
|
2992
|
+
costs: /* @__PURE__ */ new Map(),
|
|
2993
|
+
busyMs: 0,
|
|
2994
|
+
inFlight: 0,
|
|
2995
|
+
busyStart: 0
|
|
2996
|
+
};
|
|
2997
|
+
recorders.set(key, recorder);
|
|
2998
|
+
}
|
|
2999
|
+
return recorder;
|
|
3000
|
+
}
|
|
3001
|
+
function costFor(recorder, owner, hookName) {
|
|
3002
|
+
let byHook = recorder.costs.get(owner.key);
|
|
3003
|
+
if (byHook === void 0) {
|
|
3004
|
+
byHook = /* @__PURE__ */ new Map();
|
|
3005
|
+
recorder.costs.set(owner.key, byHook);
|
|
3006
|
+
}
|
|
3007
|
+
let cost = byHook.get(hookName);
|
|
3008
|
+
if (cost === void 0) {
|
|
3009
|
+
cost = {
|
|
3010
|
+
owner: owner.name,
|
|
3011
|
+
kind: owner.kind,
|
|
3012
|
+
hookName,
|
|
3013
|
+
calls: 0,
|
|
3014
|
+
ms: 0,
|
|
3015
|
+
inFlight: 0,
|
|
3016
|
+
maxInFlight: 0,
|
|
3017
|
+
overlapMs: 0,
|
|
3018
|
+
lastChange: 0
|
|
3019
|
+
};
|
|
3020
|
+
byHook.set(hookName, cost);
|
|
3021
|
+
}
|
|
3022
|
+
return cost;
|
|
3023
|
+
}
|
|
3024
|
+
/**
|
|
3025
|
+
* Fold the interval since the last in-flight change into `overlapMs`, then move the mark.
|
|
3026
|
+
* Call immediately before every increment and decrement of `cost.inFlight`.
|
|
3027
|
+
*/
|
|
3028
|
+
function markInFlightChange(cost, at) {
|
|
3029
|
+
if (cost.inFlight > 1) cost.overlapMs += (cost.inFlight - 1) * (at - cost.lastChange);
|
|
3030
|
+
cost.lastChange = at;
|
|
3031
|
+
}
|
|
3032
|
+
/**
|
|
3033
|
+
* Close out one call. A module-level function rather than a closure per invocation: hooks
|
|
3034
|
+
* run hundreds of thousands of times in a large build, and the synchronous path would
|
|
3035
|
+
* otherwise allocate one closure per call only to invoke it immediately.
|
|
3036
|
+
*/
|
|
3037
|
+
function settle(recorder, cost, started) {
|
|
3038
|
+
const ended = performance.now();
|
|
3039
|
+
markInFlightChange(cost, ended);
|
|
3040
|
+
cost.inFlight -= 1;
|
|
3041
|
+
cost.ms += ended - started;
|
|
3042
|
+
recorder.inFlight -= 1;
|
|
3043
|
+
if (recorder.inFlight === 0) recorder.busyMs += ended - recorder.busyStart;
|
|
3044
|
+
}
|
|
3045
|
+
/**
|
|
3046
|
+
* Wrap one callback so its execution time is recorded.
|
|
3047
|
+
*
|
|
3048
|
+
* Returns the callback untouched when there is no recorder, so a build that is not
|
|
3049
|
+
* measuring pays nothing beyond one branch at setup.
|
|
3050
|
+
*/
|
|
3051
|
+
function measureHookCost(recorder, owner, hookName, handler) {
|
|
3052
|
+
if (recorder === void 0) return handler;
|
|
3053
|
+
const cost = costFor(recorder, owner, hookName);
|
|
3054
|
+
return function(...args) {
|
|
3055
|
+
const started = performance.now();
|
|
3056
|
+
markInFlightChange(cost, started);
|
|
3057
|
+
cost.calls += 1;
|
|
3058
|
+
cost.inFlight += 1;
|
|
3059
|
+
if (cost.inFlight > cost.maxInFlight) cost.maxInFlight = cost.inFlight;
|
|
3060
|
+
if (recorder.inFlight === 0) recorder.busyStart = started;
|
|
3061
|
+
recorder.inFlight += 1;
|
|
3062
|
+
let result;
|
|
3063
|
+
try {
|
|
3064
|
+
result = handler.apply(this, args);
|
|
3065
|
+
} catch (error) {
|
|
3066
|
+
settle(recorder, cost, started);
|
|
3067
|
+
throw error;
|
|
3068
|
+
}
|
|
3069
|
+
if (typeof result?.then === "function") return result.then((value) => {
|
|
3070
|
+
settle(recorder, cost, started);
|
|
3071
|
+
return value;
|
|
3072
|
+
}, (error) => {
|
|
3073
|
+
settle(recorder, cost, started);
|
|
3074
|
+
throw error;
|
|
3075
|
+
});
|
|
3076
|
+
settle(recorder, cost, started);
|
|
3077
|
+
return result;
|
|
3078
|
+
};
|
|
3079
|
+
}
|
|
3080
|
+
/**
|
|
3081
|
+
* The owner shown for user callbacks the core invokes directly rather than through a
|
|
3082
|
+
* plugin. One shared identity: they are all configured on the same options object.
|
|
3083
|
+
*/
|
|
3084
|
+
var OUTPUT_OPTIONS_OWNER = {
|
|
3085
|
+
key: Symbol("output options"),
|
|
3086
|
+
name: "output options",
|
|
3087
|
+
kind: "outputOption"
|
|
3088
|
+
};
|
|
3089
|
+
/** As {@link OUTPUT_OPTIONS_OWNER}, for callbacks configured on the input options. */
|
|
3090
|
+
var INPUT_OPTIONS_OWNER = {
|
|
3091
|
+
key: Symbol("input options"),
|
|
3092
|
+
name: "input options",
|
|
3093
|
+
kind: "inputOption"
|
|
3094
|
+
};
|
|
3095
|
+
/**
|
|
3096
|
+
* Wrap `value` when the user supplied a function, and leave every other form alone.
|
|
3097
|
+
*
|
|
3098
|
+
* Most option callbacks are declared as `string | RegExp | Function | ...`, so this keeps
|
|
3099
|
+
* the one cast the wrapping needs in a single place.
|
|
3100
|
+
*/
|
|
3101
|
+
function measureIfFunction(recorder, owner, hookName, value) {
|
|
3102
|
+
if (typeof value !== "function") return value;
|
|
3103
|
+
return measureHookCost(recorder, owner, hookName, value);
|
|
3104
|
+
}
|
|
3105
|
+
/**
|
|
3106
|
+
* What the build's callbacks have cost so far, leaving the recorder in place.
|
|
3107
|
+
*
|
|
3108
|
+
* Ungated on purpose: whether a build is worth reporting on is decided from the clocks Rust
|
|
3109
|
+
* holds, so the question is not this side's to ask.
|
|
3110
|
+
*
|
|
3111
|
+
* Rust calls this while the build is closing, so what it gets includes `closeBundle`.
|
|
3112
|
+
*/
|
|
3113
|
+
function summarizePluginTimings(key) {
|
|
3114
|
+
const recorder = recorders.get(key);
|
|
3115
|
+
if (recorder === void 0) return {
|
|
3116
|
+
busyMs: 0,
|
|
3117
|
+
rows: []
|
|
3118
|
+
};
|
|
3119
|
+
const rows = [];
|
|
3120
|
+
for (const byHook of recorder.costs.values()) for (const cost of byHook.values()) {
|
|
3121
|
+
if (cost.calls === 0) continue;
|
|
3122
|
+
rows.push({
|
|
3123
|
+
owner: cost.owner,
|
|
3124
|
+
kind: cost.kind,
|
|
3125
|
+
hook: cost.hookName,
|
|
3126
|
+
calls: cost.calls,
|
|
3127
|
+
ms: cost.ms,
|
|
3128
|
+
maxInFlight: cost.maxInFlight,
|
|
3129
|
+
overlapMs: cost.overlapMs,
|
|
3130
|
+
rankable: cost.overlapMs <= cost.ms * OVERLAP_TOLERANCE
|
|
3131
|
+
});
|
|
3132
|
+
}
|
|
3133
|
+
return {
|
|
3134
|
+
busyMs: recorder.busyMs,
|
|
3135
|
+
rows
|
|
3136
|
+
};
|
|
3137
|
+
}
|
|
3138
|
+
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings) {
|
|
2913
3139
|
const args = {
|
|
2914
3140
|
plugin,
|
|
2915
3141
|
options,
|
|
@@ -2943,7 +3169,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
2943
3169
|
const { plugin: hotUpdate, meta: hotUpdateMeta } = bindingifyHotUpdate(args);
|
|
2944
3170
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
|
|
2945
3171
|
let hookUsage = extractHookUsage(plugin).inner();
|
|
2946
|
-
|
|
3172
|
+
const result = {
|
|
2947
3173
|
name: plugin.name,
|
|
2948
3174
|
buildStart,
|
|
2949
3175
|
buildStartMeta,
|
|
@@ -2994,9 +3220,14 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
2994
3220
|
closeWatcher,
|
|
2995
3221
|
closeWatcherMeta,
|
|
2996
3222
|
hookUsage
|
|
2997
|
-
}
|
|
3223
|
+
};
|
|
3224
|
+
return wrapHandlers(result, {
|
|
3225
|
+
key: plugin,
|
|
3226
|
+
name: result.name,
|
|
3227
|
+
kind: "plugin"
|
|
3228
|
+
}, timings);
|
|
2998
3229
|
}
|
|
2999
|
-
function wrapHandlers(plugin) {
|
|
3230
|
+
function wrapHandlers(plugin, owner, timings) {
|
|
3000
3231
|
for (const hookName of [
|
|
3001
3232
|
"buildStart",
|
|
3002
3233
|
"resolveId",
|
|
@@ -3021,7 +3252,8 @@ function wrapHandlers(plugin) {
|
|
|
3021
3252
|
"hotUpdate",
|
|
3022
3253
|
"closeWatcher"
|
|
3023
3254
|
]) {
|
|
3024
|
-
const
|
|
3255
|
+
const raw = plugin[hookName];
|
|
3256
|
+
const handler = raw && measureHookCost(timings, owner, hookName, raw);
|
|
3025
3257
|
if (handler) plugin[hookName] = async (...args) => {
|
|
3026
3258
|
try {
|
|
3027
3259
|
return await handler(...args);
|
|
@@ -3061,32 +3293,32 @@ function normalizeTransformOptions(inputOptions) {
|
|
|
3061
3293
|
};
|
|
3062
3294
|
}
|
|
3063
3295
|
function getDefaultDevRuntime(host = "localhost", port = 3e3) {
|
|
3064
|
-
const runtimeEntry = node_fs.default.readFileSync((0, node_url.fileURLToPath)({}.resolve("
|
|
3296
|
+
const runtimeEntry = node_fs.default.readFileSync((0, node_url.fileURLToPath)({}.resolve("#runtime")), "utf8");
|
|
3065
3297
|
const runtimeHelperImportEnd = runtimeEntry.indexOf("\n");
|
|
3066
3298
|
if (!runtimeEntry.startsWith("import ") || runtimeHelperImportEnd === -1) throw new Error("Expected the standalone runtime to start with a helper import");
|
|
3067
3299
|
return `${runtimeEntry.slice(runtimeHelperImportEnd + 1)}\n${node_fs.default.readFileSync((0, node_url.fileURLToPath)({}.resolve("#default-runtime")), "utf8").replaceAll("$ADDR", `${host}:${port}`)}`;
|
|
3068
3300
|
}
|
|
3069
|
-
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
3301
|
+
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings) {
|
|
3070
3302
|
const plugins = rawPlugins.map((plugin) => {
|
|
3071
3303
|
if (getParallelPluginInfo(plugin)) return;
|
|
3072
3304
|
if (plugin instanceof BuiltinPlugin) switch (plugin.name) {
|
|
3073
3305
|
case "builtin:vite-manifest": return bindingifyManifestPlugin(plugin, pluginContextData);
|
|
3074
3306
|
default: return bindingifyBuiltInPlugin(plugin);
|
|
3075
3307
|
}
|
|
3076
|
-
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
3308
|
+
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings);
|
|
3077
3309
|
});
|
|
3078
3310
|
const normalizedTransform = normalizeTransformOptions(inputOptions);
|
|
3079
3311
|
return {
|
|
3080
3312
|
input: bindingifyInput(inputOptions.input),
|
|
3081
3313
|
plugins,
|
|
3082
3314
|
cwd: inputOptions.cwd ?? process.cwd(),
|
|
3083
|
-
external: bindingifyExternal(inputOptions.external),
|
|
3315
|
+
external: bindingifyExternal(inputOptions.external, timings),
|
|
3084
3316
|
resolve: bindingifyResolve(inputOptions.resolve),
|
|
3085
3317
|
platform: inputOptions.platform,
|
|
3086
3318
|
shimMissingExports: inputOptions.shimMissingExports,
|
|
3087
3319
|
logLevel: bindingifyLogLevel(logLevel),
|
|
3088
3320
|
onLog,
|
|
3089
|
-
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
|
|
3321
|
+
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake, timings),
|
|
3090
3322
|
moduleTypes: inputOptions.moduleTypes,
|
|
3091
3323
|
define: normalizedTransform.define,
|
|
3092
3324
|
inject: bindingifyInject(normalizedTransform.inject),
|
|
@@ -3097,6 +3329,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginC
|
|
|
3097
3329
|
dropLabels: normalizedTransform.dropLabels,
|
|
3098
3330
|
keepNames: outputOptions.keepNames,
|
|
3099
3331
|
checks: inputOptions.checks,
|
|
3332
|
+
pluginTimings: timings ? () => summarizePluginTimings(inputOptions) : void 0,
|
|
3100
3333
|
deferSyncScanData: () => {
|
|
3101
3334
|
let ret = [];
|
|
3102
3335
|
pluginContextData.moduleOptionMap.forEach((value, key) => {
|
|
@@ -3138,12 +3371,15 @@ function bindingifyAttachDebugInfo(attachDebugInfo) {
|
|
|
3138
3371
|
case "none": return import_binding$4.BindingAttachDebugInfo.None;
|
|
3139
3372
|
}
|
|
3140
3373
|
}
|
|
3141
|
-
function bindingifyExternal(external) {
|
|
3374
|
+
function bindingifyExternal(external, timings) {
|
|
3142
3375
|
if (external) {
|
|
3143
|
-
if (typeof external === "function")
|
|
3144
|
-
|
|
3145
|
-
return
|
|
3146
|
-
|
|
3376
|
+
if (typeof external === "function") {
|
|
3377
|
+
const measured = measureHookCost(timings, INPUT_OPTIONS_OWNER, "external", external);
|
|
3378
|
+
return (id, importer, isResolved) => {
|
|
3379
|
+
if (id.startsWith("\0")) return false;
|
|
3380
|
+
return measured(id, importer, isResolved) ?? false;
|
|
3381
|
+
};
|
|
3382
|
+
}
|
|
3147
3383
|
return arraify(external);
|
|
3148
3384
|
}
|
|
3149
3385
|
}
|
|
@@ -3234,11 +3470,7 @@ function bindingifyInput(input) {
|
|
|
3234
3470
|
}
|
|
3235
3471
|
function bindingifyWatch(watch) {
|
|
3236
3472
|
if (watch) {
|
|
3237
|
-
|
|
3238
|
-
const watcher = {
|
|
3239
|
-
...watch.notify,
|
|
3240
|
-
...watch.watcher
|
|
3241
|
-
};
|
|
3473
|
+
const watcher = watch.watcher ?? {};
|
|
3242
3474
|
return {
|
|
3243
3475
|
buildDelay: watch.buildDelay,
|
|
3244
3476
|
skipWrite: watch.skipWrite,
|
|
@@ -3254,7 +3486,7 @@ function bindingifyWatch(watch) {
|
|
|
3254
3486
|
};
|
|
3255
3487
|
}
|
|
3256
3488
|
}
|
|
3257
|
-
function bindingifyTreeshakeOptions(config) {
|
|
3489
|
+
function bindingifyTreeshakeOptions(config, timings) {
|
|
3258
3490
|
if (config === false) return;
|
|
3259
3491
|
if (config === true || config === void 0) return { moduleSideEffects: true };
|
|
3260
3492
|
let normalizedConfig = {
|
|
@@ -3285,7 +3517,7 @@ function bindingifyTreeshakeOptions(config) {
|
|
|
3285
3517
|
external: false,
|
|
3286
3518
|
sideEffects: true
|
|
3287
3519
|
}];
|
|
3288
|
-
else normalizedConfig.moduleSideEffects = config.moduleSideEffects;
|
|
3520
|
+
else normalizedConfig.moduleSideEffects = measureIfFunction(timings, INPUT_OPTIONS_OWNER, "treeshake.moduleSideEffects", config.moduleSideEffects);
|
|
3289
3521
|
return normalizedConfig;
|
|
3290
3522
|
}
|
|
3291
3523
|
function bindingifyMakeAbsoluteExternalsRelative(makeAbsoluteExternalsRelative) {
|
|
@@ -3307,7 +3539,7 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
|
|
|
3307
3539
|
};
|
|
3308
3540
|
}
|
|
3309
3541
|
//#endregion
|
|
3310
|
-
//#region ../../node_modules/rolldown/dist/shared/create-bundler-option-
|
|
3542
|
+
//#region ../../node_modules/rolldown/dist/shared/create-bundler-option-kXHnIt4b.mjs
|
|
3311
3543
|
function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
3312
3544
|
const minimalPriority = logLevelPriority[logLevel];
|
|
3313
3545
|
const logger = (level, log, skipped = /* @__PURE__ */ new Set()) => {
|
|
@@ -3326,7 +3558,7 @@ function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
|
3326
3558
|
info: getLogHandler("info"),
|
|
3327
3559
|
meta: {
|
|
3328
3560
|
rollupVersion: "4.23.0",
|
|
3329
|
-
rolldownVersion: "1.2.
|
|
3561
|
+
rolldownVersion: "1.2.8",
|
|
3330
3562
|
watchMode
|
|
3331
3563
|
},
|
|
3332
3564
|
warn: getLogHandler("warn"),
|
|
@@ -4718,7 +4950,8 @@ var ChecksOptionsSchema = /* @__PURE__ */ strictObject({
|
|
|
4718
4950
|
unsupportedTsconfigOption: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a tsconfig option or combination of options is not supported")),
|
|
4719
4951
|
ineffectiveDynamicImport: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a module is dynamically imported but also statically imported, making the dynamic import ineffective for code splitting")),
|
|
4720
4952
|
largeBarrelModules: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit info logs when a barrel module has a very large number of re-exports (more than 5000)")),
|
|
4721
|
-
sourcemapBroken: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a plugin transforms code without generating a sourcemap"))
|
|
4953
|
+
sourcemapBroken: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a plugin transforms code without generating a sourcemap")),
|
|
4954
|
+
namespaceConflict: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when multiple star re-exports provide the same name from different modules"))
|
|
4722
4955
|
});
|
|
4723
4956
|
var MinifyOptionsSchema = /* @__PURE__ */ strictObject({
|
|
4724
4957
|
compress: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
|
|
@@ -4752,6 +4985,14 @@ var MinifyOptionsSchema = /* @__PURE__ */ strictObject({
|
|
|
4752
4985
|
reserved: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
4753
4986
|
debug: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
4754
4987
|
})])),
|
|
4988
|
+
mangleProps: /* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
|
|
4989
|
+
include: /* @__PURE__ */ instance(RegExp),
|
|
4990
|
+
exclude: /* @__PURE__ */ optional(/* @__PURE__ */ instance(RegExp)),
|
|
4991
|
+
reserved: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
4992
|
+
quoted: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
4993
|
+
debug: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
4994
|
+
cache: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ literal(false)])))
|
|
4995
|
+
})),
|
|
4755
4996
|
codegen: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
|
|
4756
4997
|
removeWhitespace: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
4757
4998
|
legalComments: /* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
@@ -5083,13 +5324,31 @@ function validateOption(key, options) {
|
|
|
5083
5324
|
var ChunkingContextImpl = class {
|
|
5084
5325
|
context;
|
|
5085
5326
|
pluginContextData;
|
|
5327
|
+
moduleInfoCache = /* @__PURE__ */ new Map();
|
|
5086
5328
|
constructor(context, pluginContextData) {
|
|
5087
5329
|
this.context = context;
|
|
5088
5330
|
this.pluginContextData = pluginContextData;
|
|
5089
5331
|
}
|
|
5332
|
+
clearModuleInfoCache() {
|
|
5333
|
+
this.moduleInfoCache = void 0;
|
|
5334
|
+
}
|
|
5090
5335
|
getModuleInfo(moduleId) {
|
|
5336
|
+
const cached = this.moduleInfoCache?.get(moduleId);
|
|
5337
|
+
if (cached) return cached;
|
|
5091
5338
|
const bindingInfo = this.context.getModuleInfo(moduleId);
|
|
5092
|
-
if (bindingInfo)
|
|
5339
|
+
if (bindingInfo) {
|
|
5340
|
+
const option = this.pluginContextData.getModuleOption(moduleId);
|
|
5341
|
+
const info = transformModuleInfo(bindingInfo, option);
|
|
5342
|
+
Object.defineProperty(info, "moduleSideEffects", {
|
|
5343
|
+
get: () => option.moduleSideEffects,
|
|
5344
|
+
set: (moduleSideEffects) => {
|
|
5345
|
+
option.moduleSideEffects = moduleSideEffects;
|
|
5346
|
+
option.invalidate = true;
|
|
5347
|
+
}
|
|
5348
|
+
});
|
|
5349
|
+
this.moduleInfoCache?.set(moduleId, info);
|
|
5350
|
+
return info;
|
|
5351
|
+
}
|
|
5093
5352
|
return null;
|
|
5094
5353
|
}
|
|
5095
5354
|
};
|
|
@@ -6080,10 +6339,10 @@ function createTestingLogger() {
|
|
|
6080
6339
|
for (const type of types) ret[type] = (...args) => console.log(...args);
|
|
6081
6340
|
return ret;
|
|
6082
6341
|
}
|
|
6083
|
-
function bindingifyOutputOptions(outputOptions, pluginContextData) {
|
|
6342
|
+
function bindingifyOutputOptions(outputOptions, pluginContextData, timings) {
|
|
6084
6343
|
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;
|
|
6085
6344
|
if (legalComments != null) logger.warn("`legalComments` option is deprecated, please use `comments.legal` instead.");
|
|
6086
|
-
const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks, pluginContextData);
|
|
6345
|
+
const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks, pluginContextData, timings);
|
|
6087
6346
|
return {
|
|
6088
6347
|
dir,
|
|
6089
6348
|
file: file == null ? void 0 : file,
|
|
@@ -6093,25 +6352,25 @@ function bindingifyOutputOptions(outputOptions, pluginContextData) {
|
|
|
6093
6352
|
sourcemap: bindingifySourcemap(sourcemap),
|
|
6094
6353
|
sourcemapBaseUrl,
|
|
6095
6354
|
sourcemapDebugIds,
|
|
6096
|
-
sourcemapFileNames,
|
|
6355
|
+
sourcemapFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sourcemapFileNames", sourcemapFileNames),
|
|
6097
6356
|
sourcemapExcludeSources,
|
|
6098
|
-
sourcemapIgnoreList: sourcemapIgnoreList ?? /node_modules
|
|
6099
|
-
sourcemapPathTransform,
|
|
6100
|
-
banner: bindingifyAddon(banner),
|
|
6101
|
-
footer: bindingifyAddon(footer),
|
|
6102
|
-
postBanner: bindingifyAddon(postBanner),
|
|
6103
|
-
postFooter: bindingifyAddon(postFooter),
|
|
6104
|
-
intro: bindingifyAddon(intro),
|
|
6105
|
-
outro: bindingifyAddon(outro),
|
|
6357
|
+
sourcemapIgnoreList: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sourcemapIgnoreList", sourcemapIgnoreList ?? /node_modules/),
|
|
6358
|
+
sourcemapPathTransform: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sourcemapPathTransform", sourcemapPathTransform),
|
|
6359
|
+
banner: bindingifyAddon(banner, "banner", timings),
|
|
6360
|
+
footer: bindingifyAddon(footer, "footer", timings),
|
|
6361
|
+
postBanner: bindingifyAddon(postBanner, "postBanner", timings),
|
|
6362
|
+
postFooter: bindingifyAddon(postFooter, "postFooter", timings),
|
|
6363
|
+
intro: bindingifyAddon(intro, "intro", timings),
|
|
6364
|
+
outro: bindingifyAddon(outro, "outro", timings),
|
|
6106
6365
|
extend: outputOptions.extend,
|
|
6107
|
-
globals,
|
|
6108
|
-
paths,
|
|
6366
|
+
globals: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "globals", globals),
|
|
6367
|
+
paths: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "paths", paths),
|
|
6109
6368
|
generatedCode,
|
|
6110
6369
|
esModule,
|
|
6111
6370
|
name,
|
|
6112
6371
|
assetFileNames: bindingifyAssetFilenames(assetFileNames),
|
|
6113
|
-
entryFileNames,
|
|
6114
|
-
chunkFileNames,
|
|
6372
|
+
entryFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "entryFileNames", entryFileNames),
|
|
6373
|
+
chunkFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "chunkFileNames", chunkFileNames),
|
|
6115
6374
|
plugins: [],
|
|
6116
6375
|
minify: outputOptions.minify,
|
|
6117
6376
|
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
@@ -6132,9 +6391,12 @@ function bindingifyOutputOptions(outputOptions, pluginContextData) {
|
|
|
6132
6391
|
strict: outputOptions.strict
|
|
6133
6392
|
};
|
|
6134
6393
|
}
|
|
6135
|
-
function bindingifyAddon(configAddon) {
|
|
6394
|
+
function bindingifyAddon(configAddon, name, timings) {
|
|
6136
6395
|
if (configAddon == null || configAddon === "") return;
|
|
6137
|
-
if (typeof configAddon === "function")
|
|
6396
|
+
if (typeof configAddon === "function") {
|
|
6397
|
+
const measured = measureHookCost(timings, OUTPUT_OPTIONS_OWNER, name, configAddon);
|
|
6398
|
+
return async (chunk) => measured(transformRenderedChunk(chunk));
|
|
6399
|
+
}
|
|
6138
6400
|
return configAddon;
|
|
6139
6401
|
}
|
|
6140
6402
|
function bindingifyFormat(format) {
|
|
@@ -6178,7 +6440,7 @@ function bindingifyComments(comments) {
|
|
|
6178
6440
|
if (typeof comments === "boolean") return comments;
|
|
6179
6441
|
return comments;
|
|
6180
6442
|
}
|
|
6181
|
-
function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, advancedChunks, manualChunks, pluginContextData) {
|
|
6443
|
+
function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, advancedChunks, manualChunks, pluginContextData, timings) {
|
|
6182
6444
|
let inlineDynamicImports;
|
|
6183
6445
|
let effectiveChunksOption;
|
|
6184
6446
|
if (codeSplitting === false) {
|
|
@@ -6218,13 +6480,20 @@ function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, adva
|
|
|
6218
6480
|
let advancedChunksResult;
|
|
6219
6481
|
if (effectiveChunksOption != null) {
|
|
6220
6482
|
const { groups, ...restOptions } = effectiveChunksOption;
|
|
6483
|
+
let chunkingContext;
|
|
6484
|
+
const getChunkingContext = (bindingContext) => chunkingContext ??= new ChunkingContextImpl(bindingContext, pluginContextData);
|
|
6221
6485
|
advancedChunksResult = {
|
|
6222
6486
|
...restOptions,
|
|
6487
|
+
internalInvalidateModuleInfoCache: () => {
|
|
6488
|
+
chunkingContext?.clearModuleInfoCache();
|
|
6489
|
+
chunkingContext = void 0;
|
|
6490
|
+
},
|
|
6223
6491
|
groups: groups?.map((group) => {
|
|
6224
|
-
const { name, ...restGroup } = group;
|
|
6492
|
+
const { name, test, ...restGroup } = group;
|
|
6225
6493
|
return {
|
|
6226
6494
|
...restGroup,
|
|
6227
|
-
|
|
6495
|
+
test: typeof test === "function" ? batchTest(measureHookCost(timings, OUTPUT_OPTIONS_OWNER, "codeSplitting groups[].test", test)) : test,
|
|
6496
|
+
name: typeof name === "function" ? batchName(measureHookCost(timings, OUTPUT_OPTIONS_OWNER, "codeSplitting groups[].name", name), getChunkingContext) : name
|
|
6228
6497
|
};
|
|
6229
6498
|
})
|
|
6230
6499
|
};
|
|
@@ -6234,6 +6503,40 @@ function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, adva
|
|
|
6234
6503
|
advancedChunks: advancedChunksResult
|
|
6235
6504
|
};
|
|
6236
6505
|
}
|
|
6506
|
+
/**
|
|
6507
|
+
* Wraps a per-id `test` in the batched shim that the binding expects.
|
|
6508
|
+
*
|
|
6509
|
+
* The loop runs in JS so that a group makes one napi crossing, not one per module.
|
|
6510
|
+
*
|
|
6511
|
+
* The result is a `Uint8Array`, which crosses as a buffer instead of one tagged value per id.
|
|
6512
|
+
*/
|
|
6513
|
+
function batchTest(test) {
|
|
6514
|
+
return (ids) => {
|
|
6515
|
+
const results = new Uint8Array(ids.length);
|
|
6516
|
+
for (let index = 0; index < ids.length; index++) {
|
|
6517
|
+
const result = test(ids[index]);
|
|
6518
|
+
if (result != null && typeof result !== "boolean") throw new TypeError(`\`output.codeSplitting.groups[].test\` returned ${typeof result} for module "${ids[index]}", but expected a boolean, null or undefined.`);
|
|
6519
|
+
results[index] = result === true ? 1 : 0;
|
|
6520
|
+
}
|
|
6521
|
+
return results;
|
|
6522
|
+
};
|
|
6523
|
+
}
|
|
6524
|
+
/**
|
|
6525
|
+
* This is the `name` equivalent of {@linkcode batchTest}. All groups in a chunking pass share
|
|
6526
|
+
* a context so repeated module queries reuse their JavaScript values.
|
|
6527
|
+
*/
|
|
6528
|
+
function batchName(name, getChunkingContext) {
|
|
6529
|
+
return (ids, bindingContext) => {
|
|
6530
|
+
const context = getChunkingContext(bindingContext);
|
|
6531
|
+
const results = [];
|
|
6532
|
+
for (let index = 0; index < ids.length; index++) {
|
|
6533
|
+
const result = name(ids[index], context);
|
|
6534
|
+
if (result != null && typeof result !== "string") throw new TypeError(`\`output.codeSplitting.groups[].name\` returned ${typeof result} for module "${ids[index]}", but expected a string, null or undefined.`);
|
|
6535
|
+
results.push(result);
|
|
6536
|
+
}
|
|
6537
|
+
return results;
|
|
6538
|
+
};
|
|
6539
|
+
}
|
|
6237
6540
|
var import_binding$3 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
6238
6541
|
async function initializeParallelPlugins(plugins) {
|
|
6239
6542
|
const pluginInfos = [];
|
|
@@ -6297,7 +6600,7 @@ var availableParallelism = () => {
|
|
|
6297
6600
|
}
|
|
6298
6601
|
return Math.min(availableParallelism, 8);
|
|
6299
6602
|
};
|
|
6300
|
-
async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
6603
|
+
async function createBundlerOptions(inputOptions, outputOptions, watchMode, measureTimings = false) {
|
|
6301
6604
|
const inputPlugins = await normalizePluginOption(inputOptions.plugins);
|
|
6302
6605
|
const outputPlugins = await normalizePluginOption(outputOptions.plugins);
|
|
6303
6606
|
const logLevel = inputOptions.logLevel || "info";
|
|
@@ -6307,14 +6610,20 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
6307
6610
|
const normalizedInputPlugins = normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX);
|
|
6308
6611
|
const normalizedOutputPlugins = normalizePlugins(hookOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX);
|
|
6309
6612
|
let plugins = [...normalizedInputPlugins, ...checkOutputPluginOption(normalizedOutputPlugins, onLog)];
|
|
6613
|
+
const timings = measureTimings && inputOptions.checks?.pluginTimings !== false ? pluginTimingsRecorderFor(inputOptions) : void 0;
|
|
6614
|
+
if (timings) outputOptions = {
|
|
6615
|
+
...outputOptions,
|
|
6616
|
+
assetFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "assetFileNames", outputOptions.assetFileNames),
|
|
6617
|
+
sanitizeFileName: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sanitizeFileName", outputOptions.sanitizeFileName)
|
|
6618
|
+
};
|
|
6310
6619
|
const parallelPluginInitResult = await initializeParallelPlugins(plugins);
|
|
6311
6620
|
if (inputOptions.experimental?.strictExecutionOrder !== void 0) console.warn("`experimental.strictExecutionOrder` has been stabilized and moved to `output.strictExecutionOrder`. Please update your configuration.");
|
|
6312
6621
|
try {
|
|
6313
6622
|
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedInputPlugins, normalizedOutputPlugins);
|
|
6314
6623
|
return {
|
|
6315
6624
|
bundlerOptions: {
|
|
6316
|
-
inputOptions: bindingifyInputOptions(plugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode),
|
|
6317
|
-
outputOptions: bindingifyOutputOptions(outputOptions, pluginContextData),
|
|
6625
|
+
inputOptions: bindingifyInputOptions(plugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings),
|
|
6626
|
+
outputOptions: bindingifyOutputOptions(outputOptions, pluginContextData, timings),
|
|
6318
6627
|
parallelPluginsRegistry: parallelPluginInitResult?.registry
|
|
6319
6628
|
},
|
|
6320
6629
|
inputOptions,
|
|
@@ -6327,7 +6636,7 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
6327
6636
|
}
|
|
6328
6637
|
}
|
|
6329
6638
|
//#endregion
|
|
6330
|
-
//#region ../../node_modules/rolldown/dist/shared/watch-
|
|
6639
|
+
//#region ../../node_modules/rolldown/dist/shared/watch-dKH5b9eq.mjs
|
|
6331
6640
|
/**
|
|
6332
6641
|
* This is not the set of all possible signals.
|
|
6333
6642
|
*
|
|
@@ -6534,13 +6843,14 @@ function onExit(...args) {
|
|
|
6534
6843
|
}
|
|
6535
6844
|
require_binding();
|
|
6536
6845
|
//#endregion
|
|
6537
|
-
//#region ../../node_modules/rolldown/dist/shared/rolldown-
|
|
6846
|
+
//#region ../../node_modules/rolldown/dist/shared/rolldown-B-jRyK4b.mjs
|
|
6538
6847
|
var import_binding$1 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
6539
6848
|
var RolldownOutputImpl = class extends PlainObjectLike {
|
|
6540
6849
|
bindingOutputs;
|
|
6541
6850
|
constructor(bindingOutputs) {
|
|
6542
6851
|
super();
|
|
6543
6852
|
this.bindingOutputs = bindingOutputs;
|
|
6853
|
+
if (bindingOutputs.mangleCache !== void 0) this.mangleCache = bindingOutputs.mangleCache;
|
|
6544
6854
|
}
|
|
6545
6855
|
get output() {
|
|
6546
6856
|
return transformToRollupOutput(this.bindingOutputs).output;
|
|
@@ -6653,7 +6963,7 @@ var RolldownBuild = class {
|
|
|
6653
6963
|
async #build(isWrite, outputOptions) {
|
|
6654
6964
|
validateOption("output", outputOptions);
|
|
6655
6965
|
await this.#stopWorkers?.();
|
|
6656
|
-
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
|
|
6966
|
+
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false, true);
|
|
6657
6967
|
try {
|
|
6658
6968
|
this.#stopWorkers = option.stopWorkers;
|
|
6659
6969
|
let output;
|