@rspack/core 1.1.0-beta.0 → 1.1.0
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/compiled/enhanced-resolve/CachedInputFileSystem.js +267 -80
- package/compiled/enhanced-resolve/index.d.ts +849 -236
- package/compiled/enhanced-resolve/package.json +1 -1
- package/compiled/graceful-fs/index.js +10 -10
- package/compiled/graceful-fs/package.json +1 -1
- package/compiled/zod/index.d.ts +2 -2
- package/dist/Compilation.d.ts +1 -1
- package/dist/DependenciesBlock.d.ts +6 -4
- package/dist/Module.d.ts +16 -15
- package/dist/builtin-plugin/EntryPlugin.d.ts +14 -11
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +10 -10
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +10 -10
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +8 -10
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +3 -3
- package/dist/builtin-plugin/lazy-compilation/plugin.d.ts +3 -3
- package/dist/config/normalization.d.ts +3 -11
- package/dist/config/types.d.ts +28 -6
- package/dist/config/zod.d.ts +243 -93
- package/dist/exports.d.ts +2 -2
- package/dist/index.js +619 -269
- package/package.json +6 -6
- package/dist/lib/Dependency.d.ts +0 -23
- package/dist/lib/formatLocation.d.ts +0 -16
- package/dist/logging/runtime.d.ts +0 -16
- package/dist/util/IterableHelpers.d.ts +0 -12
- package/dist/util/scheme.d.ts +0 -6
- package/dist/util/webpack.d.ts +0 -4
package/dist/index.js
CHANGED
|
@@ -143,9 +143,9 @@ var require_lib = __commonJS({
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
// ../../node_modules/.pnpm/enhanced-resolve@5.
|
|
146
|
+
// ../../node_modules/.pnpm/enhanced-resolve@5.17.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js
|
|
147
147
|
var require_CachedInputFileSystem = __commonJS({
|
|
148
|
-
"../../node_modules/.pnpm/enhanced-resolve@5.
|
|
148
|
+
"../../node_modules/.pnpm/enhanced-resolve@5.17.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"(exports2, module2) {
|
|
149
149
|
"use strict";
|
|
150
150
|
var nextTick = require("process").nextTick;
|
|
151
151
|
var dirname4 = (path10) => {
|
|
@@ -177,46 +177,81 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
177
177
|
};
|
|
178
178
|
var OperationMergerBackend = class {
|
|
179
179
|
/**
|
|
180
|
-
* @param {
|
|
181
|
-
* @param {
|
|
182
|
-
* @param {
|
|
180
|
+
* @param {Function | undefined} provider async method in filesystem
|
|
181
|
+
* @param {Function | undefined} syncProvider sync method in filesystem
|
|
182
|
+
* @param {BaseFileSystem} providerContext call context for the provider methods
|
|
183
183
|
*/
|
|
184
184
|
constructor(provider, syncProvider, providerContext) {
|
|
185
185
|
this._provider = provider;
|
|
186
186
|
this._syncProvider = syncProvider;
|
|
187
187
|
this._providerContext = providerContext;
|
|
188
188
|
this._activeAsyncOperations = /* @__PURE__ */ new Map();
|
|
189
|
-
this.provide = this._provider ? (
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
189
|
+
this.provide = this._provider ? (
|
|
190
|
+
/**
|
|
191
|
+
* @param {PathLike | PathOrFileDescriptor} path path
|
|
192
|
+
* @param {object | FileSystemCallback<any> | undefined} options options
|
|
193
|
+
* @param {FileSystemCallback<any>=} callback callback
|
|
194
|
+
* @returns {any} result
|
|
195
|
+
*/
|
|
196
|
+
(path10, options, callback) => {
|
|
197
|
+
if (typeof options === "function") {
|
|
198
|
+
callback = /** @type {FileSystemCallback<any>} */
|
|
199
|
+
options;
|
|
200
|
+
options = void 0;
|
|
201
|
+
}
|
|
202
|
+
if (typeof path10 !== "string" && !Buffer.isBuffer(path10) && !(path10 instanceof URL) && typeof path10 !== "number") {
|
|
203
|
+
callback(
|
|
204
|
+
new TypeError("path must be a string, Buffer, URL or number")
|
|
205
|
+
);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (options) {
|
|
209
|
+
return (
|
|
210
|
+
/** @type {Function} */
|
|
211
|
+
this._provider.call(
|
|
212
|
+
this._providerContext,
|
|
213
|
+
path10,
|
|
214
|
+
options,
|
|
215
|
+
callback
|
|
216
|
+
)
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
let callbacks = this._activeAsyncOperations.get(path10);
|
|
220
|
+
if (callbacks) {
|
|
221
|
+
callbacks.push(callback);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
this._activeAsyncOperations.set(path10, callbacks = [callback]);
|
|
225
|
+
provider(
|
|
197
226
|
path10,
|
|
198
|
-
|
|
199
|
-
|
|
227
|
+
/**
|
|
228
|
+
* @param {Error} err error
|
|
229
|
+
* @param {any} result result
|
|
230
|
+
*/
|
|
231
|
+
(err, result2) => {
|
|
232
|
+
this._activeAsyncOperations.delete(path10);
|
|
233
|
+
runCallbacks(callbacks, err, result2);
|
|
234
|
+
}
|
|
200
235
|
);
|
|
201
236
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
237
|
+
) : null;
|
|
238
|
+
this.provideSync = this._syncProvider ? (
|
|
239
|
+
/**
|
|
240
|
+
* @param {PathLike | PathOrFileDescriptor} path path
|
|
241
|
+
* @param {object=} options options
|
|
242
|
+
* @returns {any} result
|
|
243
|
+
*/
|
|
244
|
+
(path10, options) => {
|
|
245
|
+
return (
|
|
246
|
+
/** @type {Function} */
|
|
247
|
+
this._syncProvider.call(
|
|
248
|
+
this._providerContext,
|
|
249
|
+
path10,
|
|
250
|
+
options
|
|
251
|
+
)
|
|
252
|
+
);
|
|
210
253
|
}
|
|
211
|
-
|
|
212
|
-
provider(path10, (err, result2) => {
|
|
213
|
-
this._activeAsyncOperations.delete(path10);
|
|
214
|
-
runCallbacks(callbacks, err, result2);
|
|
215
|
-
});
|
|
216
|
-
} : null;
|
|
217
|
-
this.provideSync = this._syncProvider ? (path10, options) => {
|
|
218
|
-
return this._syncProvider.call(this._providerContext, path10, options);
|
|
219
|
-
} : null;
|
|
254
|
+
) : null;
|
|
220
255
|
}
|
|
221
256
|
purge() {
|
|
222
257
|
}
|
|
@@ -229,9 +264,9 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
229
264
|
var CacheBackend = class {
|
|
230
265
|
/**
|
|
231
266
|
* @param {number} duration max cache duration of items
|
|
232
|
-
* @param {
|
|
233
|
-
* @param {
|
|
234
|
-
* @param {
|
|
267
|
+
* @param {function | undefined} provider async method
|
|
268
|
+
* @param {function | undefined} syncProvider sync method
|
|
269
|
+
* @param {BaseFileSystem} providerContext call context for the provider methods
|
|
235
270
|
*/
|
|
236
271
|
constructor(duration, provider, syncProvider, providerContext) {
|
|
237
272
|
this._duration = duration;
|
|
@@ -251,75 +286,132 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
251
286
|
this.provide = provider ? this.provide.bind(this) : null;
|
|
252
287
|
this.provideSync = syncProvider ? this.provideSync.bind(this) : null;
|
|
253
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* @param {PathLike | PathOrFileDescriptor} path path
|
|
291
|
+
* @param {any} options options
|
|
292
|
+
* @param {FileSystemCallback<any>} callback callback
|
|
293
|
+
* @returns {void}
|
|
294
|
+
*/
|
|
254
295
|
provide(path10, options, callback) {
|
|
255
296
|
if (typeof options === "function") {
|
|
256
297
|
callback = options;
|
|
257
298
|
options = void 0;
|
|
258
299
|
}
|
|
259
|
-
if (typeof path10 !== "string") {
|
|
260
|
-
callback(new TypeError("path must be a string"));
|
|
300
|
+
if (typeof path10 !== "string" && !Buffer.isBuffer(path10) && !(path10 instanceof URL) && typeof path10 !== "number") {
|
|
301
|
+
callback(new TypeError("path must be a string, Buffer, URL or number"));
|
|
261
302
|
return;
|
|
262
303
|
}
|
|
304
|
+
const strPath = typeof path10 !== "string" ? path10.toString() : path10;
|
|
263
305
|
if (options) {
|
|
264
|
-
return
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
306
|
+
return (
|
|
307
|
+
/** @type {Function} */
|
|
308
|
+
this._provider.call(
|
|
309
|
+
this._providerContext,
|
|
310
|
+
path10,
|
|
311
|
+
options,
|
|
312
|
+
callback
|
|
313
|
+
)
|
|
269
314
|
);
|
|
270
315
|
}
|
|
271
316
|
if (this._mode === STORAGE_MODE_SYNC) {
|
|
272
317
|
this._enterAsyncMode();
|
|
273
318
|
}
|
|
274
|
-
let cacheEntry = this._data.get(
|
|
319
|
+
let cacheEntry = this._data.get(strPath);
|
|
275
320
|
if (cacheEntry !== void 0) {
|
|
276
321
|
if (cacheEntry.err) return nextTick(callback, cacheEntry.err);
|
|
277
322
|
return nextTick(callback, null, cacheEntry.result);
|
|
278
323
|
}
|
|
279
|
-
let callbacks = this._activeAsyncOperations.get(
|
|
324
|
+
let callbacks = this._activeAsyncOperations.get(strPath);
|
|
280
325
|
if (callbacks !== void 0) {
|
|
281
326
|
callbacks.push(callback);
|
|
282
327
|
return;
|
|
283
328
|
}
|
|
284
|
-
this._activeAsyncOperations.set(
|
|
285
|
-
this._provider.call(
|
|
286
|
-
this.
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
329
|
+
this._activeAsyncOperations.set(strPath, callbacks = [callback]);
|
|
330
|
+
this._provider.call(
|
|
331
|
+
this._providerContext,
|
|
332
|
+
path10,
|
|
333
|
+
/**
|
|
334
|
+
* @param {Error | null} err error
|
|
335
|
+
* @param {any} [result] result
|
|
336
|
+
*/
|
|
337
|
+
(err, result2) => {
|
|
338
|
+
this._activeAsyncOperations.delete(strPath);
|
|
339
|
+
this._storeResult(strPath, err, result2);
|
|
340
|
+
this._enterAsyncMode();
|
|
341
|
+
runCallbacks(
|
|
342
|
+
/** @type {FileSystemCallback<any>[]} */
|
|
343
|
+
callbacks,
|
|
344
|
+
err,
|
|
345
|
+
result2
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
);
|
|
291
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* @param {PathLike | PathOrFileDescriptor} path path
|
|
352
|
+
* @param {any} options options
|
|
353
|
+
* @returns {any} result
|
|
354
|
+
*/
|
|
292
355
|
provideSync(path10, options) {
|
|
293
|
-
if (typeof path10 !== "string") {
|
|
356
|
+
if (typeof path10 !== "string" && !Buffer.isBuffer(path10) && !(path10 instanceof URL) && typeof path10 !== "number") {
|
|
294
357
|
throw new TypeError("path must be a string");
|
|
295
358
|
}
|
|
359
|
+
const strPath = typeof path10 !== "string" ? path10.toString() : path10;
|
|
296
360
|
if (options) {
|
|
297
|
-
return
|
|
361
|
+
return (
|
|
362
|
+
/** @type {Function} */
|
|
363
|
+
this._syncProvider.call(
|
|
364
|
+
this._providerContext,
|
|
365
|
+
path10,
|
|
366
|
+
options
|
|
367
|
+
)
|
|
368
|
+
);
|
|
298
369
|
}
|
|
299
370
|
if (this._mode === STORAGE_MODE_SYNC) {
|
|
300
371
|
this._runDecays();
|
|
301
372
|
}
|
|
302
|
-
let cacheEntry = this._data.get(
|
|
373
|
+
let cacheEntry = this._data.get(strPath);
|
|
303
374
|
if (cacheEntry !== void 0) {
|
|
304
375
|
if (cacheEntry.err) throw cacheEntry.err;
|
|
305
376
|
return cacheEntry.result;
|
|
306
377
|
}
|
|
307
|
-
const callbacks = this._activeAsyncOperations.get(
|
|
308
|
-
this._activeAsyncOperations.delete(
|
|
378
|
+
const callbacks = this._activeAsyncOperations.get(strPath);
|
|
379
|
+
this._activeAsyncOperations.delete(strPath);
|
|
309
380
|
let result2;
|
|
310
381
|
try {
|
|
311
|
-
result2 =
|
|
382
|
+
result2 = /** @type {Function} */
|
|
383
|
+
this._syncProvider.call(
|
|
384
|
+
this._providerContext,
|
|
385
|
+
path10
|
|
386
|
+
);
|
|
312
387
|
} catch (err) {
|
|
313
|
-
this._storeResult(
|
|
388
|
+
this._storeResult(
|
|
389
|
+
strPath,
|
|
390
|
+
/** @type {Error} */
|
|
391
|
+
err,
|
|
392
|
+
void 0
|
|
393
|
+
);
|
|
314
394
|
this._enterSyncModeWhenIdle();
|
|
315
|
-
if (callbacks)
|
|
395
|
+
if (callbacks) {
|
|
396
|
+
runCallbacks(
|
|
397
|
+
callbacks,
|
|
398
|
+
/** @type {Error} */
|
|
399
|
+
err,
|
|
400
|
+
void 0
|
|
401
|
+
);
|
|
402
|
+
}
|
|
316
403
|
throw err;
|
|
317
404
|
}
|
|
318
|
-
this._storeResult(
|
|
405
|
+
this._storeResult(strPath, null, result2);
|
|
319
406
|
this._enterSyncModeWhenIdle();
|
|
320
|
-
if (callbacks)
|
|
407
|
+
if (callbacks) {
|
|
408
|
+
runCallbacks(callbacks, null, result2);
|
|
409
|
+
}
|
|
321
410
|
return result2;
|
|
322
411
|
}
|
|
412
|
+
/**
|
|
413
|
+
* @param {string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set<string | URL | Buffer | number>} [what] what to purge
|
|
414
|
+
*/
|
|
323
415
|
purge(what) {
|
|
324
416
|
if (!what) {
|
|
325
417
|
if (this._mode !== STORAGE_MODE_IDLE) {
|
|
@@ -329,9 +421,10 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
329
421
|
}
|
|
330
422
|
this._enterIdleMode();
|
|
331
423
|
}
|
|
332
|
-
} else if (typeof what === "string") {
|
|
424
|
+
} else if (typeof what === "string" || Buffer.isBuffer(what) || what instanceof URL || typeof what === "number") {
|
|
425
|
+
const strWhat = typeof what !== "string" ? what.toString() : what;
|
|
333
426
|
for (let [key, data] of this._data) {
|
|
334
|
-
if (key.startsWith(
|
|
427
|
+
if (key.startsWith(strWhat)) {
|
|
335
428
|
this._data.delete(key);
|
|
336
429
|
data.level.delete(key);
|
|
337
430
|
}
|
|
@@ -342,7 +435,8 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
342
435
|
} else {
|
|
343
436
|
for (let [key, data] of this._data) {
|
|
344
437
|
for (const item of what) {
|
|
345
|
-
|
|
438
|
+
const strItem = typeof item !== "string" ? item.toString() : item;
|
|
439
|
+
if (key.startsWith(strItem)) {
|
|
346
440
|
this._data.delete(key);
|
|
347
441
|
data.level.delete(key);
|
|
348
442
|
break;
|
|
@@ -354,19 +448,29 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
354
448
|
}
|
|
355
449
|
}
|
|
356
450
|
}
|
|
451
|
+
/**
|
|
452
|
+
* @param {string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set<string | URL | Buffer | number>} [what] what to purge
|
|
453
|
+
*/
|
|
357
454
|
purgeParent(what) {
|
|
358
455
|
if (!what) {
|
|
359
456
|
this.purge();
|
|
360
|
-
} else if (typeof what === "string") {
|
|
361
|
-
|
|
457
|
+
} else if (typeof what === "string" || Buffer.isBuffer(what) || what instanceof URL || typeof what === "number") {
|
|
458
|
+
const strWhat = typeof what !== "string" ? what.toString() : what;
|
|
459
|
+
this.purge(dirname4(strWhat));
|
|
362
460
|
} else {
|
|
363
461
|
const set = /* @__PURE__ */ new Set();
|
|
364
462
|
for (const item of what) {
|
|
365
|
-
|
|
463
|
+
const strItem = typeof item !== "string" ? item.toString() : item;
|
|
464
|
+
set.add(dirname4(strItem));
|
|
366
465
|
}
|
|
367
466
|
this.purge(set);
|
|
368
467
|
}
|
|
369
468
|
}
|
|
469
|
+
/**
|
|
470
|
+
* @param {string} path path
|
|
471
|
+
* @param {Error | null} err error
|
|
472
|
+
* @param {any} result result
|
|
473
|
+
*/
|
|
370
474
|
_storeResult(path10, err, result2) {
|
|
371
475
|
if (this._data.has(path10)) return;
|
|
372
476
|
const level = this._levels[this._currentLevel];
|
|
@@ -406,7 +510,11 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
406
510
|
break;
|
|
407
511
|
case STORAGE_MODE_SYNC:
|
|
408
512
|
this._runDecays();
|
|
409
|
-
if (
|
|
513
|
+
if (
|
|
514
|
+
/** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC}*/
|
|
515
|
+
this._mode === STORAGE_MODE_IDLE
|
|
516
|
+
)
|
|
517
|
+
return;
|
|
410
518
|
timeout = Math.max(
|
|
411
519
|
0,
|
|
412
520
|
/** @type {number} */
|
|
@@ -441,6 +549,10 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
441
549
|
return new OperationMergerBackend(provider, syncProvider, providerContext);
|
|
442
550
|
};
|
|
443
551
|
module2.exports = class CachedInputFileSystem {
|
|
552
|
+
/**
|
|
553
|
+
* @param {BaseFileSystem} fileSystem file system
|
|
554
|
+
* @param {number} duration duration in ms files are cached
|
|
555
|
+
*/
|
|
444
556
|
constructor(fileSystem, duration) {
|
|
445
557
|
this.fileSystem = fileSystem;
|
|
446
558
|
this._lstatBackend = createBackend(
|
|
@@ -493,7 +605,12 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
493
605
|
readFileSync2;
|
|
494
606
|
this._readJsonBackend = createBackend(
|
|
495
607
|
duration,
|
|
496
|
-
|
|
608
|
+
// prettier-ignore
|
|
609
|
+
this.fileSystem.readJson || this.readFile && /**
|
|
610
|
+
* @param {string} path path
|
|
611
|
+
* @param {FileSystemCallback<any>} callback
|
|
612
|
+
*/
|
|
613
|
+
((path10, callback) => {
|
|
497
614
|
this.readFile(path10, (err, buffer) => {
|
|
498
615
|
if (err) return callback(err);
|
|
499
616
|
if (!buffer || buffer.length === 0)
|
|
@@ -502,12 +619,20 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
502
619
|
try {
|
|
503
620
|
data = JSON.parse(buffer.toString("utf-8"));
|
|
504
621
|
} catch (e) {
|
|
505
|
-
return callback(
|
|
622
|
+
return callback(
|
|
623
|
+
/** @type {Error} */
|
|
624
|
+
e
|
|
625
|
+
);
|
|
506
626
|
}
|
|
507
627
|
callback(null, data);
|
|
508
628
|
});
|
|
509
629
|
}),
|
|
510
|
-
|
|
630
|
+
// prettier-ignore
|
|
631
|
+
this.fileSystem.readJsonSync || this.readFileSync && /**
|
|
632
|
+
* @param {string} path path
|
|
633
|
+
* @returns {any} result
|
|
634
|
+
*/
|
|
635
|
+
((path10) => {
|
|
511
636
|
const buffer = this.readFileSync(path10);
|
|
512
637
|
const data = JSON.parse(buffer.toString("utf-8"));
|
|
513
638
|
return data;
|
|
@@ -532,7 +657,22 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
532
657
|
const readlinkSync = this._readlinkBackend.provideSync;
|
|
533
658
|
this.readlinkSync = /** @type {SyncFileSystem["readlinkSync"]} */
|
|
534
659
|
readlinkSync;
|
|
660
|
+
this._realpathBackend = createBackend(
|
|
661
|
+
duration,
|
|
662
|
+
this.fileSystem.realpath,
|
|
663
|
+
this.fileSystem.realpathSync,
|
|
664
|
+
this.fileSystem
|
|
665
|
+
);
|
|
666
|
+
const realpath = this._realpathBackend.provide;
|
|
667
|
+
this.realpath = /** @type {FileSystem["realpath"]} */
|
|
668
|
+
realpath;
|
|
669
|
+
const realpathSync = this._realpathBackend.provideSync;
|
|
670
|
+
this.realpathSync = /** @type {SyncFileSystem["realpathSync"]} */
|
|
671
|
+
realpathSync;
|
|
535
672
|
}
|
|
673
|
+
/**
|
|
674
|
+
* @param {string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set<string | URL | Buffer | number>} [what] what to purge
|
|
675
|
+
*/
|
|
536
676
|
purge(what) {
|
|
537
677
|
this._statBackend.purge(what);
|
|
538
678
|
this._lstatBackend.purge(what);
|
|
@@ -540,6 +680,7 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
540
680
|
this._readFileBackend.purge(what);
|
|
541
681
|
this._readlinkBackend.purge(what);
|
|
542
682
|
this._readJsonBackend.purge(what);
|
|
683
|
+
this._realpathBackend.purge(what);
|
|
543
684
|
}
|
|
544
685
|
};
|
|
545
686
|
}
|
|
@@ -996,14 +1137,28 @@ var Dependency = class _Dependency {
|
|
|
996
1137
|
// src/DependenciesBlock.ts
|
|
997
1138
|
var DependenciesBlock = class _DependenciesBlock {
|
|
998
1139
|
#binding;
|
|
999
|
-
|
|
1000
|
-
|
|
1140
|
+
static __from_binding(binding3) {
|
|
1141
|
+
return new _DependenciesBlock(binding3);
|
|
1001
1142
|
}
|
|
1002
|
-
|
|
1003
|
-
return
|
|
1143
|
+
static __to_binding(block) {
|
|
1144
|
+
return block.#binding;
|
|
1004
1145
|
}
|
|
1005
|
-
|
|
1006
|
-
|
|
1146
|
+
constructor(binding3) {
|
|
1147
|
+
this.#binding = binding3;
|
|
1148
|
+
Object.defineProperties(this, {
|
|
1149
|
+
dependencies: {
|
|
1150
|
+
enumerable: true,
|
|
1151
|
+
get() {
|
|
1152
|
+
return binding3.dependencies.map((d) => Dependency.__from_binding(d));
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
blocks: {
|
|
1156
|
+
enumerable: true,
|
|
1157
|
+
get() {
|
|
1158
|
+
return binding3.blocks.map((b) => _DependenciesBlock.__from_binding(b));
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
});
|
|
1007
1162
|
}
|
|
1008
1163
|
};
|
|
1009
1164
|
|
|
@@ -1083,21 +1238,10 @@ var ContextModuleFactoryBeforeResolveData = class _ContextModuleFactoryBeforeRes
|
|
|
1083
1238
|
regExp: {
|
|
1084
1239
|
enumerable: true,
|
|
1085
1240
|
get() {
|
|
1086
|
-
|
|
1087
|
-
return void 0;
|
|
1088
|
-
}
|
|
1089
|
-
const { source, flags } = binding3.regExp;
|
|
1090
|
-
return new RegExp(source, flags);
|
|
1241
|
+
return binding3.regExp;
|
|
1091
1242
|
},
|
|
1092
1243
|
set(val) {
|
|
1093
|
-
|
|
1094
|
-
binding3.regExp = void 0;
|
|
1095
|
-
return;
|
|
1096
|
-
}
|
|
1097
|
-
binding3.regExp = {
|
|
1098
|
-
source: val.source,
|
|
1099
|
-
flags: val.flags
|
|
1100
|
-
};
|
|
1244
|
+
binding3.regExp = val;
|
|
1101
1245
|
}
|
|
1102
1246
|
},
|
|
1103
1247
|
recursive: {
|
|
@@ -1153,21 +1297,10 @@ var ContextModuleFactoryAfterResolveData = class _ContextModuleFactoryAfterResol
|
|
|
1153
1297
|
regExp: {
|
|
1154
1298
|
enumerable: true,
|
|
1155
1299
|
get() {
|
|
1156
|
-
|
|
1157
|
-
return void 0;
|
|
1158
|
-
}
|
|
1159
|
-
const { source, flags } = binding3.regExp;
|
|
1160
|
-
return new RegExp(source, flags);
|
|
1300
|
+
return binding3.regExp;
|
|
1161
1301
|
},
|
|
1162
1302
|
set(val) {
|
|
1163
|
-
|
|
1164
|
-
binding3.regExp = void 0;
|
|
1165
|
-
return;
|
|
1166
|
-
}
|
|
1167
|
-
binding3.regExp = {
|
|
1168
|
-
source: val.source,
|
|
1169
|
-
flags: val.flags
|
|
1170
|
-
};
|
|
1303
|
+
binding3.regExp = val;
|
|
1171
1304
|
}
|
|
1172
1305
|
},
|
|
1173
1306
|
recursive: {
|
|
@@ -1190,46 +1323,128 @@ var ContextModuleFactoryAfterResolveData = class _ContextModuleFactoryAfterResol
|
|
|
1190
1323
|
});
|
|
1191
1324
|
}
|
|
1192
1325
|
};
|
|
1326
|
+
var MODULE_MAPPINGS = /* @__PURE__ */ new WeakMap();
|
|
1193
1327
|
var Module = class _Module {
|
|
1194
1328
|
#inner;
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1329
|
+
static __from_binding(binding3, compilation) {
|
|
1330
|
+
let module2 = MODULE_MAPPINGS.get(binding3);
|
|
1331
|
+
if (module2) {
|
|
1332
|
+
return module2;
|
|
1333
|
+
}
|
|
1334
|
+
module2 = new _Module(binding3, compilation);
|
|
1335
|
+
MODULE_MAPPINGS.set(binding3, module2);
|
|
1336
|
+
return module2;
|
|
1198
1337
|
}
|
|
1199
1338
|
constructor(module2, compilation) {
|
|
1200
1339
|
this.#inner = module2;
|
|
1201
|
-
this.type = module2.type;
|
|
1202
|
-
this.layer = module2.layer ?? null;
|
|
1203
|
-
this.context = module2.context;
|
|
1204
|
-
this.resource = module2.resource;
|
|
1205
|
-
this.request = module2.request;
|
|
1206
|
-
this.userRequest = module2.userRequest;
|
|
1207
|
-
this.rawRequest = module2.rawRequest;
|
|
1208
|
-
this.factoryMeta = module2.factoryMeta;
|
|
1209
|
-
const customModule = compilation == null ? void 0 : compilation.__internal__getCustomModule(
|
|
1210
|
-
module2.moduleIdentifier
|
|
1211
|
-
);
|
|
1212
|
-
this.buildInfo = (customModule == null ? void 0 : customModule.buildInfo) || {};
|
|
1213
|
-
this.buildMeta = (customModule == null ? void 0 : customModule.buildMeta) || {};
|
|
1214
1340
|
Object.defineProperties(this, {
|
|
1341
|
+
type: {
|
|
1342
|
+
enumerable: true,
|
|
1343
|
+
get() {
|
|
1344
|
+
return module2.type || null;
|
|
1345
|
+
}
|
|
1346
|
+
},
|
|
1347
|
+
layer: {
|
|
1348
|
+
enumerable: true,
|
|
1349
|
+
get() {
|
|
1350
|
+
return module2.layer;
|
|
1351
|
+
}
|
|
1352
|
+
},
|
|
1353
|
+
context: {
|
|
1354
|
+
enumerable: true,
|
|
1355
|
+
get() {
|
|
1356
|
+
return module2.context;
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
resource: {
|
|
1360
|
+
enumerable: true,
|
|
1361
|
+
get() {
|
|
1362
|
+
return module2.resource;
|
|
1363
|
+
}
|
|
1364
|
+
},
|
|
1365
|
+
request: {
|
|
1366
|
+
enumerable: true,
|
|
1367
|
+
get() {
|
|
1368
|
+
return module2.request;
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
1371
|
+
userRequest: {
|
|
1372
|
+
enumerable: true,
|
|
1373
|
+
get() {
|
|
1374
|
+
return module2.userRequest;
|
|
1375
|
+
},
|
|
1376
|
+
set(val) {
|
|
1377
|
+
module2.userRequest = val;
|
|
1378
|
+
}
|
|
1379
|
+
},
|
|
1380
|
+
rawRequest: {
|
|
1381
|
+
enumerable: true,
|
|
1382
|
+
get() {
|
|
1383
|
+
return module2.rawRequest;
|
|
1384
|
+
}
|
|
1385
|
+
},
|
|
1386
|
+
factoryMeta: {
|
|
1387
|
+
enumerable: true,
|
|
1388
|
+
get() {
|
|
1389
|
+
return module2.factoryMeta;
|
|
1390
|
+
}
|
|
1391
|
+
},
|
|
1215
1392
|
modules: {
|
|
1216
1393
|
enumerable: true,
|
|
1217
1394
|
get() {
|
|
1218
|
-
if (module2 instanceof import_binding4.
|
|
1395
|
+
if (module2 instanceof import_binding4.JsModule) {
|
|
1219
1396
|
return module2.modules ? module2.modules.map((m) => _Module.__from_binding(m)) : void 0;
|
|
1220
1397
|
}
|
|
1221
1398
|
return void 0;
|
|
1222
1399
|
}
|
|
1400
|
+
},
|
|
1401
|
+
buildInfo: {
|
|
1402
|
+
enumerable: true,
|
|
1403
|
+
get() {
|
|
1404
|
+
const customModule = compilation == null ? void 0 : compilation.__internal__getCustomModule(
|
|
1405
|
+
module2.moduleIdentifier
|
|
1406
|
+
);
|
|
1407
|
+
return (customModule == null ? void 0 : customModule.buildInfo) || {};
|
|
1408
|
+
}
|
|
1409
|
+
},
|
|
1410
|
+
buildMeta: {
|
|
1411
|
+
enumerable: true,
|
|
1412
|
+
get() {
|
|
1413
|
+
const customModule = compilation == null ? void 0 : compilation.__internal__getCustomModule(
|
|
1414
|
+
module2.moduleIdentifier
|
|
1415
|
+
);
|
|
1416
|
+
return (customModule == null ? void 0 : customModule.buildMeta) || {};
|
|
1417
|
+
}
|
|
1418
|
+
},
|
|
1419
|
+
blocks: {
|
|
1420
|
+
enumerable: true,
|
|
1421
|
+
get() {
|
|
1422
|
+
if ("blocks" in module2) {
|
|
1423
|
+
return module2.blocks.map((b) => DependenciesBlock.__from_binding(b));
|
|
1424
|
+
}
|
|
1425
|
+
return [];
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
dependencies: {
|
|
1429
|
+
enumerable: true,
|
|
1430
|
+
get() {
|
|
1431
|
+
if ("dependencies" in module2) {
|
|
1432
|
+
return module2.dependencies.map((d) => Dependency.__from_binding(d));
|
|
1433
|
+
}
|
|
1434
|
+
return [];
|
|
1435
|
+
}
|
|
1436
|
+
},
|
|
1437
|
+
useSourceMap: {
|
|
1438
|
+
enumerable: true,
|
|
1439
|
+
get() {
|
|
1440
|
+
return module2.useSourceMap;
|
|
1441
|
+
}
|
|
1223
1442
|
}
|
|
1224
1443
|
});
|
|
1225
1444
|
}
|
|
1226
1445
|
originalSource() {
|
|
1227
|
-
if (this.#originalSource) return this.#originalSource;
|
|
1228
1446
|
if (this.#inner.originalSource) {
|
|
1229
|
-
|
|
1230
|
-
this.#inner.originalSource
|
|
1231
|
-
);
|
|
1232
|
-
return this.#originalSource;
|
|
1447
|
+
return JsSource.__from_binding(this.#inner.originalSource);
|
|
1233
1448
|
}
|
|
1234
1449
|
return null;
|
|
1235
1450
|
}
|
|
@@ -1242,12 +1457,6 @@ var Module = class _Module {
|
|
|
1242
1457
|
}
|
|
1243
1458
|
return null;
|
|
1244
1459
|
}
|
|
1245
|
-
get blocks() {
|
|
1246
|
-
if ("blocks" in this.#inner) {
|
|
1247
|
-
return this.#inner.blocks.map((b) => new DependenciesBlock(b));
|
|
1248
|
-
}
|
|
1249
|
-
return [];
|
|
1250
|
-
}
|
|
1251
1460
|
size(type) {
|
|
1252
1461
|
if ("size" in this.#inner) {
|
|
1253
1462
|
return this.#inner.size(type);
|
|
@@ -1448,7 +1657,8 @@ var RuntimeModule = class {
|
|
|
1448
1657
|
name: module2.name,
|
|
1449
1658
|
stage: module2.stage,
|
|
1450
1659
|
generator: module2.generate.bind(module2),
|
|
1451
|
-
|
|
1660
|
+
fullHash: module2.fullHash,
|
|
1661
|
+
dependentHash: module2.dependentHash,
|
|
1452
1662
|
isolate: module2.shouldIsolate()
|
|
1453
1663
|
};
|
|
1454
1664
|
}
|
|
@@ -5977,7 +6187,13 @@ async function runLoaders(compiler, context2) {
|
|
|
5977
6187
|
if (res.cacheable === false) {
|
|
5978
6188
|
this.cacheable(false);
|
|
5979
6189
|
}
|
|
5980
|
-
|
|
6190
|
+
if (res.error) {
|
|
6191
|
+
reject(new Error(err));
|
|
6192
|
+
} else {
|
|
6193
|
+
resolve2(
|
|
6194
|
+
compiler.__internal__getModuleExecutionResult(res.id)
|
|
6195
|
+
);
|
|
6196
|
+
}
|
|
5981
6197
|
}
|
|
5982
6198
|
}
|
|
5983
6199
|
);
|
|
@@ -6009,10 +6225,14 @@ async function runLoaders(compiler, context2) {
|
|
|
6009
6225
|
if (res.cacheable === false) {
|
|
6010
6226
|
this.cacheable(false);
|
|
6011
6227
|
}
|
|
6012
|
-
|
|
6013
|
-
void 0
|
|
6014
|
-
|
|
6015
|
-
|
|
6228
|
+
if (res.error) {
|
|
6229
|
+
callback(new Error(err), void 0);
|
|
6230
|
+
} else {
|
|
6231
|
+
callback(
|
|
6232
|
+
void 0,
|
|
6233
|
+
compiler.__internal__getModuleExecutionResult(res.id)
|
|
6234
|
+
);
|
|
6235
|
+
}
|
|
6016
6236
|
}
|
|
6017
6237
|
}
|
|
6018
6238
|
);
|
|
@@ -6272,65 +6492,78 @@ async function runLoaders(compiler, context2) {
|
|
|
6272
6492
|
enumerable: true,
|
|
6273
6493
|
get: () => context2.__internal__parseMeta
|
|
6274
6494
|
});
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
loaderContext
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6495
|
+
try {
|
|
6496
|
+
switch (loaderState) {
|
|
6497
|
+
case import_binding23.JsLoaderState.Pitching: {
|
|
6498
|
+
while (loaderContext.loaderIndex < loaderContext.loaders.length) {
|
|
6499
|
+
const currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
|
|
6500
|
+
if (currentLoaderObject.shouldYield()) break;
|
|
6501
|
+
if (currentLoaderObject.pitchExecuted) {
|
|
6502
|
+
loaderContext.loaderIndex += 1;
|
|
6503
|
+
continue;
|
|
6504
|
+
}
|
|
6505
|
+
await loadLoaderAsync(currentLoaderObject);
|
|
6506
|
+
const fn2 = currentLoaderObject.pitch;
|
|
6507
|
+
currentLoaderObject.pitchExecuted = true;
|
|
6508
|
+
if (!fn2) continue;
|
|
6509
|
+
const args = await runSyncOrAsync(fn2, loaderContext, [
|
|
6510
|
+
loaderContext.remainingRequest,
|
|
6511
|
+
loaderContext.previousRequest,
|
|
6512
|
+
currentLoaderObject.data
|
|
6513
|
+
]) || [];
|
|
6514
|
+
const hasArg = args.some((value) => value !== void 0);
|
|
6515
|
+
if (hasArg) {
|
|
6516
|
+
const [content, sourceMap, additionalData] = args;
|
|
6517
|
+
context2.content = isNil(content) ? null : toBuffer(content);
|
|
6518
|
+
context2.sourceMap = serializeObject(sourceMap);
|
|
6519
|
+
context2.additionalData = additionalData;
|
|
6520
|
+
break;
|
|
6521
|
+
}
|
|
6300
6522
|
}
|
|
6523
|
+
break;
|
|
6301
6524
|
}
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6525
|
+
case import_binding23.JsLoaderState.Normal: {
|
|
6526
|
+
let content = context2.content;
|
|
6527
|
+
let sourceMap = JsSourceMap.__from_binding(context2.sourceMap);
|
|
6528
|
+
let additionalData = context2.additionalData;
|
|
6529
|
+
while (loaderContext.loaderIndex >= 0) {
|
|
6530
|
+
const currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
|
|
6531
|
+
if (currentLoaderObject.shouldYield()) break;
|
|
6532
|
+
if (currentLoaderObject.normalExecuted) {
|
|
6533
|
+
loaderContext.loaderIndex--;
|
|
6534
|
+
continue;
|
|
6535
|
+
}
|
|
6536
|
+
await loadLoaderAsync(currentLoaderObject);
|
|
6537
|
+
const fn2 = currentLoaderObject.normal;
|
|
6538
|
+
currentLoaderObject.normalExecuted = true;
|
|
6539
|
+
if (!fn2) continue;
|
|
6540
|
+
const args = [content, sourceMap, additionalData];
|
|
6541
|
+
convertArgs(args, !!currentLoaderObject.raw);
|
|
6542
|
+
[content, sourceMap, additionalData] = await runSyncOrAsync(fn2, loaderContext, args) || [];
|
|
6314
6543
|
}
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
}
|
|
6323
|
-
context2.content = isNil(content) ? null : toBuffer(content);
|
|
6324
|
-
context2.sourceMap = JsSourceMap.__to_binding(sourceMap);
|
|
6325
|
-
context2.additionalData = additionalData;
|
|
6326
|
-
break;
|
|
6544
|
+
context2.content = isNil(content) ? null : toBuffer(content);
|
|
6545
|
+
context2.sourceMap = JsSourceMap.__to_binding(sourceMap);
|
|
6546
|
+
context2.additionalData = additionalData;
|
|
6547
|
+
break;
|
|
6548
|
+
}
|
|
6549
|
+
default:
|
|
6550
|
+
throw new Error(`Unexpected loader runner state: ${loaderState}`);
|
|
6327
6551
|
}
|
|
6328
|
-
|
|
6329
|
-
|
|
6552
|
+
context2.loaderItems = loaderContext.loaders.map(
|
|
6553
|
+
(item) => LoaderObject.__to_binding(item)
|
|
6554
|
+
);
|
|
6555
|
+
} catch (e) {
|
|
6556
|
+
const error = e;
|
|
6557
|
+
context2.__internal__error = typeof e === "string" ? {
|
|
6558
|
+
name: "ModuleBuildError",
|
|
6559
|
+
message: e
|
|
6560
|
+
} : {
|
|
6561
|
+
name: "ModuleBuildError",
|
|
6562
|
+
message: error.message,
|
|
6563
|
+
stack: typeof error.stack === "string" ? error.stack : void 0,
|
|
6564
|
+
hideStack: "hideStack" in error ? error.hideStack === true || error.hideStack === "true" : void 0
|
|
6565
|
+
};
|
|
6330
6566
|
}
|
|
6331
|
-
context2.loaderItems = loaderContext.loaders.map(
|
|
6332
|
-
(item) => LoaderObject.__to_binding(item)
|
|
6333
|
-
);
|
|
6334
6567
|
return context2;
|
|
6335
6568
|
}
|
|
6336
6569
|
function utf8BufferToString(buf) {
|
|
@@ -6755,7 +6988,7 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
|
|
|
6755
6988
|
parser: rule.parser ? getRawParserOptions(rule.parser, rule.type ?? upperType) : void 0,
|
|
6756
6989
|
generator: rule.generator ? getRawGeneratorOptions(rule.generator, rule.type ?? upperType) : void 0,
|
|
6757
6990
|
resolve: rule.resolve ? getRawResolve(rule.resolve) : void 0,
|
|
6758
|
-
oneOf: rule.oneOf ? rule.oneOf.map(
|
|
6991
|
+
oneOf: rule.oneOf ? rule.oneOf.filter(Boolean).map(
|
|
6759
6992
|
(rule2, index) => getRawModuleRule(
|
|
6760
6993
|
rule2,
|
|
6761
6994
|
`${path10}.oneOf[${index}]`,
|
|
@@ -6763,7 +6996,7 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
|
|
|
6763
6996
|
rule2.type ?? upperType
|
|
6764
6997
|
)
|
|
6765
6998
|
) : void 0,
|
|
6766
|
-
rules: rule.rules ? rule.rules.map(
|
|
6999
|
+
rules: rule.rules ? rule.rules.filter(Boolean).map(
|
|
6767
7000
|
(rule2, index) => getRawModuleRule(
|
|
6768
7001
|
rule2,
|
|
6769
7002
|
`${path10}.rules[${index}]`,
|
|
@@ -6809,10 +7042,7 @@ function getRawRuleSetCondition(condition) {
|
|
|
6809
7042
|
if (condition instanceof RegExp) {
|
|
6810
7043
|
return {
|
|
6811
7044
|
type: import_binding24.RawRuleSetConditionType.regexp,
|
|
6812
|
-
regexp:
|
|
6813
|
-
source: condition.source,
|
|
6814
|
-
flags: condition.flags
|
|
6815
|
-
}
|
|
7045
|
+
regexp: condition
|
|
6816
7046
|
};
|
|
6817
7047
|
}
|
|
6818
7048
|
if (typeof condition === "function") {
|
|
@@ -8206,7 +8436,7 @@ var applyRspackOptionsDefaults = (options) => {
|
|
|
8206
8436
|
D(options, "profile", false);
|
|
8207
8437
|
D(options, "bail", false);
|
|
8208
8438
|
F(options, "cache", () => development);
|
|
8209
|
-
applyExperimentsDefaults(options.experiments);
|
|
8439
|
+
applyExperimentsDefaults(options.experiments, { production });
|
|
8210
8440
|
applySnapshotDefaults(options.snapshot, { production });
|
|
8211
8441
|
applyModuleDefaults(options.module, {
|
|
8212
8442
|
asyncWebAssembly: options.experiments.asyncWebAssembly,
|
|
@@ -8282,24 +8512,24 @@ var applyInfrastructureLoggingDefaults = (infrastructureLogging2) => {
|
|
|
8282
8512
|
D(infrastructureLogging2, "colors", tty);
|
|
8283
8513
|
D(infrastructureLogging2, "appendOnly", !tty);
|
|
8284
8514
|
};
|
|
8285
|
-
var applyExperimentsDefaults = (experiments3) => {
|
|
8515
|
+
var applyExperimentsDefaults = (experiments3, { production }) => {
|
|
8286
8516
|
D(experiments3, "futureDefaults", false);
|
|
8287
8517
|
D(experiments3, "lazyCompilation", false);
|
|
8288
8518
|
D(experiments3, "asyncWebAssembly", experiments3.futureDefaults);
|
|
8289
8519
|
D(experiments3, "css", experiments3.futureDefaults ? true : void 0);
|
|
8290
8520
|
D(experiments3, "layers", false);
|
|
8291
8521
|
D(experiments3, "topLevelAwait", true);
|
|
8292
|
-
D(experiments3, "incremental", {});
|
|
8522
|
+
D(experiments3, "incremental", !production ? {} : false);
|
|
8293
8523
|
if (typeof experiments3.incremental === "object") {
|
|
8294
8524
|
D(experiments3.incremental, "make", true);
|
|
8295
|
-
D(experiments3.incremental, "emitAssets", true);
|
|
8296
8525
|
D(experiments3.incremental, "inferAsyncModules", false);
|
|
8297
8526
|
D(experiments3.incremental, "providedExports", false);
|
|
8298
8527
|
D(experiments3.incremental, "dependenciesDiagnostics", false);
|
|
8528
|
+
D(experiments3.incremental, "buildChunkGraph", false);
|
|
8299
8529
|
D(experiments3.incremental, "modulesHashes", false);
|
|
8300
8530
|
D(experiments3.incremental, "modulesCodegen", false);
|
|
8301
8531
|
D(experiments3.incremental, "modulesRuntimeRequirements", false);
|
|
8302
|
-
D(experiments3.incremental, "
|
|
8532
|
+
D(experiments3.incremental, "emitAssets", true);
|
|
8303
8533
|
}
|
|
8304
8534
|
D(experiments3, "rspackFuture", {});
|
|
8305
8535
|
};
|
|
@@ -9673,8 +9903,8 @@ var baseRuleSetRule = import_zod.z.strictObject({
|
|
|
9673
9903
|
enforce: import_zod.z.literal("pre").or(import_zod.z.literal("post")).optional()
|
|
9674
9904
|
});
|
|
9675
9905
|
var ruleSetRule = baseRuleSetRule.extend({
|
|
9676
|
-
oneOf: import_zod.z.lazy(() => ruleSetRule.array()).optional(),
|
|
9677
|
-
rules: import_zod.z.lazy(() => ruleSetRule.array()).optional()
|
|
9906
|
+
oneOf: import_zod.z.lazy(() => ruleSetRule.or(falsy).array()).optional(),
|
|
9907
|
+
rules: import_zod.z.lazy(() => ruleSetRule.or(falsy).array()).optional()
|
|
9678
9908
|
});
|
|
9679
9909
|
var ruleSetRules = import_zod.z.array(
|
|
9680
9910
|
import_zod.z.literal("...").or(ruleSetRule).or(falsy)
|
|
@@ -9927,7 +10157,12 @@ var externalsType = import_zod.z.enum([
|
|
|
9927
10157
|
"node-commonjs"
|
|
9928
10158
|
]);
|
|
9929
10159
|
var externalItemValue = import_zod.z.string().or(import_zod.z.boolean()).or(import_zod.z.string().array().min(1)).or(
|
|
9930
|
-
import_zod.z.
|
|
10160
|
+
import_zod.z.strictObject({
|
|
10161
|
+
root: import_zod.z.string().or(import_zod.z.string().array()),
|
|
10162
|
+
commonjs: import_zod.z.string().or(import_zod.z.string().array()),
|
|
10163
|
+
commonjs2: import_zod.z.string().or(import_zod.z.string().array()),
|
|
10164
|
+
amd: import_zod.z.string().or(import_zod.z.string().array()).optional()
|
|
10165
|
+
})
|
|
9931
10166
|
);
|
|
9932
10167
|
var externalItemObjectUnknown = import_zod.z.record(
|
|
9933
10168
|
externalItemValue
|
|
@@ -10523,11 +10758,39 @@ var FlagDependencyExportsPlugin = create2(
|
|
|
10523
10758
|
|
|
10524
10759
|
// src/builtin-plugin/FlagDependencyUsagePlugin.ts
|
|
10525
10760
|
var import_binding37 = require("@rspack/binding");
|
|
10526
|
-
var FlagDependencyUsagePlugin =
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10761
|
+
var FlagDependencyUsagePlugin = class extends RspackBuiltinPlugin {
|
|
10762
|
+
constructor(global) {
|
|
10763
|
+
super();
|
|
10764
|
+
this.global = global;
|
|
10765
|
+
this.name = import_binding37.BuiltinPluginName.FlagDependencyUsagePlugin;
|
|
10766
|
+
this.affectedHooks = "compilation";
|
|
10767
|
+
}
|
|
10768
|
+
raw(compiler) {
|
|
10769
|
+
const incremental2 = compiler.options.experiments.incremental;
|
|
10770
|
+
const logger = compiler.getInfrastructureLogger(
|
|
10771
|
+
"rspack.FlagDependencyUsagePlugin"
|
|
10772
|
+
);
|
|
10773
|
+
if (incremental2.modulesHashes) {
|
|
10774
|
+
incremental2.modulesHashes = false;
|
|
10775
|
+
logger.warn(
|
|
10776
|
+
"`optimization.usedExports` can't be used with `incremental.modulesHashes` as export usage is a global effect. `incremental.modulesHashes` has been overridden to false."
|
|
10777
|
+
);
|
|
10778
|
+
}
|
|
10779
|
+
if (incremental2.modulesCodegen) {
|
|
10780
|
+
incremental2.modulesCodegen = false;
|
|
10781
|
+
logger.warn(
|
|
10782
|
+
"`optimization.usedExports` can't be used with `incremental.modulesCodegen` as export usage is a global effect. `incremental.modulesCodegen` has been overridden to false."
|
|
10783
|
+
);
|
|
10784
|
+
}
|
|
10785
|
+
if (incremental2.modulesRuntimeRequirements) {
|
|
10786
|
+
incremental2.modulesRuntimeRequirements = false;
|
|
10787
|
+
logger.warn(
|
|
10788
|
+
"`optimization.usedExports` can't be used with `incremental.modulesRuntimeRequirements` as export usage is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false."
|
|
10789
|
+
);
|
|
10790
|
+
}
|
|
10791
|
+
return createBuiltinPlugin(this.name, this.global);
|
|
10792
|
+
}
|
|
10793
|
+
};
|
|
10531
10794
|
|
|
10532
10795
|
// src/builtin-plugin/HotModuleReplacementPlugin.ts
|
|
10533
10796
|
var import_binding38 = require("@rspack/binding");
|
|
@@ -10551,7 +10814,8 @@ var import_binding39 = require("@rspack/binding");
|
|
|
10551
10814
|
var liteTapable3 = __toESM(require("@rspack/lite-tapable"));
|
|
10552
10815
|
var import_zod2 = require("../compiled/zod/index.js");
|
|
10553
10816
|
|
|
10554
|
-
// ../../node_modules/.pnpm/zod-validation-error@3.
|
|
10817
|
+
// ../../node_modules/.pnpm/zod-validation-error@3.4.0_zod@3.23.8/node_modules/zod-validation-error/dist/index.mjs
|
|
10818
|
+
var zod2 = __toESM(require("../compiled/zod/index.js"), 1);
|
|
10555
10819
|
var zod = __toESM(require("../compiled/zod/index.js"), 1);
|
|
10556
10820
|
function isZodErrorLike(err) {
|
|
10557
10821
|
return err instanceof Error && err.name === "ZodError" && "issues" in err && Array.isArray(err.issues);
|
|
@@ -10577,22 +10841,8 @@ function getIssuesFromErrorOptions(options) {
|
|
|
10577
10841
|
}
|
|
10578
10842
|
return [];
|
|
10579
10843
|
}
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
var PREFIX = "Validation error";
|
|
10583
|
-
var PREFIX_SEPARATOR = ": ";
|
|
10584
|
-
var UNION_SEPARATOR = ", or ";
|
|
10585
|
-
function prefixMessage(message, prefix, prefixSeparator) {
|
|
10586
|
-
if (prefix !== null) {
|
|
10587
|
-
if (message.length > 0) {
|
|
10588
|
-
return [prefix, message].join(prefixSeparator);
|
|
10589
|
-
}
|
|
10590
|
-
return prefix;
|
|
10591
|
-
}
|
|
10592
|
-
if (message.length > 0) {
|
|
10593
|
-
return message;
|
|
10594
|
-
}
|
|
10595
|
-
return PREFIX;
|
|
10844
|
+
function isNonEmptyArray(value) {
|
|
10845
|
+
return value.length !== 0;
|
|
10596
10846
|
}
|
|
10597
10847
|
var identifierRegex = /[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;
|
|
10598
10848
|
function joinPath(path10) {
|
|
@@ -10616,12 +10866,35 @@ function joinPath(path10) {
|
|
|
10616
10866
|
function escapeQuotes(str) {
|
|
10617
10867
|
return str.replace(/"/g, '\\"');
|
|
10618
10868
|
}
|
|
10619
|
-
|
|
10620
|
-
|
|
10869
|
+
var ISSUE_SEPARATOR = "; ";
|
|
10870
|
+
var MAX_ISSUES_IN_MESSAGE = 99;
|
|
10871
|
+
var PREFIX = "Validation error";
|
|
10872
|
+
var PREFIX_SEPARATOR = ": ";
|
|
10873
|
+
var UNION_SEPARATOR = ", or ";
|
|
10874
|
+
function createMessageBuilder(props = {}) {
|
|
10875
|
+
const {
|
|
10876
|
+
issueSeparator = ISSUE_SEPARATOR,
|
|
10877
|
+
unionSeparator = UNION_SEPARATOR,
|
|
10878
|
+
prefixSeparator = PREFIX_SEPARATOR,
|
|
10879
|
+
prefix = PREFIX,
|
|
10880
|
+
includePath = true,
|
|
10881
|
+
maxIssuesInMessage = MAX_ISSUES_IN_MESSAGE
|
|
10882
|
+
} = props;
|
|
10883
|
+
return (issues) => {
|
|
10884
|
+
const message = issues.slice(0, maxIssuesInMessage).map(
|
|
10885
|
+
(issue) => getMessageFromZodIssue({
|
|
10886
|
+
issue,
|
|
10887
|
+
issueSeparator,
|
|
10888
|
+
unionSeparator,
|
|
10889
|
+
includePath
|
|
10890
|
+
})
|
|
10891
|
+
).join(issueSeparator);
|
|
10892
|
+
return prefixMessage(message, prefix, prefixSeparator);
|
|
10893
|
+
};
|
|
10621
10894
|
}
|
|
10622
10895
|
function getMessageFromZodIssue(props) {
|
|
10623
10896
|
const { issue, issueSeparator, unionSeparator, includePath } = props;
|
|
10624
|
-
if (issue.code ===
|
|
10897
|
+
if (issue.code === zod.ZodIssueCode.invalid_union) {
|
|
10625
10898
|
return issue.unionErrors.reduce((acc, zodError) => {
|
|
10626
10899
|
const newIssues = zodError.issues.map(
|
|
10627
10900
|
(issue2) => getMessageFromZodIssue({
|
|
@@ -10637,7 +10910,7 @@ function getMessageFromZodIssue(props) {
|
|
|
10637
10910
|
return acc;
|
|
10638
10911
|
}, []).join(unionSeparator);
|
|
10639
10912
|
}
|
|
10640
|
-
if (issue.code ===
|
|
10913
|
+
if (issue.code === zod.ZodIssueCode.invalid_arguments) {
|
|
10641
10914
|
return [
|
|
10642
10915
|
issue.message,
|
|
10643
10916
|
...issue.argumentsError.issues.map(
|
|
@@ -10650,7 +10923,7 @@ function getMessageFromZodIssue(props) {
|
|
|
10650
10923
|
)
|
|
10651
10924
|
].join(issueSeparator);
|
|
10652
10925
|
}
|
|
10653
|
-
if (issue.code ===
|
|
10926
|
+
if (issue.code === zod.ZodIssueCode.invalid_return_type) {
|
|
10654
10927
|
return [
|
|
10655
10928
|
issue.message,
|
|
10656
10929
|
...issue.returnTypeError.issues.map(
|
|
@@ -10674,6 +10947,18 @@ function getMessageFromZodIssue(props) {
|
|
|
10674
10947
|
}
|
|
10675
10948
|
return issue.message;
|
|
10676
10949
|
}
|
|
10950
|
+
function prefixMessage(message, prefix, prefixSeparator) {
|
|
10951
|
+
if (prefix !== null) {
|
|
10952
|
+
if (message.length > 0) {
|
|
10953
|
+
return [prefix, message].join(prefixSeparator);
|
|
10954
|
+
}
|
|
10955
|
+
return prefix;
|
|
10956
|
+
}
|
|
10957
|
+
if (message.length > 0) {
|
|
10958
|
+
return message;
|
|
10959
|
+
}
|
|
10960
|
+
return PREFIX;
|
|
10961
|
+
}
|
|
10677
10962
|
function fromZodError(zodError, options = {}) {
|
|
10678
10963
|
if (!isZodErrorLike(zodError)) {
|
|
10679
10964
|
throw new TypeError(
|
|
@@ -10683,26 +10968,22 @@ function fromZodError(zodError, options = {}) {
|
|
|
10683
10968
|
return fromZodErrorWithoutRuntimeCheck(zodError, options);
|
|
10684
10969
|
}
|
|
10685
10970
|
function fromZodErrorWithoutRuntimeCheck(zodError, options = {}) {
|
|
10686
|
-
const {
|
|
10687
|
-
maxIssuesInMessage = MAX_ISSUES_IN_MESSAGE,
|
|
10688
|
-
issueSeparator = ISSUE_SEPARATOR,
|
|
10689
|
-
unionSeparator = UNION_SEPARATOR,
|
|
10690
|
-
prefixSeparator = PREFIX_SEPARATOR,
|
|
10691
|
-
prefix = PREFIX,
|
|
10692
|
-
includePath = true
|
|
10693
|
-
} = options;
|
|
10694
10971
|
const zodIssues = zodError.errors;
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
).join(issueSeparator);
|
|
10703
|
-
const message = prefixMessage(reason, prefix, prefixSeparator);
|
|
10972
|
+
let message;
|
|
10973
|
+
if (isNonEmptyArray(zodIssues)) {
|
|
10974
|
+
const messageBuilder = createMessageBuilderFromOptions2(options);
|
|
10975
|
+
message = messageBuilder(zodIssues);
|
|
10976
|
+
} else {
|
|
10977
|
+
message = zodError.message;
|
|
10978
|
+
}
|
|
10704
10979
|
return new ValidationError(message, { cause: zodError });
|
|
10705
10980
|
}
|
|
10981
|
+
function createMessageBuilderFromOptions2(options) {
|
|
10982
|
+
if ("messageBuilder" in options) {
|
|
10983
|
+
return options.messageBuilder;
|
|
10984
|
+
}
|
|
10985
|
+
return createMessageBuilder(options);
|
|
10986
|
+
}
|
|
10706
10987
|
var toValidationError = (options = {}) => (err) => {
|
|
10707
10988
|
if (isZodErrorLike(err)) {
|
|
10708
10989
|
return fromZodErrorWithoutRuntimeCheck(err, options);
|
|
@@ -11330,11 +11611,39 @@ var LimitChunkCountPlugin = create2(
|
|
|
11330
11611
|
|
|
11331
11612
|
// src/builtin-plugin/MangleExportsPlugin.ts
|
|
11332
11613
|
var import_binding48 = require("@rspack/binding");
|
|
11333
|
-
var MangleExportsPlugin =
|
|
11334
|
-
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11614
|
+
var MangleExportsPlugin = class extends RspackBuiltinPlugin {
|
|
11615
|
+
constructor(deterministic) {
|
|
11616
|
+
super();
|
|
11617
|
+
this.deterministic = deterministic;
|
|
11618
|
+
this.name = import_binding48.BuiltinPluginName.MangleExportsPlugin;
|
|
11619
|
+
this.affectedHooks = "compilation";
|
|
11620
|
+
}
|
|
11621
|
+
raw(compiler) {
|
|
11622
|
+
const incremental2 = compiler.options.experiments.incremental;
|
|
11623
|
+
const logger = compiler.getInfrastructureLogger(
|
|
11624
|
+
"rspack.MangleExportsPlugin"
|
|
11625
|
+
);
|
|
11626
|
+
if (incremental2.modulesHashes) {
|
|
11627
|
+
incremental2.modulesHashes = false;
|
|
11628
|
+
logger.warn(
|
|
11629
|
+
"`optimization.mangleExports` can't be used with `incremental.modulesHashes` as export mangling is a global effect. `incremental.modulesHashes` has been overridden to false."
|
|
11630
|
+
);
|
|
11631
|
+
}
|
|
11632
|
+
if (incremental2.modulesCodegen) {
|
|
11633
|
+
incremental2.modulesCodegen = false;
|
|
11634
|
+
logger.warn(
|
|
11635
|
+
"`optimization.mangleExports` can't be used with `incremental.modulesCodegen` as export mangling is a global effect. `incremental.modulesCodegen` has been overridden to false."
|
|
11636
|
+
);
|
|
11637
|
+
}
|
|
11638
|
+
if (incremental2.modulesRuntimeRequirements) {
|
|
11639
|
+
incremental2.modulesRuntimeRequirements = false;
|
|
11640
|
+
logger.warn(
|
|
11641
|
+
"`optimization.mangleExports` can't be used with `incremental.modulesRuntimeRequirements` as export mangling is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false."
|
|
11642
|
+
);
|
|
11643
|
+
}
|
|
11644
|
+
return createBuiltinPlugin(this.name, this.deterministic);
|
|
11645
|
+
}
|
|
11646
|
+
};
|
|
11338
11647
|
|
|
11339
11648
|
// src/builtin-plugin/MergeDuplicateChunksPlugin.ts
|
|
11340
11649
|
var import_binding49 = require("@rspack/binding");
|
|
@@ -11354,12 +11663,38 @@ var ModuleChunkFormatPlugin = create2(
|
|
|
11354
11663
|
|
|
11355
11664
|
// src/builtin-plugin/ModuleConcatenationPlugin.ts
|
|
11356
11665
|
var import_binding51 = require("@rspack/binding");
|
|
11357
|
-
var ModuleConcatenationPlugin =
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11666
|
+
var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
|
|
11667
|
+
constructor() {
|
|
11668
|
+
super(...arguments);
|
|
11669
|
+
this.name = import_binding51.BuiltinPluginName.ModuleConcatenationPlugin;
|
|
11670
|
+
this.affectedHooks = "compilation";
|
|
11671
|
+
}
|
|
11672
|
+
raw(compiler) {
|
|
11673
|
+
const incremental2 = compiler.options.experiments.incremental;
|
|
11674
|
+
const logger = compiler.getInfrastructureLogger(
|
|
11675
|
+
"rspack.ModuleConcatenationPlugin"
|
|
11676
|
+
);
|
|
11677
|
+
if (incremental2.modulesHashes) {
|
|
11678
|
+
incremental2.modulesHashes = false;
|
|
11679
|
+
logger.warn(
|
|
11680
|
+
"`optimization.concatenateModules` can't be used with `incremental.modulesHashes` as module concatenation is a global effect. `incremental.modulesHashes` has been overridden to false."
|
|
11681
|
+
);
|
|
11682
|
+
}
|
|
11683
|
+
if (incremental2.modulesCodegen) {
|
|
11684
|
+
incremental2.modulesCodegen = false;
|
|
11685
|
+
logger.warn(
|
|
11686
|
+
"`optimization.concatenateModules` can't be used with `incremental.modulesCodegen` as module concatenation is a global effect. `incremental.modulesCodegen` has been overridden to false."
|
|
11687
|
+
);
|
|
11688
|
+
}
|
|
11689
|
+
if (incremental2.modulesRuntimeRequirements) {
|
|
11690
|
+
incremental2.modulesRuntimeRequirements = false;
|
|
11691
|
+
logger.warn(
|
|
11692
|
+
"`optimization.concatenateModules` can't be used with `incremental.modulesRuntimeRequirements` as module concatenation is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false."
|
|
11693
|
+
);
|
|
11694
|
+
}
|
|
11695
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
11696
|
+
}
|
|
11697
|
+
};
|
|
11363
11698
|
|
|
11364
11699
|
// src/builtin-plugin/NamedChunkIdsPlugin.ts
|
|
11365
11700
|
var import_binding52 = require("@rspack/binding");
|
|
@@ -12524,6 +12859,7 @@ var checkVersion = () => {
|
|
|
12524
12859
|
};
|
|
12525
12860
|
|
|
12526
12861
|
// src/Compiler.ts
|
|
12862
|
+
var COMPILATION_WEAK_MAP = /* @__PURE__ */ new WeakMap();
|
|
12527
12863
|
var Compiler = class _Compiler {
|
|
12528
12864
|
#instance;
|
|
12529
12865
|
#initial;
|
|
@@ -12990,8 +13326,12 @@ var Compiler = class _Compiler {
|
|
|
12990
13326
|
});
|
|
12991
13327
|
}
|
|
12992
13328
|
#createCompilation(native) {
|
|
12993
|
-
|
|
12994
|
-
compilation
|
|
13329
|
+
let compilation = COMPILATION_WEAK_MAP.get(native);
|
|
13330
|
+
if (!compilation) {
|
|
13331
|
+
compilation = new Compilation(this, native);
|
|
13332
|
+
compilation.name = this.name;
|
|
13333
|
+
COMPILATION_WEAK_MAP.set(native, compilation);
|
|
13334
|
+
}
|
|
12995
13335
|
this.#compilation = compilation;
|
|
12996
13336
|
return compilation;
|
|
12997
13337
|
}
|
|
@@ -13036,9 +13376,7 @@ var Compiler = class _Compiler {
|
|
|
13036
13376
|
binding2.RegisterJsTapKind.CompilerThisCompilation,
|
|
13037
13377
|
() => this.hooks.thisCompilation,
|
|
13038
13378
|
(queried) => (native) => {
|
|
13039
|
-
|
|
13040
|
-
this.#createCompilation(native);
|
|
13041
|
-
}
|
|
13379
|
+
this.#createCompilation(native);
|
|
13042
13380
|
queried.call(this.#compilation, this.#compilationParams);
|
|
13043
13381
|
}
|
|
13044
13382
|
),
|
|
@@ -14775,6 +15113,7 @@ var MODULES_GROUPERS = (type) => ({
|
|
|
14775
15113
|
groupModulesByAttributes,
|
|
14776
15114
|
groupModulesByType,
|
|
14777
15115
|
groupModulesByPath,
|
|
15116
|
+
groupModulesByLayer,
|
|
14778
15117
|
groupModulesByExtension
|
|
14779
15118
|
} = options;
|
|
14780
15119
|
if (groupModulesByAttributes) {
|
|
@@ -14827,6 +15166,20 @@ var MODULES_GROUPERS = (type) => ({
|
|
|
14827
15166
|
}
|
|
14828
15167
|
});
|
|
14829
15168
|
}
|
|
15169
|
+
if (groupModulesByLayer) {
|
|
15170
|
+
groupConfigs.push({
|
|
15171
|
+
getKeys: (module2) => (
|
|
15172
|
+
/** @type {string[]} */
|
|
15173
|
+
[module2.layer]
|
|
15174
|
+
),
|
|
15175
|
+
createGroup: (key, children, _modules) => ({
|
|
15176
|
+
type: "modules by layer",
|
|
15177
|
+
layer: key,
|
|
15178
|
+
children,
|
|
15179
|
+
...moduleGroup(children)
|
|
15180
|
+
})
|
|
15181
|
+
});
|
|
15182
|
+
}
|
|
14830
15183
|
if (groupModulesByPath || groupModulesByExtension) {
|
|
14831
15184
|
groupConfigs.push({
|
|
14832
15185
|
getKeys: (module2) => {
|
|
@@ -17305,10 +17658,7 @@ var RspackOptionsApply = class {
|
|
|
17305
17658
|
typeof lazyOptions.test === "function" ? (jsModule) => lazyOptions.test.call(
|
|
17306
17659
|
lazyOptions,
|
|
17307
17660
|
new Module(jsModule)
|
|
17308
|
-
) : lazyOptions.test
|
|
17309
|
-
source: lazyOptions.test.source,
|
|
17310
|
-
flags: lazyOptions.test.flags
|
|
17311
|
-
} : void 0,
|
|
17661
|
+
) : lazyOptions.test,
|
|
17312
17662
|
lazyOptions.backend
|
|
17313
17663
|
).apply(compiler);
|
|
17314
17664
|
}
|