@coderline/alphatab-vite 1.9.0-alpha.1883 → 1.9.0-alpha.1963
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.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* alphaTab Vite Plugin v1.9.0-alpha.
|
|
2
|
+
* alphaTab Vite Plugin v1.9.0-alpha.1963 (develop, build 1963)
|
|
3
3
|
*
|
|
4
4
|
* Copyright © 2026, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
5
|
*
|
|
@@ -43,7 +43,7 @@ import { formatWithOptions, styleText } from "node:util";
|
|
|
43
43
|
import g$1 from "node:process";
|
|
44
44
|
import * as tty from "node:tty";
|
|
45
45
|
import os from "node:os";
|
|
46
|
-
//#region ../../node_modules/rolldown/dist/shared/binding-
|
|
46
|
+
//#region ../../node_modules/rolldown/dist/shared/binding-DH95uVkp.mjs
|
|
47
47
|
var __create = Object.create;
|
|
48
48
|
var __defProp = Object.defineProperty;
|
|
49
49
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -134,94 +134,97 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
134
134
|
} catch (err) {
|
|
135
135
|
loadErrors.push(err);
|
|
136
136
|
}
|
|
137
|
-
else if (process.platform === "android")
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
137
|
+
else if (process.platform === "android") {
|
|
138
|
+
if (process.arch === "arm64") {
|
|
139
|
+
try {
|
|
140
|
+
return __require("./rolldown-binding.android-arm64.node");
|
|
141
|
+
} catch (e) {
|
|
142
|
+
loadErrors.push(e);
|
|
143
|
+
}
|
|
144
|
+
try {
|
|
145
|
+
const binding = __require("@rolldown/binding-android-arm64");
|
|
146
|
+
const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
|
|
147
|
+
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.`);
|
|
148
|
+
return binding;
|
|
149
|
+
} catch (e) {
|
|
150
|
+
loadErrors.push(e);
|
|
151
|
+
}
|
|
152
|
+
} else if (process.arch === "arm") {
|
|
153
|
+
try {
|
|
154
|
+
return __require("./rolldown-binding.android-arm-eabi.node");
|
|
155
|
+
} catch (e) {
|
|
156
|
+
loadErrors.push(e);
|
|
157
|
+
}
|
|
158
|
+
try {
|
|
159
|
+
const binding = __require("@rolldown/binding-android-arm-eabi");
|
|
160
|
+
const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
|
|
161
|
+
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.`);
|
|
162
|
+
return binding;
|
|
163
|
+
} catch (e) {
|
|
164
|
+
loadErrors.push(e);
|
|
165
|
+
}
|
|
166
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
167
|
+
} else if (process.platform === "win32") {
|
|
168
|
+
if (process.arch === "x64") {
|
|
169
|
+
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") {
|
|
170
|
+
try {
|
|
171
|
+
return __require("./rolldown-binding.win32-x64-gnu.node");
|
|
172
|
+
} catch (e) {
|
|
173
|
+
loadErrors.push(e);
|
|
174
|
+
}
|
|
175
|
+
try {
|
|
176
|
+
const binding = __require("@rolldown/binding-win32-x64-gnu");
|
|
177
|
+
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
|
|
178
|
+
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.`);
|
|
179
|
+
return binding;
|
|
180
|
+
} catch (e) {
|
|
181
|
+
loadErrors.push(e);
|
|
182
|
+
}
|
|
183
|
+
} else {
|
|
184
|
+
try {
|
|
185
|
+
return __require("./rolldown-binding.win32-x64-msvc.node");
|
|
186
|
+
} catch (e) {
|
|
187
|
+
loadErrors.push(e);
|
|
188
|
+
}
|
|
189
|
+
try {
|
|
190
|
+
const binding = __require("@rolldown/binding-win32-x64-msvc");
|
|
191
|
+
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
|
|
192
|
+
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.`);
|
|
193
|
+
return binding;
|
|
194
|
+
} catch (e) {
|
|
195
|
+
loadErrors.push(e);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
} else if (process.arch === "ia32") {
|
|
199
|
+
try {
|
|
200
|
+
return __require("./rolldown-binding.win32-ia32-msvc.node");
|
|
201
|
+
} catch (e) {
|
|
202
|
+
loadErrors.push(e);
|
|
203
|
+
}
|
|
204
|
+
try {
|
|
205
|
+
const binding = __require("@rolldown/binding-win32-ia32-msvc");
|
|
206
|
+
const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
|
|
207
|
+
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.`);
|
|
208
|
+
return binding;
|
|
209
|
+
} catch (e) {
|
|
210
|
+
loadErrors.push(e);
|
|
211
|
+
}
|
|
212
|
+
} else if (process.arch === "arm64") {
|
|
213
|
+
try {
|
|
214
|
+
return __require("./rolldown-binding.win32-arm64-msvc.node");
|
|
215
|
+
} catch (e) {
|
|
216
|
+
loadErrors.push(e);
|
|
217
|
+
}
|
|
218
|
+
try {
|
|
219
|
+
const binding = __require("@rolldown/binding-win32-arm64-msvc");
|
|
220
|
+
const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
|
|
221
|
+
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.`);
|
|
222
|
+
return binding;
|
|
223
|
+
} catch (e) {
|
|
224
|
+
loadErrors.push(e);
|
|
225
|
+
}
|
|
226
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
227
|
+
} else if (process.platform === "darwin") {
|
|
225
228
|
try {
|
|
226
229
|
return __require("./rolldown-binding.darwin-universal.node");
|
|
227
230
|
} catch (e) {
|
|
@@ -230,7 +233,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
230
233
|
try {
|
|
231
234
|
const binding = __require("@rolldown/binding-darwin-universal");
|
|
232
235
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
|
|
233
|
-
if (bindingPackageVersion !== "1.2.
|
|
236
|
+
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.`);
|
|
234
237
|
return binding;
|
|
235
238
|
} catch (e) {
|
|
236
239
|
loadErrors.push(e);
|
|
@@ -244,7 +247,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
244
247
|
try {
|
|
245
248
|
const binding = __require("@rolldown/binding-darwin-x64");
|
|
246
249
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
|
|
247
|
-
if (bindingPackageVersion !== "1.2.
|
|
250
|
+
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.`);
|
|
248
251
|
return binding;
|
|
249
252
|
} catch (e) {
|
|
250
253
|
loadErrors.push(e);
|
|
@@ -258,259 +261,267 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
258
261
|
try {
|
|
259
262
|
const binding = __require("@rolldown/binding-darwin-arm64");
|
|
260
263
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
|
|
261
|
-
if (bindingPackageVersion !== "1.2.
|
|
264
|
+
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.`);
|
|
262
265
|
return binding;
|
|
263
266
|
} catch (e) {
|
|
264
267
|
loadErrors.push(e);
|
|
265
268
|
}
|
|
266
269
|
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
267
|
-
} else if (process.platform === "freebsd")
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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
|
-
|
|
270
|
+
} else if (process.platform === "freebsd") {
|
|
271
|
+
if (process.arch === "x64") {
|
|
272
|
+
try {
|
|
273
|
+
return __require("./rolldown-binding.freebsd-x64.node");
|
|
274
|
+
} catch (e) {
|
|
275
|
+
loadErrors.push(e);
|
|
276
|
+
}
|
|
277
|
+
try {
|
|
278
|
+
const binding = __require("@rolldown/binding-freebsd-x64");
|
|
279
|
+
const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
|
|
280
|
+
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.`);
|
|
281
|
+
return binding;
|
|
282
|
+
} catch (e) {
|
|
283
|
+
loadErrors.push(e);
|
|
284
|
+
}
|
|
285
|
+
} else if (process.arch === "arm64") {
|
|
286
|
+
try {
|
|
287
|
+
return __require("./rolldown-binding.freebsd-arm64.node");
|
|
288
|
+
} catch (e) {
|
|
289
|
+
loadErrors.push(e);
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
const binding = __require("@rolldown/binding-freebsd-arm64");
|
|
293
|
+
const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
|
|
294
|
+
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.`);
|
|
295
|
+
return binding;
|
|
296
|
+
} catch (e) {
|
|
297
|
+
loadErrors.push(e);
|
|
298
|
+
}
|
|
299
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
300
|
+
} else if (process.platform === "linux") {
|
|
301
|
+
if (process.arch === "x64") {
|
|
302
|
+
if (isMusl()) {
|
|
303
|
+
try {
|
|
304
|
+
return __require("./rolldown-binding.linux-x64-musl.node");
|
|
305
|
+
} catch (e) {
|
|
306
|
+
loadErrors.push(e);
|
|
307
|
+
}
|
|
308
|
+
try {
|
|
309
|
+
const binding = __require("@rolldown/binding-linux-x64-musl");
|
|
310
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
|
|
311
|
+
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.`);
|
|
312
|
+
return binding;
|
|
313
|
+
} catch (e) {
|
|
314
|
+
loadErrors.push(e);
|
|
315
|
+
}
|
|
316
|
+
} else {
|
|
317
|
+
try {
|
|
318
|
+
return __require("../rolldown-binding.linux-x64-gnu.node");
|
|
319
|
+
} catch (e) {
|
|
320
|
+
loadErrors.push(e);
|
|
321
|
+
}
|
|
322
|
+
try {
|
|
323
|
+
const binding = __require("@rolldown/binding-linux-x64-gnu");
|
|
324
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
|
|
325
|
+
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.`);
|
|
326
|
+
return binding;
|
|
327
|
+
} catch (e) {
|
|
328
|
+
loadErrors.push(e);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
} else if (process.arch === "arm64") {
|
|
332
|
+
if (isMusl()) {
|
|
333
|
+
try {
|
|
334
|
+
return __require("./rolldown-binding.linux-arm64-musl.node");
|
|
335
|
+
} catch (e) {
|
|
336
|
+
loadErrors.push(e);
|
|
337
|
+
}
|
|
338
|
+
try {
|
|
339
|
+
const binding = __require("@rolldown/binding-linux-arm64-musl");
|
|
340
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
|
|
341
|
+
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.`);
|
|
342
|
+
return binding;
|
|
343
|
+
} catch (e) {
|
|
344
|
+
loadErrors.push(e);
|
|
345
|
+
}
|
|
346
|
+
} else {
|
|
347
|
+
try {
|
|
348
|
+
return __require("./rolldown-binding.linux-arm64-gnu.node");
|
|
349
|
+
} catch (e) {
|
|
350
|
+
loadErrors.push(e);
|
|
351
|
+
}
|
|
352
|
+
try {
|
|
353
|
+
const binding = __require("@rolldown/binding-linux-arm64-gnu");
|
|
354
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
|
|
355
|
+
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.`);
|
|
356
|
+
return binding;
|
|
357
|
+
} catch (e) {
|
|
358
|
+
loadErrors.push(e);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
} else if (process.arch === "arm") {
|
|
362
|
+
if (isMusl()) {
|
|
363
|
+
try {
|
|
364
|
+
return __require("./rolldown-binding.linux-arm-musleabihf.node");
|
|
365
|
+
} catch (e) {
|
|
366
|
+
loadErrors.push(e);
|
|
367
|
+
}
|
|
368
|
+
try {
|
|
369
|
+
const binding = __require("@rolldown/binding-linux-arm-musleabihf");
|
|
370
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
|
|
371
|
+
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.`);
|
|
372
|
+
return binding;
|
|
373
|
+
} catch (e) {
|
|
374
|
+
loadErrors.push(e);
|
|
375
|
+
}
|
|
376
|
+
} else {
|
|
377
|
+
try {
|
|
378
|
+
return __require("./rolldown-binding.linux-arm-gnueabihf.node");
|
|
379
|
+
} catch (e) {
|
|
380
|
+
loadErrors.push(e);
|
|
381
|
+
}
|
|
382
|
+
try {
|
|
383
|
+
const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
|
|
384
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
|
|
385
|
+
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.`);
|
|
386
|
+
return binding;
|
|
387
|
+
} catch (e) {
|
|
388
|
+
loadErrors.push(e);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
} else if (process.arch === "loong64") {
|
|
392
|
+
if (isMusl()) {
|
|
393
|
+
try {
|
|
394
|
+
return __require("./rolldown-binding.linux-loong64-musl.node");
|
|
395
|
+
} catch (e) {
|
|
396
|
+
loadErrors.push(e);
|
|
397
|
+
}
|
|
398
|
+
try {
|
|
399
|
+
const binding = __require("@rolldown/binding-linux-loong64-musl");
|
|
400
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
|
|
401
|
+
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.`);
|
|
402
|
+
return binding;
|
|
403
|
+
} catch (e) {
|
|
404
|
+
loadErrors.push(e);
|
|
405
|
+
}
|
|
406
|
+
} else {
|
|
407
|
+
try {
|
|
408
|
+
return __require("./rolldown-binding.linux-loong64-gnu.node");
|
|
409
|
+
} catch (e) {
|
|
410
|
+
loadErrors.push(e);
|
|
411
|
+
}
|
|
412
|
+
try {
|
|
413
|
+
const binding = __require("@rolldown/binding-linux-loong64-gnu");
|
|
414
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
|
|
415
|
+
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.`);
|
|
416
|
+
return binding;
|
|
417
|
+
} catch (e) {
|
|
418
|
+
loadErrors.push(e);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
} else if (process.arch === "riscv64") {
|
|
422
|
+
if (isMusl()) {
|
|
423
|
+
try {
|
|
424
|
+
return __require("./rolldown-binding.linux-riscv64-musl.node");
|
|
425
|
+
} catch (e) {
|
|
426
|
+
loadErrors.push(e);
|
|
427
|
+
}
|
|
428
|
+
try {
|
|
429
|
+
const binding = __require("@rolldown/binding-linux-riscv64-musl");
|
|
430
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
|
|
431
|
+
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.`);
|
|
432
|
+
return binding;
|
|
433
|
+
} catch (e) {
|
|
434
|
+
loadErrors.push(e);
|
|
435
|
+
}
|
|
436
|
+
} else {
|
|
437
|
+
try {
|
|
438
|
+
return __require("./rolldown-binding.linux-riscv64-gnu.node");
|
|
439
|
+
} catch (e) {
|
|
440
|
+
loadErrors.push(e);
|
|
441
|
+
}
|
|
442
|
+
try {
|
|
443
|
+
const binding = __require("@rolldown/binding-linux-riscv64-gnu");
|
|
444
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
|
|
445
|
+
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.`);
|
|
446
|
+
return binding;
|
|
447
|
+
} catch (e) {
|
|
448
|
+
loadErrors.push(e);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
} else if (process.arch === "ppc64") {
|
|
452
|
+
try {
|
|
453
|
+
return __require("./rolldown-binding.linux-ppc64-gnu.node");
|
|
454
|
+
} catch (e) {
|
|
455
|
+
loadErrors.push(e);
|
|
456
|
+
}
|
|
457
|
+
try {
|
|
458
|
+
const binding = __require("@rolldown/binding-linux-ppc64-gnu");
|
|
459
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
|
|
460
|
+
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.`);
|
|
461
|
+
return binding;
|
|
462
|
+
} catch (e) {
|
|
463
|
+
loadErrors.push(e);
|
|
464
|
+
}
|
|
465
|
+
} else if (process.arch === "s390x") {
|
|
466
|
+
try {
|
|
467
|
+
return __require("./rolldown-binding.linux-s390x-gnu.node");
|
|
468
|
+
} catch (e) {
|
|
469
|
+
loadErrors.push(e);
|
|
470
|
+
}
|
|
471
|
+
try {
|
|
472
|
+
const binding = __require("@rolldown/binding-linux-s390x-gnu");
|
|
473
|
+
const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
|
|
474
|
+
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.`);
|
|
475
|
+
return binding;
|
|
476
|
+
} catch (e) {
|
|
477
|
+
loadErrors.push(e);
|
|
478
|
+
}
|
|
479
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
480
|
+
} else if (process.platform === "openharmony") {
|
|
481
|
+
if (process.arch === "arm64") {
|
|
482
|
+
try {
|
|
483
|
+
return __require("./rolldown-binding.openharmony-arm64.node");
|
|
484
|
+
} catch (e) {
|
|
485
|
+
loadErrors.push(e);
|
|
486
|
+
}
|
|
487
|
+
try {
|
|
488
|
+
const binding = __require("@rolldown/binding-openharmony-arm64");
|
|
489
|
+
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
|
|
490
|
+
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.`);
|
|
491
|
+
return binding;
|
|
492
|
+
} catch (e) {
|
|
493
|
+
loadErrors.push(e);
|
|
494
|
+
}
|
|
495
|
+
} else if (process.arch === "x64") {
|
|
496
|
+
try {
|
|
497
|
+
return __require("./rolldown-binding.openharmony-x64.node");
|
|
498
|
+
} catch (e) {
|
|
499
|
+
loadErrors.push(e);
|
|
500
|
+
}
|
|
501
|
+
try {
|
|
502
|
+
const binding = __require("@rolldown/binding-openharmony-x64");
|
|
503
|
+
const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
|
|
504
|
+
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.`);
|
|
505
|
+
return binding;
|
|
506
|
+
} catch (e) {
|
|
507
|
+
loadErrors.push(e);
|
|
508
|
+
}
|
|
509
|
+
} else if (process.arch === "arm") {
|
|
510
|
+
try {
|
|
511
|
+
return __require("./rolldown-binding.openharmony-arm.node");
|
|
512
|
+
} catch (e) {
|
|
513
|
+
loadErrors.push(e);
|
|
514
|
+
}
|
|
515
|
+
try {
|
|
516
|
+
const binding = __require("@rolldown/binding-openharmony-arm");
|
|
517
|
+
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
|
|
518
|
+
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.`);
|
|
519
|
+
return binding;
|
|
520
|
+
} catch (e) {
|
|
521
|
+
loadErrors.push(e);
|
|
522
|
+
}
|
|
523
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
524
|
+
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
514
525
|
}
|
|
515
526
|
function createLoadErrorChain(errors) {
|
|
516
527
|
return errors.reduce((previous, current) => {
|
|
@@ -594,7 +605,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
594
605
|
if (!candidateFailed) {
|
|
595
606
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
|
|
596
607
|
const bindingPackageVersion = __require("@rolldown/binding-wasm32-wasi/package.json").version;
|
|
597
|
-
if (bindingPackageVersion !== "1.2.
|
|
608
|
+
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.`);
|
|
598
609
|
}
|
|
599
610
|
wasiBinding = __require("@rolldown/binding-wasm32-wasi");
|
|
600
611
|
nativeBinding = wasiBinding;
|
|
@@ -692,8 +703,10 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
692
703
|
module.exports.enhancedTransform = nativeBinding.enhancedTransform;
|
|
693
704
|
module.exports.enhancedTransformSync = nativeBinding.enhancedTransformSync;
|
|
694
705
|
module.exports.FilterTokenKind = nativeBinding.FilterTokenKind;
|
|
706
|
+
module.exports.getNativeMemoryStats = nativeBinding.getNativeMemoryStats;
|
|
695
707
|
module.exports.initTraceSubscriber = nativeBinding.initTraceSubscriber;
|
|
696
708
|
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
|
709
|
+
module.exports.resetNativeMemoryStats = nativeBinding.resetNativeMemoryStats;
|
|
697
710
|
module.exports.resolveTsconfig = nativeBinding.resolveTsconfig;
|
|
698
711
|
module.exports.shutdownAsyncRuntime = nativeBinding.shutdownAsyncRuntime;
|
|
699
712
|
module.exports.startAsyncRuntime = nativeBinding.startAsyncRuntime;
|
|
@@ -941,7 +954,7 @@ function isPathFragment(name) {
|
|
|
941
954
|
return name[0] === "/" || name[0] === "." && (name[1] === "/" || name[1] === ".") || ABSOLUTE_PATH_REGEX.test(name);
|
|
942
955
|
}
|
|
943
956
|
//#endregion
|
|
944
|
-
//#region ../../node_modules/rolldown/dist/shared/error-
|
|
957
|
+
//#region ../../node_modules/rolldown/dist/shared/error-CRNyaqoL.mjs
|
|
945
958
|
function bindingifySourcemap$1(map) {
|
|
946
959
|
if (map == null) return;
|
|
947
960
|
return { inner: typeof map === "string" ? map : {
|
|
@@ -1020,7 +1033,7 @@ function joinNewLine(s1, s2) {
|
|
|
1020
1033
|
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
|
1021
1034
|
}
|
|
1022
1035
|
//#endregion
|
|
1023
|
-
//#region ../../node_modules/rolldown/dist/shared/parse-
|
|
1036
|
+
//#region ../../node_modules/rolldown/dist/shared/parse-BtiCBYra.mjs
|
|
1024
1037
|
var import_binding$5 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
1025
1038
|
function wrap$1(result) {
|
|
1026
1039
|
let program, module, comments, errors;
|
|
@@ -1203,7 +1216,7 @@ function exclude(expr) {
|
|
|
1203
1216
|
*
|
|
1204
1217
|
* @category Plugin APIs
|
|
1205
1218
|
*/
|
|
1206
|
-
var VERSION = "1.2.
|
|
1219
|
+
var VERSION = "1.2.8";
|
|
1207
1220
|
var LOG_LEVEL_SILENT = "silent";
|
|
1208
1221
|
var LOG_LEVEL_WARN = "warn";
|
|
1209
1222
|
var LOG_LEVEL_INFO = "info";
|
|
@@ -1674,7 +1687,9 @@ function transformToMutableRollupOutputAsset(bindingAsset, changed) {
|
|
|
1674
1687
|
}
|
|
1675
1688
|
function transformToRollupOutput(output) {
|
|
1676
1689
|
const { chunks, assets } = output;
|
|
1677
|
-
|
|
1690
|
+
const transformed = { output: [...chunks.map((chunk) => transformToRollupOutputChunk(chunk)), ...assets.map((asset) => transformToRollupOutputAsset(asset))] };
|
|
1691
|
+
if (output.mangleCache !== void 0) transformed.mangleCache = output.mangleCache;
|
|
1692
|
+
return transformed;
|
|
1678
1693
|
}
|
|
1679
1694
|
function transformToMutableRollupOutput(output, changed) {
|
|
1680
1695
|
const { chunks, assets } = output;
|
|
@@ -2902,7 +2917,218 @@ function extractHookUsage(plugin) {
|
|
|
2902
2917
|
if (plugin.hotUpdate) hookUsage.union(4194304);
|
|
2903
2918
|
return hookUsage;
|
|
2904
2919
|
}
|
|
2905
|
-
|
|
2920
|
+
/**
|
|
2921
|
+
* Measure what plugin hooks cost, from inside the JavaScript callback.
|
|
2922
|
+
*
|
|
2923
|
+
* Internal to Rolldown. Nothing here is on a public entry point, and the measurement is not
|
|
2924
|
+
* offered as an API — the only consumer is the core, which pulls it while the build closes.
|
|
2925
|
+
*
|
|
2926
|
+
* The bundler core can only bracket *dispatch* and *completion*. For a hook it invokes
|
|
2927
|
+
* concurrently those two points are separated mostly by the queue the call waited in on
|
|
2928
|
+
* JavaScript's single thread, and the queue is deepest behind whichever callback is doing
|
|
2929
|
+
* the most work — so the hook blocking the thread dilutes its own credit while cheap hooks
|
|
2930
|
+
* collect credit for waiting. Ranking from those numbers reliably puts the *cheapest* hook
|
|
2931
|
+
* first.
|
|
2932
|
+
*
|
|
2933
|
+
* The missing quantity is when the callback began running, and that is known here. Starting
|
|
2934
|
+
* the clock inside the callback removes the dispatch queue by construction.
|
|
2935
|
+
*
|
|
2936
|
+
* ## `maxInFlight` decides whether a total means anything
|
|
2937
|
+
*
|
|
2938
|
+
* Entry-to-exit spans may be summed only if they never overlap. A synchronous callback
|
|
2939
|
+
* cannot overlap: it holds the thread until it returns. An `async` one can — it may suspend
|
|
2940
|
+
* at an `await` and let another call of the same hook begin, and then both spans cover the
|
|
2941
|
+
* same wall clock and the sum counts it twice.
|
|
2942
|
+
*
|
|
2943
|
+
* Overlap also changes what the span is measuring. A hook that awaits the bundler (say
|
|
2944
|
+
* `this.resolve`) spends most of its span waiting for Rust, so the number describes the
|
|
2945
|
+
* bundler rather than the plugin. Observed on a real build: one `resolveId` accumulated
|
|
2946
|
+
* ~47,000s of span inside a 44s module-loading window.
|
|
2947
|
+
*
|
|
2948
|
+
* So overlap is measured rather than assumed, per hook: `overlapMs` is the wall time
|
|
2949
|
+
* double counted in `ms` because two or more calls were in flight together. A hook is
|
|
2950
|
+
* reported with a number when that is a negligible share of its span, and named without one
|
|
2951
|
+
* when it is not.
|
|
2952
|
+
*
|
|
2953
|
+
* The test is deliberately a tolerance rather than "did this ever happen". A peak in-flight
|
|
2954
|
+
* count of 2 can mean one incidental overlap in twenty thousand calls, and discarding a
|
|
2955
|
+
* twelve-second measurement over that both throws away good data and makes the report
|
|
2956
|
+
* depend on scheduling luck — the same hook would appear in one run and vanish in the next.
|
|
2957
|
+
*
|
|
2958
|
+
* This keeps the rule the core followed — never present a number that cannot be defended —
|
|
2959
|
+
* while narrowing "cannot measure" from a property of the *call site* to a property of the
|
|
2960
|
+
* *callback*, which is where it actually lives. A hook dispatched concurrently but whose
|
|
2961
|
+
* body barely overlaps is measured to within the tolerance.
|
|
2962
|
+
*
|
|
2963
|
+
* A measured row is still wall time for that callback rather than CPU: a hook that awaits
|
|
2964
|
+
* I/O without overlapping another call of itself is charged for the wait. Excluding the
|
|
2965
|
+
* dispatch queue is what this buys; it does not distinguish running from awaiting.
|
|
2966
|
+
*/
|
|
2967
|
+
/**
|
|
2968
|
+
* How much of a hook's span may be double counted before its total stops being reportable,
|
|
2969
|
+
* as a fraction of that span.
|
|
2970
|
+
*/
|
|
2971
|
+
var OVERLAP_TOLERANCE = .01;
|
|
2972
|
+
/**
|
|
2973
|
+
* One recorder per build, keyed on the object that identifies it.
|
|
2974
|
+
*
|
|
2975
|
+
* Counters cannot be module-global. A plugin is free to run a nested `rolldown()` build of
|
|
2976
|
+
* its own, which finishes first; shared counters would let it flush the outer build's
|
|
2977
|
+
* half-accumulated totals and report a window belonging to neither.
|
|
2978
|
+
*/
|
|
2979
|
+
var recorders = /* @__PURE__ */ new WeakMap();
|
|
2980
|
+
/** The recorder for one build, created on first use. */
|
|
2981
|
+
function pluginTimingsRecorderFor(key) {
|
|
2982
|
+
let recorder = recorders.get(key);
|
|
2983
|
+
if (recorder === void 0) {
|
|
2984
|
+
recorder = {
|
|
2985
|
+
costs: /* @__PURE__ */ new Map(),
|
|
2986
|
+
busyMs: 0,
|
|
2987
|
+
inFlight: 0,
|
|
2988
|
+
busyStart: 0
|
|
2989
|
+
};
|
|
2990
|
+
recorders.set(key, recorder);
|
|
2991
|
+
}
|
|
2992
|
+
return recorder;
|
|
2993
|
+
}
|
|
2994
|
+
function costFor(recorder, owner, hookName) {
|
|
2995
|
+
let byHook = recorder.costs.get(owner.key);
|
|
2996
|
+
if (byHook === void 0) {
|
|
2997
|
+
byHook = /* @__PURE__ */ new Map();
|
|
2998
|
+
recorder.costs.set(owner.key, byHook);
|
|
2999
|
+
}
|
|
3000
|
+
let cost = byHook.get(hookName);
|
|
3001
|
+
if (cost === void 0) {
|
|
3002
|
+
cost = {
|
|
3003
|
+
owner: owner.name,
|
|
3004
|
+
kind: owner.kind,
|
|
3005
|
+
hookName,
|
|
3006
|
+
calls: 0,
|
|
3007
|
+
ms: 0,
|
|
3008
|
+
inFlight: 0,
|
|
3009
|
+
maxInFlight: 0,
|
|
3010
|
+
overlapMs: 0,
|
|
3011
|
+
lastChange: 0
|
|
3012
|
+
};
|
|
3013
|
+
byHook.set(hookName, cost);
|
|
3014
|
+
}
|
|
3015
|
+
return cost;
|
|
3016
|
+
}
|
|
3017
|
+
/**
|
|
3018
|
+
* Fold the interval since the last in-flight change into `overlapMs`, then move the mark.
|
|
3019
|
+
* Call immediately before every increment and decrement of `cost.inFlight`.
|
|
3020
|
+
*/
|
|
3021
|
+
function markInFlightChange(cost, at) {
|
|
3022
|
+
if (cost.inFlight > 1) cost.overlapMs += (cost.inFlight - 1) * (at - cost.lastChange);
|
|
3023
|
+
cost.lastChange = at;
|
|
3024
|
+
}
|
|
3025
|
+
/**
|
|
3026
|
+
* Close out one call. A module-level function rather than a closure per invocation: hooks
|
|
3027
|
+
* run hundreds of thousands of times in a large build, and the synchronous path would
|
|
3028
|
+
* otherwise allocate one closure per call only to invoke it immediately.
|
|
3029
|
+
*/
|
|
3030
|
+
function settle(recorder, cost, started) {
|
|
3031
|
+
const ended = performance.now();
|
|
3032
|
+
markInFlightChange(cost, ended);
|
|
3033
|
+
cost.inFlight -= 1;
|
|
3034
|
+
cost.ms += ended - started;
|
|
3035
|
+
recorder.inFlight -= 1;
|
|
3036
|
+
if (recorder.inFlight === 0) recorder.busyMs += ended - recorder.busyStart;
|
|
3037
|
+
}
|
|
3038
|
+
/**
|
|
3039
|
+
* Wrap one callback so its execution time is recorded.
|
|
3040
|
+
*
|
|
3041
|
+
* Returns the callback untouched when there is no recorder, so a build that is not
|
|
3042
|
+
* measuring pays nothing beyond one branch at setup.
|
|
3043
|
+
*/
|
|
3044
|
+
function measureHookCost(recorder, owner, hookName, handler) {
|
|
3045
|
+
if (recorder === void 0) return handler;
|
|
3046
|
+
const cost = costFor(recorder, owner, hookName);
|
|
3047
|
+
return function(...args) {
|
|
3048
|
+
const started = performance.now();
|
|
3049
|
+
markInFlightChange(cost, started);
|
|
3050
|
+
cost.calls += 1;
|
|
3051
|
+
cost.inFlight += 1;
|
|
3052
|
+
if (cost.inFlight > cost.maxInFlight) cost.maxInFlight = cost.inFlight;
|
|
3053
|
+
if (recorder.inFlight === 0) recorder.busyStart = started;
|
|
3054
|
+
recorder.inFlight += 1;
|
|
3055
|
+
let result;
|
|
3056
|
+
try {
|
|
3057
|
+
result = handler.apply(this, args);
|
|
3058
|
+
} catch (error) {
|
|
3059
|
+
settle(recorder, cost, started);
|
|
3060
|
+
throw error;
|
|
3061
|
+
}
|
|
3062
|
+
if (typeof result?.then === "function") return result.then((value) => {
|
|
3063
|
+
settle(recorder, cost, started);
|
|
3064
|
+
return value;
|
|
3065
|
+
}, (error) => {
|
|
3066
|
+
settle(recorder, cost, started);
|
|
3067
|
+
throw error;
|
|
3068
|
+
});
|
|
3069
|
+
settle(recorder, cost, started);
|
|
3070
|
+
return result;
|
|
3071
|
+
};
|
|
3072
|
+
}
|
|
3073
|
+
/**
|
|
3074
|
+
* The owner shown for user callbacks the core invokes directly rather than through a
|
|
3075
|
+
* plugin. One shared identity: they are all configured on the same options object.
|
|
3076
|
+
*/
|
|
3077
|
+
var OUTPUT_OPTIONS_OWNER = {
|
|
3078
|
+
key: Symbol("output options"),
|
|
3079
|
+
name: "output options",
|
|
3080
|
+
kind: "outputOption"
|
|
3081
|
+
};
|
|
3082
|
+
/** As {@link OUTPUT_OPTIONS_OWNER}, for callbacks configured on the input options. */
|
|
3083
|
+
var INPUT_OPTIONS_OWNER = {
|
|
3084
|
+
key: Symbol("input options"),
|
|
3085
|
+
name: "input options",
|
|
3086
|
+
kind: "inputOption"
|
|
3087
|
+
};
|
|
3088
|
+
/**
|
|
3089
|
+
* Wrap `value` when the user supplied a function, and leave every other form alone.
|
|
3090
|
+
*
|
|
3091
|
+
* Most option callbacks are declared as `string | RegExp | Function | ...`, so this keeps
|
|
3092
|
+
* the one cast the wrapping needs in a single place.
|
|
3093
|
+
*/
|
|
3094
|
+
function measureIfFunction(recorder, owner, hookName, value) {
|
|
3095
|
+
if (typeof value !== "function") return value;
|
|
3096
|
+
return measureHookCost(recorder, owner, hookName, value);
|
|
3097
|
+
}
|
|
3098
|
+
/**
|
|
3099
|
+
* What the build's callbacks have cost so far, leaving the recorder in place.
|
|
3100
|
+
*
|
|
3101
|
+
* Ungated on purpose: whether a build is worth reporting on is decided from the clocks Rust
|
|
3102
|
+
* holds, so the question is not this side's to ask.
|
|
3103
|
+
*
|
|
3104
|
+
* Rust calls this while the build is closing, so what it gets includes `closeBundle`.
|
|
3105
|
+
*/
|
|
3106
|
+
function summarizePluginTimings(key) {
|
|
3107
|
+
const recorder = recorders.get(key);
|
|
3108
|
+
if (recorder === void 0) return {
|
|
3109
|
+
busyMs: 0,
|
|
3110
|
+
rows: []
|
|
3111
|
+
};
|
|
3112
|
+
const rows = [];
|
|
3113
|
+
for (const byHook of recorder.costs.values()) for (const cost of byHook.values()) {
|
|
3114
|
+
if (cost.calls === 0) continue;
|
|
3115
|
+
rows.push({
|
|
3116
|
+
owner: cost.owner,
|
|
3117
|
+
kind: cost.kind,
|
|
3118
|
+
hook: cost.hookName,
|
|
3119
|
+
calls: cost.calls,
|
|
3120
|
+
ms: cost.ms,
|
|
3121
|
+
maxInFlight: cost.maxInFlight,
|
|
3122
|
+
overlapMs: cost.overlapMs,
|
|
3123
|
+
rankable: cost.overlapMs <= cost.ms * OVERLAP_TOLERANCE
|
|
3124
|
+
});
|
|
3125
|
+
}
|
|
3126
|
+
return {
|
|
3127
|
+
busyMs: recorder.busyMs,
|
|
3128
|
+
rows
|
|
3129
|
+
};
|
|
3130
|
+
}
|
|
3131
|
+
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings) {
|
|
2906
3132
|
const args = {
|
|
2907
3133
|
plugin,
|
|
2908
3134
|
options,
|
|
@@ -2936,7 +3162,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
2936
3162
|
const { plugin: hotUpdate, meta: hotUpdateMeta } = bindingifyHotUpdate(args);
|
|
2937
3163
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
|
|
2938
3164
|
let hookUsage = extractHookUsage(plugin).inner();
|
|
2939
|
-
|
|
3165
|
+
const result = {
|
|
2940
3166
|
name: plugin.name,
|
|
2941
3167
|
buildStart,
|
|
2942
3168
|
buildStartMeta,
|
|
@@ -2987,9 +3213,14 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
2987
3213
|
closeWatcher,
|
|
2988
3214
|
closeWatcherMeta,
|
|
2989
3215
|
hookUsage
|
|
2990
|
-
}
|
|
3216
|
+
};
|
|
3217
|
+
return wrapHandlers(result, {
|
|
3218
|
+
key: plugin,
|
|
3219
|
+
name: result.name,
|
|
3220
|
+
kind: "plugin"
|
|
3221
|
+
}, timings);
|
|
2991
3222
|
}
|
|
2992
|
-
function wrapHandlers(plugin) {
|
|
3223
|
+
function wrapHandlers(plugin, owner, timings) {
|
|
2993
3224
|
for (const hookName of [
|
|
2994
3225
|
"buildStart",
|
|
2995
3226
|
"resolveId",
|
|
@@ -3014,7 +3245,8 @@ function wrapHandlers(plugin) {
|
|
|
3014
3245
|
"hotUpdate",
|
|
3015
3246
|
"closeWatcher"
|
|
3016
3247
|
]) {
|
|
3017
|
-
const
|
|
3248
|
+
const raw = plugin[hookName];
|
|
3249
|
+
const handler = raw && measureHookCost(timings, owner, hookName, raw);
|
|
3018
3250
|
if (handler) plugin[hookName] = async (...args) => {
|
|
3019
3251
|
try {
|
|
3020
3252
|
return await handler(...args);
|
|
@@ -3054,32 +3286,32 @@ function normalizeTransformOptions(inputOptions) {
|
|
|
3054
3286
|
};
|
|
3055
3287
|
}
|
|
3056
3288
|
function getDefaultDevRuntime(host = "localhost", port = 3e3) {
|
|
3057
|
-
const runtimeEntry = fs.readFileSync(fileURLToPath(import.meta.resolve("
|
|
3289
|
+
const runtimeEntry = fs.readFileSync(fileURLToPath(import.meta.resolve("#runtime")), "utf8");
|
|
3058
3290
|
const runtimeHelperImportEnd = runtimeEntry.indexOf("\n");
|
|
3059
3291
|
if (!runtimeEntry.startsWith("import ") || runtimeHelperImportEnd === -1) throw new Error("Expected the standalone runtime to start with a helper import");
|
|
3060
3292
|
return `${runtimeEntry.slice(runtimeHelperImportEnd + 1)}\n${fs.readFileSync(fileURLToPath(import.meta.resolve("#default-runtime")), "utf8").replaceAll("$ADDR", `${host}:${port}`)}`;
|
|
3061
3293
|
}
|
|
3062
|
-
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
3294
|
+
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings) {
|
|
3063
3295
|
const plugins = rawPlugins.map((plugin) => {
|
|
3064
3296
|
if (getParallelPluginInfo(plugin)) return;
|
|
3065
3297
|
if (plugin instanceof BuiltinPlugin) switch (plugin.name) {
|
|
3066
3298
|
case "builtin:vite-manifest": return bindingifyManifestPlugin(plugin, pluginContextData);
|
|
3067
3299
|
default: return bindingifyBuiltInPlugin(plugin);
|
|
3068
3300
|
}
|
|
3069
|
-
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
3301
|
+
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings);
|
|
3070
3302
|
});
|
|
3071
3303
|
const normalizedTransform = normalizeTransformOptions(inputOptions);
|
|
3072
3304
|
return {
|
|
3073
3305
|
input: bindingifyInput(inputOptions.input),
|
|
3074
3306
|
plugins,
|
|
3075
3307
|
cwd: inputOptions.cwd ?? process.cwd(),
|
|
3076
|
-
external: bindingifyExternal(inputOptions.external),
|
|
3308
|
+
external: bindingifyExternal(inputOptions.external, timings),
|
|
3077
3309
|
resolve: bindingifyResolve(inputOptions.resolve),
|
|
3078
3310
|
platform: inputOptions.platform,
|
|
3079
3311
|
shimMissingExports: inputOptions.shimMissingExports,
|
|
3080
3312
|
logLevel: bindingifyLogLevel(logLevel),
|
|
3081
3313
|
onLog,
|
|
3082
|
-
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
|
|
3314
|
+
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake, timings),
|
|
3083
3315
|
moduleTypes: inputOptions.moduleTypes,
|
|
3084
3316
|
define: normalizedTransform.define,
|
|
3085
3317
|
inject: bindingifyInject(normalizedTransform.inject),
|
|
@@ -3090,6 +3322,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginC
|
|
|
3090
3322
|
dropLabels: normalizedTransform.dropLabels,
|
|
3091
3323
|
keepNames: outputOptions.keepNames,
|
|
3092
3324
|
checks: inputOptions.checks,
|
|
3325
|
+
pluginTimings: timings ? () => summarizePluginTimings(inputOptions) : void 0,
|
|
3093
3326
|
deferSyncScanData: () => {
|
|
3094
3327
|
let ret = [];
|
|
3095
3328
|
pluginContextData.moduleOptionMap.forEach((value, key) => {
|
|
@@ -3131,12 +3364,15 @@ function bindingifyAttachDebugInfo(attachDebugInfo) {
|
|
|
3131
3364
|
case "none": return import_binding$4.BindingAttachDebugInfo.None;
|
|
3132
3365
|
}
|
|
3133
3366
|
}
|
|
3134
|
-
function bindingifyExternal(external) {
|
|
3367
|
+
function bindingifyExternal(external, timings) {
|
|
3135
3368
|
if (external) {
|
|
3136
|
-
if (typeof external === "function")
|
|
3137
|
-
|
|
3138
|
-
return
|
|
3139
|
-
|
|
3369
|
+
if (typeof external === "function") {
|
|
3370
|
+
const measured = measureHookCost(timings, INPUT_OPTIONS_OWNER, "external", external);
|
|
3371
|
+
return (id, importer, isResolved) => {
|
|
3372
|
+
if (id.startsWith("\0")) return false;
|
|
3373
|
+
return measured(id, importer, isResolved) ?? false;
|
|
3374
|
+
};
|
|
3375
|
+
}
|
|
3140
3376
|
return arraify(external);
|
|
3141
3377
|
}
|
|
3142
3378
|
}
|
|
@@ -3227,11 +3463,7 @@ function bindingifyInput(input) {
|
|
|
3227
3463
|
}
|
|
3228
3464
|
function bindingifyWatch(watch) {
|
|
3229
3465
|
if (watch) {
|
|
3230
|
-
|
|
3231
|
-
const watcher = {
|
|
3232
|
-
...watch.notify,
|
|
3233
|
-
...watch.watcher
|
|
3234
|
-
};
|
|
3466
|
+
const watcher = watch.watcher ?? {};
|
|
3235
3467
|
return {
|
|
3236
3468
|
buildDelay: watch.buildDelay,
|
|
3237
3469
|
skipWrite: watch.skipWrite,
|
|
@@ -3247,7 +3479,7 @@ function bindingifyWatch(watch) {
|
|
|
3247
3479
|
};
|
|
3248
3480
|
}
|
|
3249
3481
|
}
|
|
3250
|
-
function bindingifyTreeshakeOptions(config) {
|
|
3482
|
+
function bindingifyTreeshakeOptions(config, timings) {
|
|
3251
3483
|
if (config === false) return;
|
|
3252
3484
|
if (config === true || config === void 0) return { moduleSideEffects: true };
|
|
3253
3485
|
let normalizedConfig = {
|
|
@@ -3278,7 +3510,7 @@ function bindingifyTreeshakeOptions(config) {
|
|
|
3278
3510
|
external: false,
|
|
3279
3511
|
sideEffects: true
|
|
3280
3512
|
}];
|
|
3281
|
-
else normalizedConfig.moduleSideEffects = config.moduleSideEffects;
|
|
3513
|
+
else normalizedConfig.moduleSideEffects = measureIfFunction(timings, INPUT_OPTIONS_OWNER, "treeshake.moduleSideEffects", config.moduleSideEffects);
|
|
3282
3514
|
return normalizedConfig;
|
|
3283
3515
|
}
|
|
3284
3516
|
function bindingifyMakeAbsoluteExternalsRelative(makeAbsoluteExternalsRelative) {
|
|
@@ -3300,7 +3532,7 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
|
|
|
3300
3532
|
};
|
|
3301
3533
|
}
|
|
3302
3534
|
//#endregion
|
|
3303
|
-
//#region ../../node_modules/rolldown/dist/shared/create-bundler-option-
|
|
3535
|
+
//#region ../../node_modules/rolldown/dist/shared/create-bundler-option-kXHnIt4b.mjs
|
|
3304
3536
|
function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
3305
3537
|
const minimalPriority = logLevelPriority[logLevel];
|
|
3306
3538
|
const logger = (level, log, skipped = /* @__PURE__ */ new Set()) => {
|
|
@@ -3319,7 +3551,7 @@ function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
|
3319
3551
|
info: getLogHandler("info"),
|
|
3320
3552
|
meta: {
|
|
3321
3553
|
rollupVersion: "4.23.0",
|
|
3322
|
-
rolldownVersion: "1.2.
|
|
3554
|
+
rolldownVersion: "1.2.8",
|
|
3323
3555
|
watchMode
|
|
3324
3556
|
},
|
|
3325
3557
|
warn: getLogHandler("warn"),
|
|
@@ -4711,7 +4943,8 @@ var ChecksOptionsSchema = /* @__PURE__ */ strictObject({
|
|
|
4711
4943
|
unsupportedTsconfigOption: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a tsconfig option or combination of options is not supported")),
|
|
4712
4944
|
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")),
|
|
4713
4945
|
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)")),
|
|
4714
|
-
sourcemapBroken: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a plugin transforms code without generating a sourcemap"))
|
|
4946
|
+
sourcemapBroken: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a plugin transforms code without generating a sourcemap")),
|
|
4947
|
+
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"))
|
|
4715
4948
|
});
|
|
4716
4949
|
var MinifyOptionsSchema = /* @__PURE__ */ strictObject({
|
|
4717
4950
|
compress: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
|
|
@@ -4745,6 +4978,14 @@ var MinifyOptionsSchema = /* @__PURE__ */ strictObject({
|
|
|
4745
4978
|
reserved: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
4746
4979
|
debug: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
4747
4980
|
})])),
|
|
4981
|
+
mangleProps: /* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
|
|
4982
|
+
include: /* @__PURE__ */ instance(RegExp),
|
|
4983
|
+
exclude: /* @__PURE__ */ optional(/* @__PURE__ */ instance(RegExp)),
|
|
4984
|
+
reserved: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
4985
|
+
quoted: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
4986
|
+
debug: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
4987
|
+
cache: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ literal(false)])))
|
|
4988
|
+
})),
|
|
4748
4989
|
codegen: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
|
|
4749
4990
|
removeWhitespace: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
4750
4991
|
legalComments: /* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
@@ -5076,13 +5317,31 @@ function validateOption(key, options) {
|
|
|
5076
5317
|
var ChunkingContextImpl = class {
|
|
5077
5318
|
context;
|
|
5078
5319
|
pluginContextData;
|
|
5320
|
+
moduleInfoCache = /* @__PURE__ */ new Map();
|
|
5079
5321
|
constructor(context, pluginContextData) {
|
|
5080
5322
|
this.context = context;
|
|
5081
5323
|
this.pluginContextData = pluginContextData;
|
|
5082
5324
|
}
|
|
5325
|
+
clearModuleInfoCache() {
|
|
5326
|
+
this.moduleInfoCache = void 0;
|
|
5327
|
+
}
|
|
5083
5328
|
getModuleInfo(moduleId) {
|
|
5329
|
+
const cached = this.moduleInfoCache?.get(moduleId);
|
|
5330
|
+
if (cached) return cached;
|
|
5084
5331
|
const bindingInfo = this.context.getModuleInfo(moduleId);
|
|
5085
|
-
if (bindingInfo)
|
|
5332
|
+
if (bindingInfo) {
|
|
5333
|
+
const option = this.pluginContextData.getModuleOption(moduleId);
|
|
5334
|
+
const info = transformModuleInfo(bindingInfo, option);
|
|
5335
|
+
Object.defineProperty(info, "moduleSideEffects", {
|
|
5336
|
+
get: () => option.moduleSideEffects,
|
|
5337
|
+
set: (moduleSideEffects) => {
|
|
5338
|
+
option.moduleSideEffects = moduleSideEffects;
|
|
5339
|
+
option.invalidate = true;
|
|
5340
|
+
}
|
|
5341
|
+
});
|
|
5342
|
+
this.moduleInfoCache?.set(moduleId, info);
|
|
5343
|
+
return info;
|
|
5344
|
+
}
|
|
5086
5345
|
return null;
|
|
5087
5346
|
}
|
|
5088
5347
|
};
|
|
@@ -6073,10 +6332,10 @@ function createTestingLogger() {
|
|
|
6073
6332
|
for (const type of types) ret[type] = (...args) => console.log(...args);
|
|
6074
6333
|
return ret;
|
|
6075
6334
|
}
|
|
6076
|
-
function bindingifyOutputOptions(outputOptions, pluginContextData) {
|
|
6335
|
+
function bindingifyOutputOptions(outputOptions, pluginContextData, timings) {
|
|
6077
6336
|
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;
|
|
6078
6337
|
if (legalComments != null) logger.warn("`legalComments` option is deprecated, please use `comments.legal` instead.");
|
|
6079
|
-
const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks, pluginContextData);
|
|
6338
|
+
const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks, pluginContextData, timings);
|
|
6080
6339
|
return {
|
|
6081
6340
|
dir,
|
|
6082
6341
|
file: file == null ? void 0 : file,
|
|
@@ -6086,25 +6345,25 @@ function bindingifyOutputOptions(outputOptions, pluginContextData) {
|
|
|
6086
6345
|
sourcemap: bindingifySourcemap(sourcemap),
|
|
6087
6346
|
sourcemapBaseUrl,
|
|
6088
6347
|
sourcemapDebugIds,
|
|
6089
|
-
sourcemapFileNames,
|
|
6348
|
+
sourcemapFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sourcemapFileNames", sourcemapFileNames),
|
|
6090
6349
|
sourcemapExcludeSources,
|
|
6091
|
-
sourcemapIgnoreList: sourcemapIgnoreList ?? /node_modules
|
|
6092
|
-
sourcemapPathTransform,
|
|
6093
|
-
banner: bindingifyAddon(banner),
|
|
6094
|
-
footer: bindingifyAddon(footer),
|
|
6095
|
-
postBanner: bindingifyAddon(postBanner),
|
|
6096
|
-
postFooter: bindingifyAddon(postFooter),
|
|
6097
|
-
intro: bindingifyAddon(intro),
|
|
6098
|
-
outro: bindingifyAddon(outro),
|
|
6350
|
+
sourcemapIgnoreList: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sourcemapIgnoreList", sourcemapIgnoreList ?? /node_modules/),
|
|
6351
|
+
sourcemapPathTransform: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sourcemapPathTransform", sourcemapPathTransform),
|
|
6352
|
+
banner: bindingifyAddon(banner, "banner", timings),
|
|
6353
|
+
footer: bindingifyAddon(footer, "footer", timings),
|
|
6354
|
+
postBanner: bindingifyAddon(postBanner, "postBanner", timings),
|
|
6355
|
+
postFooter: bindingifyAddon(postFooter, "postFooter", timings),
|
|
6356
|
+
intro: bindingifyAddon(intro, "intro", timings),
|
|
6357
|
+
outro: bindingifyAddon(outro, "outro", timings),
|
|
6099
6358
|
extend: outputOptions.extend,
|
|
6100
|
-
globals,
|
|
6101
|
-
paths,
|
|
6359
|
+
globals: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "globals", globals),
|
|
6360
|
+
paths: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "paths", paths),
|
|
6102
6361
|
generatedCode,
|
|
6103
6362
|
esModule,
|
|
6104
6363
|
name,
|
|
6105
6364
|
assetFileNames: bindingifyAssetFilenames(assetFileNames),
|
|
6106
|
-
entryFileNames,
|
|
6107
|
-
chunkFileNames,
|
|
6365
|
+
entryFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "entryFileNames", entryFileNames),
|
|
6366
|
+
chunkFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "chunkFileNames", chunkFileNames),
|
|
6108
6367
|
plugins: [],
|
|
6109
6368
|
minify: outputOptions.minify,
|
|
6110
6369
|
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
@@ -6125,9 +6384,12 @@ function bindingifyOutputOptions(outputOptions, pluginContextData) {
|
|
|
6125
6384
|
strict: outputOptions.strict
|
|
6126
6385
|
};
|
|
6127
6386
|
}
|
|
6128
|
-
function bindingifyAddon(configAddon) {
|
|
6387
|
+
function bindingifyAddon(configAddon, name, timings) {
|
|
6129
6388
|
if (configAddon == null || configAddon === "") return;
|
|
6130
|
-
if (typeof configAddon === "function")
|
|
6389
|
+
if (typeof configAddon === "function") {
|
|
6390
|
+
const measured = measureHookCost(timings, OUTPUT_OPTIONS_OWNER, name, configAddon);
|
|
6391
|
+
return async (chunk) => measured(transformRenderedChunk(chunk));
|
|
6392
|
+
}
|
|
6131
6393
|
return configAddon;
|
|
6132
6394
|
}
|
|
6133
6395
|
function bindingifyFormat(format) {
|
|
@@ -6171,7 +6433,7 @@ function bindingifyComments(comments) {
|
|
|
6171
6433
|
if (typeof comments === "boolean") return comments;
|
|
6172
6434
|
return comments;
|
|
6173
6435
|
}
|
|
6174
|
-
function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, advancedChunks, manualChunks, pluginContextData) {
|
|
6436
|
+
function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, advancedChunks, manualChunks, pluginContextData, timings) {
|
|
6175
6437
|
let inlineDynamicImports;
|
|
6176
6438
|
let effectiveChunksOption;
|
|
6177
6439
|
if (codeSplitting === false) {
|
|
@@ -6211,13 +6473,20 @@ function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, adva
|
|
|
6211
6473
|
let advancedChunksResult;
|
|
6212
6474
|
if (effectiveChunksOption != null) {
|
|
6213
6475
|
const { groups, ...restOptions } = effectiveChunksOption;
|
|
6476
|
+
let chunkingContext;
|
|
6477
|
+
const getChunkingContext = (bindingContext) => chunkingContext ??= new ChunkingContextImpl(bindingContext, pluginContextData);
|
|
6214
6478
|
advancedChunksResult = {
|
|
6215
6479
|
...restOptions,
|
|
6480
|
+
internalInvalidateModuleInfoCache: () => {
|
|
6481
|
+
chunkingContext?.clearModuleInfoCache();
|
|
6482
|
+
chunkingContext = void 0;
|
|
6483
|
+
},
|
|
6216
6484
|
groups: groups?.map((group) => {
|
|
6217
|
-
const { name, ...restGroup } = group;
|
|
6485
|
+
const { name, test, ...restGroup } = group;
|
|
6218
6486
|
return {
|
|
6219
6487
|
...restGroup,
|
|
6220
|
-
|
|
6488
|
+
test: typeof test === "function" ? batchTest(measureHookCost(timings, OUTPUT_OPTIONS_OWNER, "codeSplitting groups[].test", test)) : test,
|
|
6489
|
+
name: typeof name === "function" ? batchName(measureHookCost(timings, OUTPUT_OPTIONS_OWNER, "codeSplitting groups[].name", name), getChunkingContext) : name
|
|
6221
6490
|
};
|
|
6222
6491
|
})
|
|
6223
6492
|
};
|
|
@@ -6227,6 +6496,40 @@ function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, adva
|
|
|
6227
6496
|
advancedChunks: advancedChunksResult
|
|
6228
6497
|
};
|
|
6229
6498
|
}
|
|
6499
|
+
/**
|
|
6500
|
+
* Wraps a per-id `test` in the batched shim that the binding expects.
|
|
6501
|
+
*
|
|
6502
|
+
* The loop runs in JS so that a group makes one napi crossing, not one per module.
|
|
6503
|
+
*
|
|
6504
|
+
* The result is a `Uint8Array`, which crosses as a buffer instead of one tagged value per id.
|
|
6505
|
+
*/
|
|
6506
|
+
function batchTest(test) {
|
|
6507
|
+
return (ids) => {
|
|
6508
|
+
const results = new Uint8Array(ids.length);
|
|
6509
|
+
for (let index = 0; index < ids.length; index++) {
|
|
6510
|
+
const result = test(ids[index]);
|
|
6511
|
+
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.`);
|
|
6512
|
+
results[index] = result === true ? 1 : 0;
|
|
6513
|
+
}
|
|
6514
|
+
return results;
|
|
6515
|
+
};
|
|
6516
|
+
}
|
|
6517
|
+
/**
|
|
6518
|
+
* This is the `name` equivalent of {@linkcode batchTest}. All groups in a chunking pass share
|
|
6519
|
+
* a context so repeated module queries reuse their JavaScript values.
|
|
6520
|
+
*/
|
|
6521
|
+
function batchName(name, getChunkingContext) {
|
|
6522
|
+
return (ids, bindingContext) => {
|
|
6523
|
+
const context = getChunkingContext(bindingContext);
|
|
6524
|
+
const results = [];
|
|
6525
|
+
for (let index = 0; index < ids.length; index++) {
|
|
6526
|
+
const result = name(ids[index], context);
|
|
6527
|
+
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.`);
|
|
6528
|
+
results.push(result);
|
|
6529
|
+
}
|
|
6530
|
+
return results;
|
|
6531
|
+
};
|
|
6532
|
+
}
|
|
6230
6533
|
var import_binding$3 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
6231
6534
|
async function initializeParallelPlugins(plugins) {
|
|
6232
6535
|
const pluginInfos = [];
|
|
@@ -6290,7 +6593,7 @@ var availableParallelism = () => {
|
|
|
6290
6593
|
}
|
|
6291
6594
|
return Math.min(availableParallelism, 8);
|
|
6292
6595
|
};
|
|
6293
|
-
async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
6596
|
+
async function createBundlerOptions(inputOptions, outputOptions, watchMode, measureTimings = false) {
|
|
6294
6597
|
const inputPlugins = await normalizePluginOption(inputOptions.plugins);
|
|
6295
6598
|
const outputPlugins = await normalizePluginOption(outputOptions.plugins);
|
|
6296
6599
|
const logLevel = inputOptions.logLevel || "info";
|
|
@@ -6300,14 +6603,20 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
6300
6603
|
const normalizedInputPlugins = normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX);
|
|
6301
6604
|
const normalizedOutputPlugins = normalizePlugins(hookOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX);
|
|
6302
6605
|
let plugins = [...normalizedInputPlugins, ...checkOutputPluginOption(normalizedOutputPlugins, onLog)];
|
|
6606
|
+
const timings = measureTimings && inputOptions.checks?.pluginTimings !== false ? pluginTimingsRecorderFor(inputOptions) : void 0;
|
|
6607
|
+
if (timings) outputOptions = {
|
|
6608
|
+
...outputOptions,
|
|
6609
|
+
assetFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "assetFileNames", outputOptions.assetFileNames),
|
|
6610
|
+
sanitizeFileName: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sanitizeFileName", outputOptions.sanitizeFileName)
|
|
6611
|
+
};
|
|
6303
6612
|
const parallelPluginInitResult = await initializeParallelPlugins(plugins);
|
|
6304
6613
|
if (inputOptions.experimental?.strictExecutionOrder !== void 0) console.warn("`experimental.strictExecutionOrder` has been stabilized and moved to `output.strictExecutionOrder`. Please update your configuration.");
|
|
6305
6614
|
try {
|
|
6306
6615
|
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedInputPlugins, normalizedOutputPlugins);
|
|
6307
6616
|
return {
|
|
6308
6617
|
bundlerOptions: {
|
|
6309
|
-
inputOptions: bindingifyInputOptions(plugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode),
|
|
6310
|
-
outputOptions: bindingifyOutputOptions(outputOptions, pluginContextData),
|
|
6618
|
+
inputOptions: bindingifyInputOptions(plugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings),
|
|
6619
|
+
outputOptions: bindingifyOutputOptions(outputOptions, pluginContextData, timings),
|
|
6311
6620
|
parallelPluginsRegistry: parallelPluginInitResult?.registry
|
|
6312
6621
|
},
|
|
6313
6622
|
inputOptions,
|
|
@@ -6320,7 +6629,7 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
6320
6629
|
}
|
|
6321
6630
|
}
|
|
6322
6631
|
//#endregion
|
|
6323
|
-
//#region ../../node_modules/rolldown/dist/shared/watch-
|
|
6632
|
+
//#region ../../node_modules/rolldown/dist/shared/watch-dKH5b9eq.mjs
|
|
6324
6633
|
/**
|
|
6325
6634
|
* This is not the set of all possible signals.
|
|
6326
6635
|
*
|
|
@@ -6527,13 +6836,14 @@ function onExit(...args) {
|
|
|
6527
6836
|
}
|
|
6528
6837
|
require_binding();
|
|
6529
6838
|
//#endregion
|
|
6530
|
-
//#region ../../node_modules/rolldown/dist/shared/rolldown-
|
|
6839
|
+
//#region ../../node_modules/rolldown/dist/shared/rolldown-B-jRyK4b.mjs
|
|
6531
6840
|
var import_binding$1 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
6532
6841
|
var RolldownOutputImpl = class extends PlainObjectLike {
|
|
6533
6842
|
bindingOutputs;
|
|
6534
6843
|
constructor(bindingOutputs) {
|
|
6535
6844
|
super();
|
|
6536
6845
|
this.bindingOutputs = bindingOutputs;
|
|
6846
|
+
if (bindingOutputs.mangleCache !== void 0) this.mangleCache = bindingOutputs.mangleCache;
|
|
6537
6847
|
}
|
|
6538
6848
|
get output() {
|
|
6539
6849
|
return transformToRollupOutput(this.bindingOutputs).output;
|
|
@@ -6646,7 +6956,7 @@ var RolldownBuild = class {
|
|
|
6646
6956
|
async #build(isWrite, outputOptions) {
|
|
6647
6957
|
validateOption("output", outputOptions);
|
|
6648
6958
|
await this.#stopWorkers?.();
|
|
6649
|
-
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
|
|
6959
|
+
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false, true);
|
|
6650
6960
|
try {
|
|
6651
6961
|
this.#stopWorkers = option.stopWorkers;
|
|
6652
6962
|
let output;
|