@voidzero-dev/vite-plus-core 0.2.4 → 0.2.5
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/LICENSE +7 -115
- package/dist/rolldown/cli.mjs +11 -8
- package/dist/rolldown/config.d.mts +15 -2
- package/dist/rolldown/config.mjs +2 -2
- package/dist/rolldown/experimental-index.d.mts +4 -4
- package/dist/rolldown/experimental-index.mjs +8 -8
- package/dist/rolldown/filter-index.d.mts +1 -1
- package/dist/rolldown/index.d.mts +3 -3
- package/dist/rolldown/index.mjs +10 -4
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +2 -2
- package/dist/rolldown/plugins-index.d.mts +3 -3
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{binding-B1q9aYT-.d.mts → binding-D26QphWG.d.mts} +12 -0
- package/dist/rolldown/shared/{binding-BmkJW3Wy.mjs → binding-TuFFIE_J.mjs} +26 -26
- package/dist/rolldown/shared/{bindingify-input-options-Cmm60vfj.mjs → bindingify-input-options-CwbcQL6W.mjs} +11 -13
- package/dist/rolldown/shared/{constructors-2i1T9YcF.d.mts → constructors-BbWPse2X.d.mts} +2 -2
- package/dist/rolldown/shared/{constructors-CE6zZSUt.mjs → constructors-D_3i7dpX.mjs} +1 -1
- package/dist/rolldown/shared/{define-config-BBz954-q.d.mts → define-config-BhJ90aEv.d.mts} +79 -2
- package/dist/rolldown/shared/dist-DX3cAjHx.mjs +154 -0
- package/dist/rolldown/shared/{error-BlQ0-ek7.mjs → error-BHRSI0R7.mjs} +1 -1
- package/dist/rolldown/shared/{load-config-CVVMWSlg.mjs → load-config-Bd7MgqCK.mjs} +19 -2
- package/dist/rolldown/shared/{logs-aMKUxRpj.mjs → logs-ZGEh6uhb.mjs} +6 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-BYkbbGqQ.mjs → normalize-string-or-regex-dnh67V_w.mjs} +2 -2
- package/dist/rolldown/shared/{parse-Dphnedsw.mjs → parse-B6_waszz.mjs} +2 -2
- package/dist/rolldown/shared/{prompt-Bgj-uEyc.mjs → prompt-pZFoa1TT.mjs} +59 -17
- package/dist/rolldown/shared/{resolve-tsconfig-CdIAR1Eb.mjs → resolve-tsconfig-DxqIJB3x.mjs} +2 -2
- package/dist/rolldown/shared/{rolldown-Bnp916iM.mjs → rolldown-CACDGVWV.mjs} +1 -1
- package/dist/rolldown/shared/{rolldown-build-Cs2iVJuw.mjs → rolldown-build-BV22mk7t.mjs} +33 -13
- package/dist/rolldown/shared/{transform-CEmFsvJW.d.mts → transform-BPrUvqEZ.d.mts} +1 -1
- package/dist/rolldown/shared/{watch-ECGr-_QS.mjs → watch-CS_JygCu.mjs} +5 -5
- package/dist/rolldown/utils-index.d.mts +3 -3
- package/dist/rolldown/utils-index.mjs +8 -6
- package/dist/tsdown/{build-B_nvJe4A-CvbtVBxy.js → build-BlM3pDGJ-C8Uovnt4.js} +166 -76
- package/dist/tsdown/{debug-DLdR-9XB-DQZ6QLC0.js → debug-B1wUEHkd-DhRzGJTf.js} +21 -6
- package/dist/tsdown/{detect-B97OSl92-BJPZyIKJ.js → detect-BNXt7gkp-DKAC9Z7n.js} +7 -2
- package/dist/tsdown/dist-Pjag7IPt.js +3206 -0
- package/dist/tsdown/fs-qxJxxoCE-B_amenYz.js +46 -0
- package/dist/tsdown/{general-Cp4NiJNK-CbyrS9q1.js → general-Cp4NiJNK-xAqmPhMP.js} +1 -1
- package/dist/tsdown/index-types.d.ts +1361 -1326
- package/dist/tsdown/index.js +7 -4
- package/dist/tsdown/internal-Bn6NGoha.js +3 -0
- package/dist/tsdown/npm_cjs_chunk_range.cjs +14 -13
- package/dist/tsdown/npm_cjs_chunk_semver.cjs +6 -6
- package/dist/tsdown/npm_entry_picomatch.cjs +44 -15
- package/dist/tsdown/npm_entry_semver_functions_coerce.cjs +2 -2
- package/dist/tsdown/npm_entry_semver_functions_satisfies.cjs +1 -1
- package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +1 -1
- package/dist/tsdown/run.js +3 -3
- package/dist/tsdown/{src-CISfE_A0.js → src-CK50m8R_.js} +5 -5
- package/dist/tsdown/target-CqeSqtms-CIvlAiuG.js +35 -0
- package/dist/tsdown/{tsc-CdZE7QwS.js → tsc-CilQvmj4.js} +15 -7
- package/dist/tsdown/{tsc-context-CX_GXdyS.js → tsc-context-BusiAGCd.js} +6 -2
- package/dist/tsdown/tsdown-css.js +74 -23
- package/dist/tsdown/tsdown-exe.js +27 -26
- package/dist/vite/client/client.mjs +4 -4
- package/dist/vite/node/chunks/build.js +194 -84
- package/dist/vite/node/chunks/dist2.js +1 -1
- package/dist/vite/node/chunks/lib.js +1 -1
- package/dist/vite/node/chunks/node.js +484 -71
- package/dist/vite/node/chunks/postcss-import.js +1 -1
- package/dist/vite/node/cli.js +3 -4
- package/dist/vite/node/index.d.ts +3 -3
- package/dist/vite/node/index.js +1 -2
- package/package.json +18 -16
- package/dist/tsdown/dist-CZtGyfn3.js +0 -200
- package/dist/tsdown/dist-CqbVlnVq.js +0 -32057
- package/dist/tsdown/internal-bfoxcI4F.js +0 -3
- package/dist/tsdown/target-CqeSqtms-FAqYuGyB.js +0 -79
- package/dist/vite/node/chunks/logger.js +0 -361
|
@@ -103,7 +103,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
103
103
|
try {
|
|
104
104
|
const binding = __require("vite-plus/binding");
|
|
105
105
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
106
|
-
if (bindingPackageVersion !== "0.2.
|
|
106
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
107
107
|
return binding;
|
|
108
108
|
} catch (e) {
|
|
109
109
|
loadErrors.push(e);
|
|
@@ -117,7 +117,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
117
117
|
try {
|
|
118
118
|
const binding = __require("vite-plus/binding");
|
|
119
119
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
120
|
-
if (bindingPackageVersion !== "0.2.
|
|
120
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
121
121
|
return binding;
|
|
122
122
|
} catch (e) {
|
|
123
123
|
loadErrors.push(e);
|
|
@@ -132,7 +132,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
132
132
|
try {
|
|
133
133
|
const binding = __require("vite-plus/binding");
|
|
134
134
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
135
|
-
if (bindingPackageVersion !== "0.2.
|
|
135
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
136
136
|
return binding;
|
|
137
137
|
} catch (e) {
|
|
138
138
|
loadErrors.push(e);
|
|
@@ -146,7 +146,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
146
146
|
try {
|
|
147
147
|
const binding = __require("vite-plus/binding");
|
|
148
148
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
149
|
-
if (bindingPackageVersion !== "0.2.
|
|
149
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
150
150
|
return binding;
|
|
151
151
|
} catch (e) {
|
|
152
152
|
loadErrors.push(e);
|
|
@@ -161,7 +161,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
161
161
|
try {
|
|
162
162
|
const binding = __require("vite-plus/binding");
|
|
163
163
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
164
|
-
if (bindingPackageVersion !== "0.2.
|
|
164
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
165
165
|
return binding;
|
|
166
166
|
} catch (e) {
|
|
167
167
|
loadErrors.push(e);
|
|
@@ -175,7 +175,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
175
175
|
try {
|
|
176
176
|
const binding = __require("vite-plus/binding");
|
|
177
177
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
178
|
-
if (bindingPackageVersion !== "0.2.
|
|
178
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
179
179
|
return binding;
|
|
180
180
|
} catch (e) {
|
|
181
181
|
loadErrors.push(e);
|
|
@@ -190,7 +190,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
190
190
|
try {
|
|
191
191
|
const binding = __require("vite-plus/binding");
|
|
192
192
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
193
|
-
if (bindingPackageVersion !== "0.2.
|
|
193
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
194
194
|
return binding;
|
|
195
195
|
} catch (e) {
|
|
196
196
|
loadErrors.push(e);
|
|
@@ -204,7 +204,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
204
204
|
try {
|
|
205
205
|
const binding = __require("vite-plus/binding");
|
|
206
206
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
207
|
-
if (bindingPackageVersion !== "0.2.
|
|
207
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
208
208
|
return binding;
|
|
209
209
|
} catch (e) {
|
|
210
210
|
loadErrors.push(e);
|
|
@@ -218,7 +218,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
218
218
|
try {
|
|
219
219
|
const binding = __require("vite-plus/binding");
|
|
220
220
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
221
|
-
if (bindingPackageVersion !== "0.2.
|
|
221
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
222
222
|
return binding;
|
|
223
223
|
} catch (e) {
|
|
224
224
|
loadErrors.push(e);
|
|
@@ -233,7 +233,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
233
233
|
try {
|
|
234
234
|
const binding = __require("vite-plus/binding");
|
|
235
235
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
236
|
-
if (bindingPackageVersion !== "0.2.
|
|
236
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
237
237
|
return binding;
|
|
238
238
|
} catch (e) {
|
|
239
239
|
loadErrors.push(e);
|
|
@@ -247,7 +247,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
247
247
|
try {
|
|
248
248
|
const binding = __require("vite-plus/binding");
|
|
249
249
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
250
|
-
if (bindingPackageVersion !== "0.2.
|
|
250
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
251
251
|
return binding;
|
|
252
252
|
} catch (e) {
|
|
253
253
|
loadErrors.push(e);
|
|
@@ -262,7 +262,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
262
262
|
try {
|
|
263
263
|
const binding = __require("vite-plus/binding");
|
|
264
264
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
265
|
-
if (bindingPackageVersion !== "0.2.
|
|
265
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
266
266
|
return binding;
|
|
267
267
|
} catch (e) {
|
|
268
268
|
loadErrors.push(e);
|
|
@@ -276,7 +276,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
276
276
|
try {
|
|
277
277
|
const binding = __require("vite-plus/binding");
|
|
278
278
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
279
|
-
if (bindingPackageVersion !== "0.2.
|
|
279
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
280
280
|
return binding;
|
|
281
281
|
} catch (e) {
|
|
282
282
|
loadErrors.push(e);
|
|
@@ -291,7 +291,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
291
291
|
try {
|
|
292
292
|
const binding = __require("vite-plus/binding");
|
|
293
293
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
294
|
-
if (bindingPackageVersion !== "0.2.
|
|
294
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
295
295
|
return binding;
|
|
296
296
|
} catch (e) {
|
|
297
297
|
loadErrors.push(e);
|
|
@@ -305,7 +305,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = __require("vite-plus/binding");
|
|
307
307
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
308
|
-
if (bindingPackageVersion !== "0.2.
|
|
308
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
309
309
|
return binding;
|
|
310
310
|
} catch (e) {
|
|
311
311
|
loadErrors.push(e);
|
|
@@ -320,7 +320,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
320
320
|
try {
|
|
321
321
|
const binding = __require("vite-plus/binding");
|
|
322
322
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
323
|
-
if (bindingPackageVersion !== "0.2.
|
|
323
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
324
324
|
return binding;
|
|
325
325
|
} catch (e) {
|
|
326
326
|
loadErrors.push(e);
|
|
@@ -334,7 +334,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
334
334
|
try {
|
|
335
335
|
const binding = __require("vite-plus/binding");
|
|
336
336
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
337
|
-
if (bindingPackageVersion !== "0.2.
|
|
337
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
338
338
|
return binding;
|
|
339
339
|
} catch (e) {
|
|
340
340
|
loadErrors.push(e);
|
|
@@ -349,7 +349,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
349
349
|
try {
|
|
350
350
|
const binding = __require("vite-plus/binding");
|
|
351
351
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
352
|
-
if (bindingPackageVersion !== "0.2.
|
|
352
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
353
353
|
return binding;
|
|
354
354
|
} catch (e) {
|
|
355
355
|
loadErrors.push(e);
|
|
@@ -363,7 +363,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
363
363
|
try {
|
|
364
364
|
const binding = __require("vite-plus/binding");
|
|
365
365
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
366
|
-
if (bindingPackageVersion !== "0.2.
|
|
366
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
367
367
|
return binding;
|
|
368
368
|
} catch (e) {
|
|
369
369
|
loadErrors.push(e);
|
|
@@ -378,7 +378,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
378
378
|
try {
|
|
379
379
|
const binding = __require("vite-plus/binding");
|
|
380
380
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
381
|
-
if (bindingPackageVersion !== "0.2.
|
|
381
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
382
382
|
return binding;
|
|
383
383
|
} catch (e) {
|
|
384
384
|
loadErrors.push(e);
|
|
@@ -392,7 +392,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
392
392
|
try {
|
|
393
393
|
const binding = __require("vite-plus/binding");
|
|
394
394
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
395
|
-
if (bindingPackageVersion !== "0.2.
|
|
395
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
396
396
|
return binding;
|
|
397
397
|
} catch (e) {
|
|
398
398
|
loadErrors.push(e);
|
|
@@ -407,7 +407,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = __require("vite-plus/binding");
|
|
409
409
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
410
|
-
if (bindingPackageVersion !== "0.2.
|
|
410
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
411
411
|
return binding;
|
|
412
412
|
} catch (e) {
|
|
413
413
|
loadErrors.push(e);
|
|
@@ -421,7 +421,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
421
421
|
try {
|
|
422
422
|
const binding = __require("vite-plus/binding");
|
|
423
423
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
424
|
-
if (bindingPackageVersion !== "0.2.
|
|
424
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
425
425
|
return binding;
|
|
426
426
|
} catch (e) {
|
|
427
427
|
loadErrors.push(e);
|
|
@@ -436,7 +436,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
436
436
|
try {
|
|
437
437
|
const binding = __require("vite-plus/binding");
|
|
438
438
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
439
|
-
if (bindingPackageVersion !== "0.2.
|
|
439
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
440
440
|
return binding;
|
|
441
441
|
} catch (e) {
|
|
442
442
|
loadErrors.push(e);
|
|
@@ -450,7 +450,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
450
450
|
try {
|
|
451
451
|
const binding = __require("vite-plus/binding");
|
|
452
452
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
453
|
-
if (bindingPackageVersion !== "0.2.
|
|
453
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
454
454
|
return binding;
|
|
455
455
|
} catch (e) {
|
|
456
456
|
loadErrors.push(e);
|
|
@@ -464,7 +464,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
464
464
|
try {
|
|
465
465
|
const binding = __require("vite-plus/binding");
|
|
466
466
|
const bindingPackageVersion = __require("vite-plus/binding/package.json").version;
|
|
467
|
-
if (bindingPackageVersion !== "0.2.
|
|
467
|
+
if (bindingPackageVersion !== "0.2.5" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 0.2.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
468
468
|
return binding;
|
|
469
469
|
} catch (e) {
|
|
470
470
|
loadErrors.push(e);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import { a as logInvalidLogPosition, c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-
|
|
3
|
-
import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-TuFFIE_J.mjs";
|
|
2
|
+
import { a as logInvalidLogPosition, c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-ZGEh6uhb.mjs";
|
|
3
|
+
import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-dnh67V_w.mjs";
|
|
4
4
|
import { a as unreachable, o as unsupported, r as noop, t as arraify } from "./misc-CoQm4NHO.mjs";
|
|
5
|
-
import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-
|
|
5
|
+
import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-BHRSI0R7.mjs";
|
|
6
6
|
import { parseAst } from "../parse-ast-index.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import * as filter from "@voidzero-dev/vite-plus-core/rolldown/pluginutils";
|
|
9
9
|
import fsp from "node:fs/promises";
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "0.2.
|
|
11
|
+
var version = "0.2.5";
|
|
12
12
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/constants/version.ts
|
|
@@ -20,12 +20,6 @@ var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compat
|
|
|
20
20
|
*/
|
|
21
21
|
const VERSION = version;
|
|
22
22
|
//#endregion
|
|
23
|
-
//#region src/constants/index.ts
|
|
24
|
-
/**
|
|
25
|
-
* Runtime helper module ID
|
|
26
|
-
*/
|
|
27
|
-
const RUNTIME_MODULE_ID = "\0rolldown/runtime.js";
|
|
28
|
-
//#endregion
|
|
29
23
|
//#region src/log/logging.ts
|
|
30
24
|
const LOG_LEVEL_SILENT = "silent";
|
|
31
25
|
const LOG_LEVEL_ERROR = "error";
|
|
@@ -220,7 +214,7 @@ function bindingAssetSource(source) {
|
|
|
220
214
|
return { inner: source };
|
|
221
215
|
}
|
|
222
216
|
//#endregion
|
|
223
|
-
//#region \0@oxc-project+runtime@0.
|
|
217
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/decorate.js
|
|
224
218
|
function __decorate(decorators, target, key, desc) {
|
|
225
219
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
226
220
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -633,6 +627,9 @@ var NormalizedOutputOptionsImpl = class extends PlainObjectLike {
|
|
|
633
627
|
get sourcemap() {
|
|
634
628
|
return this.inner.sourcemap;
|
|
635
629
|
}
|
|
630
|
+
get sourcemapFileNames() {
|
|
631
|
+
return this.inner.sourcemapFilenames || this.outputOptions.sourcemapFileNames;
|
|
632
|
+
}
|
|
636
633
|
get sourcemapBaseUrl() {
|
|
637
634
|
return this.inner.sourcemapBaseUrl ?? void 0;
|
|
638
635
|
}
|
|
@@ -754,6 +751,7 @@ __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "assetFileNames",
|
|
|
754
751
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "format", null);
|
|
755
752
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "exports", null);
|
|
756
753
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemap", null);
|
|
754
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapFileNames", null);
|
|
757
755
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapBaseUrl", null);
|
|
758
756
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "shimMissingExports", null);
|
|
759
757
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "name", null);
|
|
@@ -2237,4 +2235,4 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
|
|
|
2237
2235
|
};
|
|
2238
2236
|
}
|
|
2239
2237
|
//#endregion
|
|
2240
|
-
export { version as
|
|
2238
|
+
export { version as S, LOG_LEVEL_INFO as _, transformModuleInfo as a, VERSION as b, __decorate as c, PlainObjectLike as d, MinimalPluginContextImpl as f, LOG_LEVEL_ERROR as g, LOG_LEVEL_DEBUG as h, PluginContextData as i, transformAssetSource as l, normalizeLog as m, bindingifyPlugin as n, transformToRollupOutput as o, normalizeHook as p, RolldownMagicString as r, transformRenderedChunk as s, bindingifyInputOptions as t, lazyProp as u, LOG_LEVEL_WARN as v, description as x, logLevelPriority as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as BindingViteResolvePluginConfig, E as BindingViteReporterPluginConfig, S as BindingViteJsonPluginConfig, T as BindingViteReactRefreshWrapperPluginConfig, b as BindingViteDynamicImportVarsPluginConfig, l as BindingIsolatedDeclarationPluginConfig, s as BindingEsmExternalRequirePluginConfig, w as BindingViteModulePreloadPolyfillPluginConfig, x as BindingViteImportGlobPluginConfig, y as BindingViteBuildImportAnalysisPluginConfig } from "./binding-
|
|
2
|
-
import {
|
|
1
|
+
import { D as BindingViteResolvePluginConfig, E as BindingViteReporterPluginConfig, S as BindingViteJsonPluginConfig, T as BindingViteReactRefreshWrapperPluginConfig, b as BindingViteDynamicImportVarsPluginConfig, l as BindingIsolatedDeclarationPluginConfig, s as BindingEsmExternalRequirePluginConfig, w as BindingViteModulePreloadPolyfillPluginConfig, x as BindingViteImportGlobPluginConfig, y as BindingViteBuildImportAnalysisPluginConfig } from "./binding-D26QphWG.mjs";
|
|
2
|
+
import { F as BuiltinPlugin, Wt as StringOrRegExp } from "./define-config-BhJ90aEv.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/builtin-plugin/constructors.d.ts
|
|
5
5
|
declare function viteModulePreloadPolyfillPlugin(config?: BindingViteModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-dnh67V_w.mjs";
|
|
2
2
|
//#region src/builtin-plugin/constructors.ts
|
|
3
3
|
function viteModulePreloadPolyfillPlugin(config) {
|
|
4
4
|
return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./logging-BSNejiLS.mjs";
|
|
2
|
-
import { A as ExternalMemoryStatus, N as JsxOptions, P as MinifyOptions$1, R as ParserOptions, U as TransformOptions$1, c as BindingHookResolveIdExtraArgs, d as BindingPluginContextResolveOptions, h as BindingTransformHookExtraArgs, k as BindingWatcherBundler, p as BindingRenderedChunk, t as BindingBuiltinPluginName, u as BindingMagicString, z as PreRenderedChunk } from "./binding-
|
|
2
|
+
import { A as ExternalMemoryStatus, N as JsxOptions, P as MinifyOptions$1, R as ParserOptions, U as TransformOptions$1, c as BindingHookResolveIdExtraArgs, d as BindingPluginContextResolveOptions, h as BindingTransformHookExtraArgs, k as BindingWatcherBundler, p as BindingRenderedChunk, t as BindingBuiltinPluginName, u as BindingMagicString, z as PreRenderedChunk } from "./binding-D26QphWG.mjs";
|
|
3
3
|
import { TopLevelFilterExpression } from "@voidzero-dev/vite-plus-core/rolldown/pluginutils";
|
|
4
4
|
import { Program } from "@oxc-project/types";
|
|
5
5
|
|
|
@@ -420,6 +420,22 @@ interface OutputOptions {
|
|
|
420
420
|
*/
|
|
421
421
|
sourcemapBaseUrl?: string;
|
|
422
422
|
/**
|
|
423
|
+
* The pattern to use for sourcemaps created from entry points, or a function that is called per entry chunk with {@linkcode PreRenderedChunk} to return such a pattern.
|
|
424
|
+
*
|
|
425
|
+
* Patterns support the following placeholders:
|
|
426
|
+
* - `[format]`: The rendering format defined in the output options. The value is any of {@linkcode InternalModuleFormat}.
|
|
427
|
+
* - `[hash]`: A hash based only on the content of the final generated sourcemap. You can also set a specific hash length via e.g. `[hash:10]`. By default, it will create a base-64 hash. If you need a reduced character set, see {@linkcode hashCharacters | output.hashCharacters}.
|
|
428
|
+
* - `[chunkhash]`: The same hash as the one used for the corresponding generated chunk (if any).
|
|
429
|
+
* - `[name]`: The name of the corresponding chunk.
|
|
430
|
+
*
|
|
431
|
+
* Forward slashes (`/`) can be used to place files in sub-directories. This pattern will also be used for every file when setting the {@linkcode preserveModules | output.preserveModules} option.
|
|
432
|
+
*
|
|
433
|
+
* See also {@linkcode assetFileNames | output.assetFileNames}, {@linkcode chunkFileNames | output.chunkFileNames}.
|
|
434
|
+
*
|
|
435
|
+
* @default the corresponding chunk filename with `.map` appended
|
|
436
|
+
*/
|
|
437
|
+
sourcemapFileNames?: string | ChunkFileNamesFunction;
|
|
438
|
+
/**
|
|
423
439
|
* Whether to include [debug IDs](https://github.com/tc39/ecma426/blob/main/proposals/debug-id.md) in the sourcemap.
|
|
424
440
|
*
|
|
425
441
|
* When `true`, a unique debug ID will be emitted in source and sourcemaps which streamlines identifying sourcemaps across different builds.
|
|
@@ -1524,6 +1540,9 @@ interface ChecksOptions {
|
|
|
1524
1540
|
* Annotations placed where they cannot annotate a call expression (e.g. before a non-call expression,
|
|
1525
1541
|
* before a statement declaration, or between an identifier and `=` in a variable declarator) are
|
|
1526
1542
|
* ignored by the parser. Matches Rollup's `INVALID_ANNOTATION` log code.
|
|
1543
|
+
*
|
|
1544
|
+
* By default, warnings are emitted only for local project files inside `cwd` and outside
|
|
1545
|
+
* `node_modules`. Set this option to `false` to disable the warning entirely.
|
|
1527
1546
|
* @default true
|
|
1528
1547
|
* */
|
|
1529
1548
|
invalidAnnotation?: boolean;
|
|
@@ -1800,6 +1819,8 @@ interface NormalizedOutputOptions {
|
|
|
1800
1819
|
dir: string | undefined;
|
|
1801
1820
|
/** @see {@linkcode OutputOptions.entryFileNames | entryFileNames} */
|
|
1802
1821
|
entryFileNames: string | ChunkFileNamesFunction;
|
|
1822
|
+
/** @see {@linkcode OutputOptions.sourcemapFileNames | sourcemapFileNames} */
|
|
1823
|
+
sourcemapFileNames: string | ChunkFileNamesFunction | undefined;
|
|
1803
1824
|
/** @see {@linkcode OutputOptions.chunkFileNames | chunkFileNames} */
|
|
1804
1825
|
chunkFileNames: string | ChunkFileNamesFunction;
|
|
1805
1826
|
/** @see {@linkcode OutputOptions.assetFileNames | assetFileNames} */
|
|
@@ -2646,6 +2667,28 @@ type ModuleSideEffects = boolean | "no-treeshake" | null;
|
|
|
2646
2667
|
type ModuleType = "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | (string & {});
|
|
2647
2668
|
/** @category Plugin APIs */
|
|
2648
2669
|
type ImportKind = BindingHookResolveIdExtraArgs["kind"];
|
|
2670
|
+
/**
|
|
2671
|
+
* Descriptive metadata a plugin can expose about itself.
|
|
2672
|
+
*
|
|
2673
|
+
* Set it via the {@linkcode Plugin.meta | meta} property of the plugin object.
|
|
2674
|
+
*
|
|
2675
|
+
* @category Plugin APIs
|
|
2676
|
+
*/
|
|
2677
|
+
interface PluginMeta {
|
|
2678
|
+
/**
|
|
2679
|
+
* The name of the npm package the plugin ships in, e.g. `@vitejs/plugin-vue`.
|
|
2680
|
+
*/
|
|
2681
|
+
packageName?: string;
|
|
2682
|
+
/**
|
|
2683
|
+
* The version of the npm package the plugin ships in, e.g. `5.0.0`. The
|
|
2684
|
+
* `version` field of that package's `package.json`.
|
|
2685
|
+
*/
|
|
2686
|
+
version?: string;
|
|
2687
|
+
/**
|
|
2688
|
+
* A short, human-readable description of what the plugin does.
|
|
2689
|
+
*/
|
|
2690
|
+
description?: string;
|
|
2691
|
+
}
|
|
2649
2692
|
/** @category Plugin APIs */
|
|
2650
2693
|
interface CustomPluginOptions {
|
|
2651
2694
|
[plugin: string]: any;
|
|
@@ -2655,6 +2698,31 @@ interface ModuleOptions {
|
|
|
2655
2698
|
moduleSideEffects: ModuleSideEffects;
|
|
2656
2699
|
/** See [Custom module meta-data section](https://rolldown.rs/apis/plugin-api/inter-plugin-communication#custom-module-meta-data) for more details. */
|
|
2657
2700
|
meta: CustomPluginOptions;
|
|
2701
|
+
/**
|
|
2702
|
+
* A short, human-readable description of the module.
|
|
2703
|
+
*
|
|
2704
|
+
* This is useful for virtual modules, whose ids (e.g.
|
|
2705
|
+
* `\0vite/modulepreload-polyfill.js`) do not convey their purpose on their own.
|
|
2706
|
+
*
|
|
2707
|
+
* @example
|
|
2708
|
+
* ```js
|
|
2709
|
+
* function polyfillPlugin() {
|
|
2710
|
+
* return {
|
|
2711
|
+
* name: 'vite:modulepreload-polyfill',
|
|
2712
|
+
* load: {
|
|
2713
|
+
* filter: { id: /^\0vite\/modulepreload-polyfill\.js$/ },
|
|
2714
|
+
* handler(id) {
|
|
2715
|
+
* return {
|
|
2716
|
+
* code: '',
|
|
2717
|
+
* description: 'A polyfill for `link` tag with `rel="modulepreload"`',
|
|
2718
|
+
* };
|
|
2719
|
+
* }
|
|
2720
|
+
* },
|
|
2721
|
+
* };
|
|
2722
|
+
* }
|
|
2723
|
+
* ```
|
|
2724
|
+
*/
|
|
2725
|
+
description?: string;
|
|
2658
2726
|
invalidate?: boolean;
|
|
2659
2727
|
packageJsonPath?: string;
|
|
2660
2728
|
}
|
|
@@ -3083,6 +3151,15 @@ interface OutputPlugin extends Partial<{ [K in keyof PluginHooks as K & OutputPl
|
|
|
3083
3151
|
name: string;
|
|
3084
3152
|
/** The version of the plugin, for use in inter-plugin communication scenarios. */
|
|
3085
3153
|
version?: string;
|
|
3154
|
+
/**
|
|
3155
|
+
* Descriptive metadata about the plugin, such as the npm package it ships in.
|
|
3156
|
+
*
|
|
3157
|
+
* This does not affect bundling; it is informational and intended to be
|
|
3158
|
+
* surfaced by tooling that inspects a build. See {@linkcode PluginMeta}.
|
|
3159
|
+
*
|
|
3160
|
+
* @experimental
|
|
3161
|
+
*/
|
|
3162
|
+
meta?: PluginMeta;
|
|
3086
3163
|
}
|
|
3087
3164
|
/**
|
|
3088
3165
|
* The Plugin interface.
|
|
@@ -3898,4 +3975,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
|
3898
3975
|
declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
|
|
3899
3976
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
3900
3977
|
//#endregion
|
|
3901
|
-
export {
|
|
3978
|
+
export { MinimalPluginContext as $, SourcemapIgnoreListOption as $t, RolldownPlugin as A, ChunkingContext as At, SourceMapInput as B, OutputOptions as Bt, ParallelPluginHooks as C, BuildOptions as Ct, ResolveIdExtraOptions as D, AdvancedChunksOptions as Dt, PluginMeta as E, AdvancedChunksGroup as Et, BuiltinPlugin as F, GeneratedCodeOptions as Ft, EmittedChunk as G, OutputAsset as Gt, TreeshakingOptions as H, MaybePromise as Ht, RUNTIME_MODULE_ID as I, GeneratedCodePreset as It, GetModuleInfo as J, RenderedModule as Jt, EmittedFile as K, OutputChunk as Kt, VERSION as L, GlobalsFunction as Lt, SourceDescription as M, CodeSplittingNameFunction as Mt, TransformResult as N, CodeSplittingOptions as Nt, ResolveIdResult as O, BuiltinModuleTag as Ot, withFilter as P, CommentsOptions as Pt, defineParallelPlugin as Q, ModuleInfo as Qt, BundleError as R, MinifyOptions as Rt, ObjectHook as S, RolldownBuild as St, Plugin as T, AddonFunction as Tt, TransformPluginContext as U, PartialNull as Ut, OutputBundle as V, PreRenderedAsset as Vt, EmittedAsset as W, StringOrRegExp as Wt, PluginContextResolveOptions as X, SourceMap as Xt, PluginContext as Y, RolldownOutput as Yt, DefineParallelPluginResult as Z, freeExternalMemory as Zt, HookFilterExtension as _, RolldownWatcher as _t, ChunkOptimizationOptions as a, RolldownDirectoryEntry as at, ModuleOptions as b, WatchOptions as bt, InputOption as c, InternalModuleFormat as ct, OptimizationOptions as d, TransformOptions as dt, PluginContextMeta as et, WatcherFileWatcherOptions as f, ChecksOptions as ft, FunctionPluginHooks as g, watch as gt, CustomPluginOptions as h, RolldownMagicString as ht, RolldownOptions as i, BufferEncoding as it, RolldownPluginOption as j, CodeSplittingGroup as jt, ResolvedId as k, ChunkFileNamesFunction as kt, InputOptions as l, NormalizedOutputOptions as lt, AsyncPluginHooks as m, WarningHandlerWithDefault as mt, RolldownOptionsFunction as n, HookFilter as nt, ExternalOption as o, RolldownFileStats as ot, WatcherOptions as p, LoggingFunction as pt, EmittedPrebuiltChunk as q, RenderedChunk as qt, defineConfig as r, ModuleTypeFilter as rt, ExternalOptionFunction as s, RolldownFsModule as st, ConfigExport as t, GeneralHookFilter as tt, ModuleTypes as u, NormalizedInputOptions as ut, ImportKind as v, RolldownWatcherEvent as vt, PartialResolvedId as w, build as wt, ModuleType as x, rolldown as xt, LoadResult as y, RolldownWatcherWatcherEventMap as yt, ExistingRawSourceMap as z, ModuleFormat as zt };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Module } from "node:module";
|
|
2
|
+
import { MessageChannel } from "node:worker_threads";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
//#region ../../../node_modules/.pnpm/fresh-import@0.2.1/node_modules/fresh-import/dist/index.js
|
|
5
|
+
const instanceId = Math.random().toString(36).slice(2);
|
|
6
|
+
const relativeImportRE = /^\.{1,2}(?:\/|\\)/;
|
|
7
|
+
function escapeRegExp(value) {
|
|
8
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The tracking query name `fresh-import-<instance>`, where `<instance>` is a
|
|
12
|
+
* random value unique to this loaded module instance. Any two instances (even
|
|
13
|
+
* two copies of the same build loaded into the same process) get distinct
|
|
14
|
+
* names, so each hook only recognizes the imports it tagged itself.
|
|
15
|
+
*/
|
|
16
|
+
function buildQueryName() {
|
|
17
|
+
return `fresh-import-${instanceId}`;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Build the regex that matches the tracking query `?<name>=<id>,<context>`
|
|
21
|
+
* (or the `&<name>=...` form).
|
|
22
|
+
*/
|
|
23
|
+
function buildQueryRE(queryName) {
|
|
24
|
+
return new RegExp(`(?:\\?|&)${escapeRegExp(queryName)}=(\\d+),([^&]+)(?:&|$)`);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Build the tracking query `?<name>=<id>,<context>` that `collect` appends to
|
|
28
|
+
* the entry specifier. `id` cache-busts the import (a distinct URL forces a
|
|
29
|
+
* fresh evaluation) and `context` tags the import graph so the resolve hook can
|
|
30
|
+
* attribute resolved dependencies back to the originating collect.
|
|
31
|
+
*/
|
|
32
|
+
function formatTrackingQuery(queryName, id, context) {
|
|
33
|
+
return `?${queryName}=${id},${context}`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Shared body of the resolve hook for both the on-thread and off-thread
|
|
37
|
+
* importers. Given an already-resolved `result`, decides whether it is a tracked
|
|
38
|
+
* relative file dependency; if so, reports it via `onDependency` and tags the
|
|
39
|
+
* URL so the query propagates to its own dependencies.
|
|
40
|
+
*
|
|
41
|
+
* The sync/async difference between the two hooks lives entirely in the caller
|
|
42
|
+
* (which awaits `nextResolve` or not); this function performs no I/O. `result`
|
|
43
|
+
* is mutated in place and returned.
|
|
44
|
+
*/
|
|
45
|
+
function trackResolved(specifier, context, result, queryName, queryRE, onDependency) {
|
|
46
|
+
const isRelativeImport = relativeImportRE.test(specifier);
|
|
47
|
+
if (result.format === "builtin" || !isRelativeImport) return result;
|
|
48
|
+
if (!context.parentURL || queryRE.test(result.url) || !result.url.startsWith("file:")) return result;
|
|
49
|
+
const m = queryRE.exec(context.parentURL);
|
|
50
|
+
if (m) {
|
|
51
|
+
const [, id, contextFile] = m;
|
|
52
|
+
onDependency(contextFile, result.url);
|
|
53
|
+
result.url = result.url.replace(/(\?)|$/, (_n, n1) => `?${queryName}=${id},${contextFile}${n1 === "?" ? "&" : ""}`);
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
var loader_default = "data:text/javascript,Math.random().toString(36).slice(2);%0Aconst relativeImportRE = /^\\.{1,2}(%3F:\\/|\\\\)/;%0Afunction escapeRegExp(value) {%0A%09return value.replace(/[.*+%3F^${}()|[\\]\\\\]/g, \"\\\\$&\");%0A}%0A/**%0A* Build the regex that matches the tracking query `%3F<name>=<id>,<context>`%0A* (or the `&<name>=...` form).%0A*/%0Afunction buildQueryRE(queryName) {%0A%09return new RegExp(`(%3F:\\\\%3F|&)${escapeRegExp(queryName)}=(\\\\d+),([^&]+)(%3F:&|$)`);%0A}%0A/**%0A* Shared body of the resolve hook for both the on-thread and off-thread%0A* importers. Given an already-resolved `result`, decides whether it is a tracked%0A* relative file dependency; if so, reports it via `onDependency` and tags the%0A* URL so the query propagates to its own dependencies.%0A*%0A* The sync/async difference between the two hooks lives entirely in the caller%0A* (which awaits `nextResolve` or not); this function performs no I/O. `result`%0A* is mutated in place and returned.%0A*/%0Afunction trackResolved(specifier, context, result, queryName, queryRE, onDependency) {%0A%09const isRelativeImport = relativeImportRE.test(specifier);%0A%09if (result.format === \"builtin\" || !isRelativeImport) return result;%0A%09if (!context.parentURL || queryRE.test(result.url) || !result.url.startsWith(\"file:\")) return result;%0A%09const m = queryRE.exec(context.parentURL);%0A%09if (m) {%0A%09%09const [, id, contextFile] = m;%0A%09%09onDependency(contextFile, result.url);%0A%09%09result.url = result.url.replace(/(\\%3F)|$/, (_n, n1) => `%3F${queryName}=${id},${contextFile}${n1 === \"%3F\" %3F \"&\" : \"\"}`);%0A%09}%0A%09return result;%0A}%0A//%23endregion%0A//%23region src/off-thread/loader.ts%0Alet port;%0Alet queryName;%0Alet queryRE;%0Aconst initialize = async (data) => {%0A%09port = data.port;%0A%09queryName = data.queryName;%0A%09queryRE = buildQueryRE(queryName);%0A};%0Aconst resolve = async (specifier, context, nextResolve) => {%0A%09return trackResolved(specifier, context, await nextResolve(specifier, context), queryName, queryRE, (ctx, url) => {%0A%09%09port.postMessage({%0A%09%09%09context: ctx,%0A%09%09%09url%0A%09%09});%0A%09});%0A};%0A//%23endregion%0Aexport { initialize, resolve };%0A";
|
|
58
|
+
let nextId$1 = 0;
|
|
59
|
+
/**
|
|
60
|
+
* Off-thread importer: registers an ESM loader in a worker thread via
|
|
61
|
+
* `Module.register` and receives tracked dependencies over a `MessagePort`.
|
|
62
|
+
* Used on Node versions without `Module.registerHooks`.
|
|
63
|
+
*/
|
|
64
|
+
function createOffThreadImporter() {
|
|
65
|
+
const queryName = buildQueryName();
|
|
66
|
+
const { port1, port2 } = new MessageChannel();
|
|
67
|
+
Module.register(loader_default, {
|
|
68
|
+
data: {
|
|
69
|
+
port: port2,
|
|
70
|
+
queryName
|
|
71
|
+
},
|
|
72
|
+
transferList: [port2]
|
|
73
|
+
});
|
|
74
|
+
port1.unref();
|
|
75
|
+
return { async collect(specifier) {
|
|
76
|
+
const id = nextId$1++;
|
|
77
|
+
const depsList = /* @__PURE__ */ new Set();
|
|
78
|
+
const onMessage = (e) => {
|
|
79
|
+
if (e.context === specifier) depsList.add(e.url);
|
|
80
|
+
};
|
|
81
|
+
port1.on("message", onMessage);
|
|
82
|
+
port1.unref();
|
|
83
|
+
try {
|
|
84
|
+
const result = await import(specifier + formatTrackingQuery(queryName, id, specifier));
|
|
85
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
86
|
+
return {
|
|
87
|
+
result,
|
|
88
|
+
dependencies: [...depsList].filter((url) => url.startsWith("file:")).map((url) => fileURLToPath(url))
|
|
89
|
+
};
|
|
90
|
+
} finally {
|
|
91
|
+
port1.off("message", onMessage);
|
|
92
|
+
}
|
|
93
|
+
} };
|
|
94
|
+
}
|
|
95
|
+
let nextId = 0;
|
|
96
|
+
/**
|
|
97
|
+
* On-thread importer: registers synchronous resolution hooks via
|
|
98
|
+
* `Module.registerHooks` (Node 22.15+/23.5+).
|
|
99
|
+
*/
|
|
100
|
+
function createOnThreadImporter() {
|
|
101
|
+
const registry = /* @__PURE__ */ new Map();
|
|
102
|
+
const queryName = buildQueryName();
|
|
103
|
+
const queryRE = buildQueryRE(queryName);
|
|
104
|
+
const resolve = (specifier, context, nextResolve) => {
|
|
105
|
+
return trackResolved(specifier, context, nextResolve(specifier, context), queryName, queryRE, (ctx, url) => {
|
|
106
|
+
registry.get(ctx)?.add(url);
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
Module.registerHooks({ resolve });
|
|
110
|
+
return { async collect(specifier) {
|
|
111
|
+
const id = nextId++;
|
|
112
|
+
const depsList = /* @__PURE__ */ new Set();
|
|
113
|
+
registry.set(specifier, depsList);
|
|
114
|
+
try {
|
|
115
|
+
return {
|
|
116
|
+
result: await import(specifier + formatTrackingQuery(queryName, id, specifier)),
|
|
117
|
+
dependencies: [...depsList].filter((url) => url.startsWith("file:")).map((url) => fileURLToPath(url))
|
|
118
|
+
};
|
|
119
|
+
} finally {
|
|
120
|
+
registry.delete(specifier);
|
|
121
|
+
}
|
|
122
|
+
} };
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Create the importer best suited to the current runtime, or `undefined` if it
|
|
126
|
+
* provides neither module-hook API.
|
|
127
|
+
*/
|
|
128
|
+
function createImporter() {
|
|
129
|
+
if (Module.registerHooks) return createOnThreadImporter();
|
|
130
|
+
if (Module.register) return createOffThreadImporter();
|
|
131
|
+
}
|
|
132
|
+
let importer;
|
|
133
|
+
let initialized = false;
|
|
134
|
+
/**
|
|
135
|
+
* Import an ESM entry in its own fresh module graph (separate from Node's module
|
|
136
|
+
* cache and from other concurrent imports) and report the dependency files it
|
|
137
|
+
* pulled in.
|
|
138
|
+
*
|
|
139
|
+
* Each call re-evaluates the entry in a fresh graph; concurrent calls stay
|
|
140
|
+
* isolated from one another. Only statically-imported relative dependencies are
|
|
141
|
+
* tracked, not dynamic imports.
|
|
142
|
+
*
|
|
143
|
+
* Returns `undefined` on runtimes that provide neither `Module.registerHooks`
|
|
144
|
+
* nor `Module.register`.
|
|
145
|
+
*/
|
|
146
|
+
function freshImport(specifier) {
|
|
147
|
+
if (!initialized) {
|
|
148
|
+
importer = createImporter();
|
|
149
|
+
initialized = true;
|
|
150
|
+
}
|
|
151
|
+
return importer?.collect(specifier);
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
export { freshImport };
|