@rspack/core 1.4.1 → 1.4.3
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/README.md +1 -1
- package/compiled/tinypool/README.md +1 -1
- package/compiled/tinypool/dist/entry/worker.js +1 -0
- package/compiled/tinypool/dist/index.js +6 -2
- package/compiled/tinypool/package.json +1 -1
- package/dist/Chunk.d.ts +14 -34
- package/dist/ChunkGraph.d.ts +6 -21
- package/dist/Chunks.d.ts +0 -1
- package/dist/Compilation.d.ts +8 -7
- package/dist/Entrypoint.d.ts +2 -10
- package/dist/ErrorHelpers.d.ts +2 -0
- package/dist/RspackError.d.ts +1 -1
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -2
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -2
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -2
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -2
- package/dist/builtin-plugin/BannerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -2
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -2
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -2
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -2
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -2
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -2
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -2
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -2
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -2
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -2
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -2
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -2
- package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +2 -2
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +2 -2
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -2
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -2
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -2
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -2
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -2
- package/dist/builtin-plugin/IgnorePlugin.d.ts +2 -2
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -2
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -2
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -2
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -2
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -2
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -2
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -2
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -2
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -2
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -2
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -2
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -2
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -2
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -2
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -2
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -2
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -2
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RslibPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimePlugin.d.ts +2 -2
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -2
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -2
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -2
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -2
- package/dist/builtin-plugin/base.d.ts +29 -5
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +2 -2
- package/dist/builtin-plugin/index.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -2
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -2
- package/dist/exports.d.ts +3 -1
- package/dist/index.js +210 -358
- package/dist/lib/WebpackError.d.ts +1 -1
- package/dist/loader-runner/ModuleError.d.ts +7 -0
- package/dist/loader-runner/ModuleWarning.d.ts +7 -0
- package/dist/stats/StatsFactory.d.ts +2 -2
- package/dist/stats/statsFactoryUtils.d.ts +2 -2
- package/dist/trace/index.d.ts +7 -1
- package/dist/util/index.d.ts +0 -2
- package/package.json +5 -3
- package/dist/ChunkGroup.d.ts +0 -33
package/dist/index.js
CHANGED
@@ -220,10 +220,10 @@ var __webpack_modules__ = {
|
|
220
220
|
module.exports = require("./moduleFederationDefaultRuntime.js");
|
221
221
|
},
|
222
222
|
"@rspack/binding": function(module) {
|
223
|
-
module.exports = require("@rspack/binding");
|
223
|
+
module.exports = require(process.env.RSPACK_BINDING ? process.env.RSPACK_BINDING : "@rspack/binding");
|
224
224
|
},
|
225
225
|
"@rspack/binding/package.json": function(module) {
|
226
|
-
module.exports = require("@rspack/binding/package.json");
|
226
|
+
module.exports = require(process.env.RSPACK_BINDING ? require("node:path").resolve(process.env.RSPACK_BINDING, './package.json') : "@rspack/binding/package.json");
|
227
227
|
},
|
228
228
|
"node:http": function(module) {
|
229
229
|
module.exports = require("node:http");
|
@@ -231,6 +231,9 @@ var __webpack_modules__ = {
|
|
231
231
|
"node:https": function(module) {
|
232
232
|
module.exports = require("node:https");
|
233
233
|
},
|
234
|
+
"node:inspector": function(module) {
|
235
|
+
module.exports = require("node:inspector");
|
236
|
+
},
|
234
237
|
"node:os": function(module) {
|
235
238
|
module.exports = require("node:os");
|
236
239
|
},
|
@@ -250,11 +253,6 @@ var __webpack_modules__ = {
|
|
250
253
|
module.exports = import("../compiled/tinypool/dist/index.js").then(function(module) {
|
251
254
|
return module;
|
252
255
|
});
|
253
|
-
},
|
254
|
-
"node:inspector": function(module) {
|
255
|
-
module.exports = import("node:inspector").then(function(module) {
|
256
|
-
return module;
|
257
|
-
});
|
258
256
|
}
|
259
257
|
}, __webpack_module_cache__ = {};
|
260
258
|
function __webpack_require__(moduleId) {
|
@@ -437,240 +435,20 @@ for(var __webpack_i__ in (()=>{
|
|
437
435
|
webworker: ()=>webworker
|
438
436
|
});
|
439
437
|
var binding_ = __webpack_require__("@rspack/binding"), binding_default = __webpack_require__.n(binding_);
|
440
|
-
let lite_tapable_namespaceObject = require("@rspack/lite-tapable"),
|
441
|
-
class ChunkGroup {
|
442
|
-
#inner;
|
443
|
-
static __from_binding(binding) {
|
444
|
-
let chunkGroup = CHUNK_GROUP_MAPPINGS.get(binding);
|
445
|
-
return chunkGroup || (chunkGroup = new ChunkGroup(binding), CHUNK_GROUP_MAPPINGS.set(binding, chunkGroup)), chunkGroup;
|
446
|
-
}
|
447
|
-
constructor(inner){
|
448
|
-
this.#inner = inner, Object.defineProperties(this, {
|
449
|
-
chunks: {
|
450
|
-
enumerable: !0,
|
451
|
-
get: ()=>this.#inner.chunks.map((binding)=>Chunk.__from_binding(binding))
|
452
|
-
},
|
453
|
-
index: {
|
454
|
-
enumerable: !0,
|
455
|
-
get: ()=>this.#inner.index
|
456
|
-
},
|
457
|
-
name: {
|
458
|
-
enumerable: !0,
|
459
|
-
get: ()=>this.#inner.name
|
460
|
-
},
|
461
|
-
origins: {
|
462
|
-
enumerable: !0,
|
463
|
-
get: ()=>this.#inner.origins.map((origin)=>({
|
464
|
-
module: origin.module ? origin.module : void 0,
|
465
|
-
request: origin.request,
|
466
|
-
loc: origin.loc
|
467
|
-
}))
|
468
|
-
},
|
469
|
-
childrenIterable: {
|
470
|
-
enumerable: !0,
|
471
|
-
get: ()=>this.#inner.childrenIterable.map((child)=>ChunkGroup.__from_binding(child))
|
472
|
-
}
|
473
|
-
});
|
474
|
-
}
|
475
|
-
getFiles() {
|
476
|
-
return this.#inner.getFiles();
|
477
|
-
}
|
478
|
-
getParents() {
|
479
|
-
return this.#inner.getParents().map((binding)=>ChunkGroup.__from_binding(binding));
|
480
|
-
}
|
481
|
-
isInitial() {
|
482
|
-
return this.#inner.isInitial();
|
483
|
-
}
|
484
|
-
getModulePreOrderIndex(module) {
|
485
|
-
return this.#inner.getModulePreOrderIndex(module);
|
486
|
-
}
|
487
|
-
getModulePostOrderIndex(module) {
|
488
|
-
return this.#inner.getModulePostOrderIndex(module);
|
489
|
-
}
|
490
|
-
}
|
491
|
-
let CHUNK_MAPPINGS = new WeakMap();
|
492
|
-
class Chunk {
|
493
|
-
#inner;
|
494
|
-
static __from_binding(binding) {
|
495
|
-
let chunk = CHUNK_MAPPINGS.get(binding);
|
496
|
-
return chunk || (chunk = new Chunk(binding), CHUNK_MAPPINGS.set(binding, chunk)), chunk;
|
497
|
-
}
|
498
|
-
static __to_binding(chunk) {
|
499
|
-
return chunk.#inner;
|
500
|
-
}
|
501
|
-
constructor(binding){
|
502
|
-
this.#inner = binding, Object.defineProperties(this, {
|
503
|
-
name: {
|
504
|
-
enumerable: !0,
|
505
|
-
get: ()=>binding.name
|
506
|
-
},
|
507
|
-
id: {
|
508
|
-
enumerable: !0,
|
509
|
-
get: ()=>binding.id
|
510
|
-
},
|
511
|
-
ids: {
|
512
|
-
enumerable: !0,
|
513
|
-
get: ()=>binding.ids
|
514
|
-
},
|
515
|
-
idNameHints: {
|
516
|
-
enumerable: !0,
|
517
|
-
get: ()=>binding.idNameHints
|
518
|
-
},
|
519
|
-
filenameTemplate: {
|
520
|
-
enumerable: !0,
|
521
|
-
get: ()=>binding.filenameTemplate
|
522
|
-
},
|
523
|
-
cssFilenameTemplate: {
|
524
|
-
enumerable: !0,
|
525
|
-
get: ()=>binding.cssFilenameTemplate
|
526
|
-
},
|
527
|
-
files: {
|
528
|
-
enumerable: !0,
|
529
|
-
get: ()=>new Set(binding.files)
|
530
|
-
},
|
531
|
-
runtime: {
|
532
|
-
enumerable: !0,
|
533
|
-
get: ()=>new Set(binding.runtime)
|
534
|
-
},
|
535
|
-
hash: {
|
536
|
-
enumerable: !0,
|
537
|
-
get: ()=>binding.hash
|
538
|
-
},
|
539
|
-
contentHash: {
|
540
|
-
enumerable: !0,
|
541
|
-
get: ()=>binding.contentHash
|
542
|
-
},
|
543
|
-
renderedHash: {
|
544
|
-
enumerable: !0,
|
545
|
-
get: ()=>binding.renderedHash
|
546
|
-
},
|
547
|
-
chunkReason: {
|
548
|
-
enumerable: !0,
|
549
|
-
get: ()=>binding.chunkReason
|
550
|
-
},
|
551
|
-
auxiliaryFiles: {
|
552
|
-
enumerable: !0,
|
553
|
-
get: ()=>new Set(binding.auxiliaryFiles)
|
554
|
-
}
|
555
|
-
});
|
556
|
-
}
|
557
|
-
isOnlyInitial() {
|
558
|
-
return this.#inner.isOnlyInitial();
|
559
|
-
}
|
560
|
-
canBeInitial() {
|
561
|
-
return this.#inner.canBeInitial();
|
562
|
-
}
|
563
|
-
hasRuntime() {
|
564
|
-
return this.#inner.hasRuntime();
|
565
|
-
}
|
566
|
-
get groupsIterable() {
|
567
|
-
return new Set(this.#inner.groups().map((binding)=>ChunkGroup.__from_binding(binding)));
|
568
|
-
}
|
569
|
-
getChunkMaps(realHash) {
|
570
|
-
let chunkHashMap = {}, chunkContentHashMap = {}, chunkNameMap = {};
|
571
|
-
for (let chunk of this.getAllAsyncChunks()){
|
572
|
-
let id = chunk.id;
|
573
|
-
if (!id) continue;
|
574
|
-
let chunkHash = realHash ? chunk.hash : chunk.renderedHash;
|
575
|
-
for (let key of (chunkHash && (chunkHashMap[id] = chunkHash), Object.keys(chunk.contentHash)))chunkContentHashMap[key] || (chunkContentHashMap[key] = {}), chunkContentHashMap[key][id] = chunk.contentHash[key];
|
576
|
-
chunk.name && (chunkNameMap[id] = chunk.name);
|
577
|
-
}
|
578
|
-
return {
|
579
|
-
hash: chunkHashMap,
|
580
|
-
contentHash: chunkContentHashMap,
|
581
|
-
name: chunkNameMap
|
582
|
-
};
|
583
|
-
}
|
584
|
-
getAllAsyncChunks() {
|
585
|
-
return new Set(this.#inner.getAllAsyncChunks().map((binding)=>Chunk.__from_binding(binding)));
|
586
|
-
}
|
587
|
-
getAllInitialChunks() {
|
588
|
-
return new Set(this.#inner.getAllInitialChunks().map((binding)=>Chunk.__from_binding(binding)));
|
589
|
-
}
|
590
|
-
getAllReferencedChunks() {
|
591
|
-
return new Set(this.#inner.getAllReferencedChunks().map((binding)=>Chunk.__from_binding(binding)));
|
592
|
-
}
|
593
|
-
getEntryOptions() {
|
594
|
-
return this.#inner.getEntryOptions();
|
595
|
-
}
|
596
|
-
}
|
597
|
-
function toJsRuntimeSpec(runtime) {
|
598
|
-
return runtime instanceof Set ? Array.from(runtime) : runtime;
|
599
|
-
}
|
600
|
-
class ChunkGraph {
|
601
|
-
#inner;
|
602
|
-
static __from_binding(binding) {
|
603
|
-
return new ChunkGraph(binding);
|
604
|
-
}
|
605
|
-
constructor(binding){
|
606
|
-
this.#inner = binding;
|
607
|
-
}
|
608
|
-
hasChunkEntryDependentChunks(chunk) {
|
609
|
-
return this.#inner.hasChunkEntryDependentChunks(Chunk.__to_binding(chunk));
|
610
|
-
}
|
611
|
-
getChunkModules(chunk) {
|
612
|
-
return this.#inner.getChunkModules(Chunk.__to_binding(chunk));
|
613
|
-
}
|
614
|
-
getChunkModulesIterable(chunk) {
|
615
|
-
return this.#inner.getChunkModules(Chunk.__to_binding(chunk));
|
616
|
-
}
|
617
|
-
getOrderedChunkModulesIterable(chunk, compareFn) {
|
618
|
-
let res = this.#inner.getChunkModules(Chunk.__to_binding(chunk));
|
619
|
-
return res.sort(compareFn), res;
|
620
|
-
}
|
621
|
-
getChunkEntryModulesIterable(chunk) {
|
622
|
-
return this.#inner.getChunkEntryModules(Chunk.__to_binding(chunk));
|
623
|
-
}
|
624
|
-
getNumberOfEntryModules(chunk) {
|
625
|
-
return this.#inner.getNumberOfEntryModules(Chunk.__to_binding(chunk));
|
626
|
-
}
|
627
|
-
getChunkEntryDependentChunksIterable(chunk) {
|
628
|
-
return this.#inner.getChunkEntryDependentChunksIterable(Chunk.__to_binding(chunk)).map((binding)=>Chunk.__from_binding(binding));
|
629
|
-
}
|
630
|
-
getChunkModulesIterableBySourceType(chunk, sourceType) {
|
631
|
-
return this.#inner.getChunkModulesIterableBySourceType(Chunk.__to_binding(chunk), sourceType);
|
632
|
-
}
|
633
|
-
getModuleChunks(module) {
|
634
|
-
return this.#inner.getModuleChunks(module).map((binding)=>Chunk.__from_binding(binding));
|
635
|
-
}
|
636
|
-
getModuleChunksIterable(module) {
|
637
|
-
return this.#inner.getModuleChunks(module).map((binding)=>Chunk.__from_binding(binding));
|
638
|
-
}
|
639
|
-
getModuleId(module) {
|
640
|
-
return this.#inner.getModuleId(module);
|
641
|
-
}
|
642
|
-
getModuleHash(module, runtime) {
|
643
|
-
return this.#inner.getModuleHash(module, toJsRuntimeSpec(runtime));
|
644
|
-
}
|
645
|
-
getBlockChunkGroup(depBlock) {
|
646
|
-
let binding = this.#inner.getBlockChunkGroup(depBlock);
|
647
|
-
return binding ? ChunkGroup.__from_binding(binding) : null;
|
648
|
-
}
|
649
|
-
}
|
650
|
-
let ENTRYPOINT_MAPPINGS = new WeakMap();
|
651
|
-
class Entrypoint extends ChunkGroup {
|
652
|
-
#inner;
|
653
|
-
static __from_binding(binding) {
|
654
|
-
let entrypoint = ENTRYPOINT_MAPPINGS.get(binding);
|
655
|
-
return entrypoint || (entrypoint = new Entrypoint(binding), ENTRYPOINT_MAPPINGS.set(binding, entrypoint)), entrypoint;
|
656
|
-
}
|
657
|
-
constructor(binding){
|
658
|
-
super(binding), this.#inner = binding;
|
659
|
-
}
|
660
|
-
getRuntimeChunk() {
|
661
|
-
let chunkBinding = this.#inner.getRuntimeChunk();
|
662
|
-
return chunkBinding ? Chunk.__from_binding(chunkBinding) : null;
|
663
|
-
}
|
664
|
-
getEntrypointChunk() {
|
665
|
-
let chunkBinding = this.#inner.getEntrypointChunk();
|
666
|
-
return chunkBinding ? Chunk.__from_binding(chunkBinding) : null;
|
667
|
-
}
|
668
|
-
}
|
669
|
-
let cutOffByFlag = (stack, flag)=>{
|
438
|
+
let lite_tapable_namespaceObject = require("@rspack/lite-tapable"), cutOffByFlag = (stack, flag)=>{
|
670
439
|
let stacks = stack.split("\n");
|
671
440
|
for(let i = 0; i < stacks.length; i++)stacks[i].includes(flag) && (stacks.length = i);
|
672
441
|
return stacks.join("\n");
|
673
|
-
}, cutOffLoaderExecution = (stack)=>cutOffByFlag(stack, "LOADER_EXECUTION")
|
442
|
+
}, cutOffLoaderExecution = (stack)=>cutOffByFlag(stack, "LOADER_EXECUTION"), cleanUp = (stack, name, message)=>{
|
443
|
+
let details = cutOffLoaderExecution(stack);
|
444
|
+
return cutOffMessage(stack, name, message);
|
445
|
+
}, cutOffMessage = (stack, name, message)=>{
|
446
|
+
let nextLine = stack.indexOf("\n");
|
447
|
+
return -1 === nextLine ? stack === message ? "" : stack : stack.slice(0, nextLine) === `${name}: ${message}` ? stack.slice(nextLine + 1) : stack;
|
448
|
+
};
|
449
|
+
function toJsRuntimeSpec(runtime) {
|
450
|
+
return runtime instanceof Set ? Array.from(runtime) : runtime;
|
451
|
+
}
|
674
452
|
class ExportsInfo {
|
675
453
|
#inner;
|
676
454
|
static __from_binding(binding) {
|
@@ -1456,14 +1234,61 @@ for(var __webpack_i__ in (()=>{
|
|
1456
1234
|
};
|
1457
1235
|
}
|
1458
1236
|
}
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1237
|
+
Object.defineProperty(binding_.Chunk.prototype, "files", {
|
1238
|
+
enumerable: !0,
|
1239
|
+
configurable: !0,
|
1240
|
+
get () {
|
1241
|
+
return new Set(this._files);
|
1242
|
+
}
|
1243
|
+
}), Object.defineProperty(binding_.Chunk.prototype, "runtime", {
|
1244
|
+
enumerable: !0,
|
1245
|
+
configurable: !0,
|
1246
|
+
get () {
|
1247
|
+
return new Set(this._runtime);
|
1248
|
+
}
|
1249
|
+
}), Object.defineProperty(binding_.Chunk.prototype, "auxiliaryFiles", {
|
1250
|
+
enumerable: !0,
|
1251
|
+
configurable: !0,
|
1252
|
+
get () {
|
1253
|
+
return new Set(this._auxiliaryFiles);
|
1254
|
+
}
|
1255
|
+
}), Object.defineProperty(binding_.Chunk.prototype, "groupsIterable", {
|
1256
|
+
enumerable: !0,
|
1257
|
+
configurable: !0,
|
1258
|
+
get () {
|
1259
|
+
return new Set(this._groupsIterable);
|
1260
|
+
}
|
1261
|
+
}), Object.defineProperty(binding_.Chunk.prototype, "getChunkMaps", {
|
1262
|
+
enumerable: !0,
|
1263
|
+
configurable: !0,
|
1264
|
+
value (realHash) {
|
1265
|
+
let chunkHashMap = {}, chunkContentHashMap = {}, chunkNameMap = {};
|
1266
|
+
for (let chunk of this.getAllAsyncChunks()){
|
1267
|
+
let id = chunk.id;
|
1268
|
+
if (!id) continue;
|
1269
|
+
let chunkHash = realHash ? chunk.hash : chunk.renderedHash;
|
1270
|
+
for (let key of (chunkHash && (chunkHashMap[id] = chunkHash), Object.keys(chunk.contentHash)))chunkContentHashMap[key] || (chunkContentHashMap[key] = {}), chunkContentHashMap[key][id] = chunk.contentHash[key];
|
1271
|
+
chunk.name && (chunkNameMap[id] = chunk.name);
|
1272
|
+
}
|
1273
|
+
return {
|
1274
|
+
hash: chunkHashMap,
|
1275
|
+
contentHash: chunkContentHashMap,
|
1276
|
+
name: chunkNameMap
|
1277
|
+
};
|
1278
|
+
}
|
1279
|
+
}), Object.defineProperty(binding_.Chunk.prototype, external_node_util_default().inspect.custom, {
|
1463
1280
|
enumerable: !0,
|
1464
1281
|
configurable: !0,
|
1465
1282
|
value () {
|
1466
|
-
return
|
1283
|
+
return {
|
1284
|
+
...this
|
1285
|
+
};
|
1286
|
+
}
|
1287
|
+
}), Object.defineProperty(binding_.Chunks.prototype, "values", {
|
1288
|
+
enumerable: !0,
|
1289
|
+
configurable: !0,
|
1290
|
+
value () {
|
1291
|
+
return this._values().values();
|
1467
1292
|
}
|
1468
1293
|
}), Object.defineProperty(binding_.Chunks.prototype, Symbol.iterator, {
|
1469
1294
|
enumerable: !0,
|
@@ -1481,16 +1306,26 @@ for(var __webpack_i__ in (()=>{
|
|
1481
1306
|
enumerable: !0,
|
1482
1307
|
configurable: !0,
|
1483
1308
|
value (callbackfn, thisArg) {
|
1484
|
-
for (let
|
1485
|
-
let chunk = Chunk.__from_binding(binding);
|
1486
|
-
callbackfn.call(thisArg, chunk, chunk, this);
|
1487
|
-
}
|
1309
|
+
for (let chunk of this._values())callbackfn.call(thisArg, chunk, chunk, this);
|
1488
1310
|
}
|
1489
1311
|
}), Object.defineProperty(binding_.Chunks.prototype, "has", {
|
1490
1312
|
enumerable: !0,
|
1491
1313
|
configurable: !0,
|
1492
1314
|
value (value) {
|
1493
|
-
return this._has(
|
1315
|
+
return this._has(value);
|
1316
|
+
}
|
1317
|
+
}), Object.defineProperty(binding_.ChunkGraph.prototype, "getOrderedChunkModulesIterable", {
|
1318
|
+
enumerable: !0,
|
1319
|
+
configurable: !0,
|
1320
|
+
value (chunk, compareFn) {
|
1321
|
+
let modules = this.getChunkModules(chunk);
|
1322
|
+
return modules.sort(compareFn), modules;
|
1323
|
+
}
|
1324
|
+
}), Object.defineProperty(binding_.ChunkGraph.prototype, "getModuleHash", {
|
1325
|
+
enumerable: !0,
|
1326
|
+
configurable: !0,
|
1327
|
+
value (module, runtime) {
|
1328
|
+
return this._getModuleHash(module, toJsRuntimeSpec(runtime));
|
1494
1329
|
}
|
1495
1330
|
}), Object.defineProperty(binding_.Sources.prototype, "get", {
|
1496
1331
|
enumerable: !0,
|
@@ -1500,32 +1335,7 @@ for(var __webpack_i__ in (()=>{
|
|
1500
1335
|
return originalSource ? JsSource.__from_binding(originalSource) : null;
|
1501
1336
|
}
|
1502
1337
|
});
|
1503
|
-
let
|
1504
|
-
if (Buffer.isBuffer(bufLike)) return bufLike;
|
1505
|
-
if ("string" == typeof bufLike) return Buffer.from(bufLike);
|
1506
|
-
if (bufLike instanceof Uint8Array) return Buffer.from(bufLike.buffer);
|
1507
|
-
throw Error("Buffer, Uint8Array or string expected");
|
1508
|
-
}, toObject = (input)=>{
|
1509
|
-
let s;
|
1510
|
-
if (Buffer.isBuffer(input)) s = input.toString("utf8");
|
1511
|
-
else if (input && "object" == typeof input) return input;
|
1512
|
-
else if ("string" == typeof input) s = input;
|
1513
|
-
else throw Error("Buffer or string or object expected");
|
1514
|
-
return JSON.parse(s);
|
1515
|
-
};
|
1516
|
-
function serializeObject(map) {
|
1517
|
-
if (!isNil(map)) return "string" == typeof map ? map ? toBuffer(map) : void 0 : toBuffer(JSON.stringify(map));
|
1518
|
-
}
|
1519
|
-
function concatErrorMsgAndStack(err) {
|
1520
|
-
return "string" == typeof err ? Error(err) : (!("hideStack" in err && err.hideStack) && "stack" in err ? err.message = err.stack || err.toString() : err.message = err.toString(), err.stack = err.stack || void 0, err);
|
1521
|
-
}
|
1522
|
-
function stringifyLoaderObject(o) {
|
1523
|
-
return o.path + o.query + o.fragment;
|
1524
|
-
}
|
1525
|
-
let unsupported = (name, issue)=>{
|
1526
|
-
let s = `${name} is not supported by rspack.`;
|
1527
|
-
throw issue && (s += ` Please refer to issue ${issue} for more information.`), Error(s);
|
1528
|
-
}, $proxy = Symbol.for("proxy");
|
1338
|
+
let $proxy = Symbol.for("proxy");
|
1529
1339
|
function createDiagnosticArray(adm) {
|
1530
1340
|
if ($proxy in adm) return adm[$proxy];
|
1531
1341
|
let array = [];
|
@@ -1539,14 +1349,14 @@ for(var __webpack_i__ in (()=>{
|
|
1539
1349
|
case 2:
|
1540
1350
|
return adm.spliceWithArray(index, deleteCount);
|
1541
1351
|
}
|
1542
|
-
return adm.spliceWithArray(index, deleteCount, newItems
|
1352
|
+
return adm.spliceWithArray(index, deleteCount, newItems);
|
1543
1353
|
}, arrayExtensions = {
|
1544
1354
|
[Symbol.iterator]: ()=>adm.values().values(),
|
1545
1355
|
splice,
|
1546
|
-
push: (...newItems)=>(adm.spliceWithArray(adm.length, 0, newItems
|
1356
|
+
push: (...newItems)=>(adm.spliceWithArray(adm.length, 0, newItems), adm.length),
|
1547
1357
|
pop: ()=>splice(Math.max(adm.length - 1, 0), 1)[0],
|
1548
1358
|
shift: ()=>splice(0, 1)[0],
|
1549
|
-
unshift: (...newItems)=>(adm.spliceWithArray(0, 0, newItems
|
1359
|
+
unshift: (...newItems)=>(adm.spliceWithArray(0, 0, newItems), adm.length),
|
1550
1360
|
reverse: ()=>adm.values().reverse(),
|
1551
1361
|
sort (compareFn) {
|
1552
1362
|
let copy = adm.values();
|
@@ -1564,13 +1374,14 @@ for(var __webpack_i__ in (()=>{
|
|
1564
1374
|
adm.values().forEach(callbackfn, thisArg);
|
1565
1375
|
},
|
1566
1376
|
map: (callbackfn, thisArg)=>adm.values().map(callbackfn, thisArg),
|
1377
|
+
slice: (start, end)=>adm.values().slice(start, end),
|
1567
1378
|
reduce: (callbackfn, initialValue)=>adm.values().reduce(callbackfn, initialValue),
|
1568
1379
|
reduceRight: (callbackfn, initialValue)=>adm.values().reduceRight(callbackfn, initialValue)
|
1569
1380
|
}, proxy = new Proxy(array, {
|
1570
1381
|
get: (target, name)=>"length" === name ? adm.length : "string" != typeof name || Number.isNaN(Number.parseInt(name)) ? Object.prototype.hasOwnProperty.call(arrayExtensions, name) ? arrayExtensions[name] : target[name] : adm.get(Number.parseInt(name)),
|
1571
1382
|
set (target, name, value) {
|
1572
1383
|
if ("length" === name) throw Error("The 'length' property is read-only and cannot be assigned a new value.");
|
1573
|
-
return "symbol" == typeof name || Number.isNaN(Number.parseInt(name)) ? target[name] = value : adm.set(Number.parseInt(name),
|
1384
|
+
return "symbol" == typeof name || Number.isNaN(Number.parseInt(name)) ? target[name] = value : adm.set(Number.parseInt(name), value), !0;
|
1574
1385
|
}
|
1575
1386
|
});
|
1576
1387
|
return adm[$proxy] = proxy, proxy;
|
@@ -1726,7 +1537,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
1726
1537
|
seal: new lite_tapable_namespaceObject.SyncHook([]),
|
1727
1538
|
afterSeal: new lite_tapable_namespaceObject.AsyncSeriesHook([]),
|
1728
1539
|
needAdditionalPass: new lite_tapable_namespaceObject.SyncBailHook([])
|
1729
|
-
}, this.compiler = compiler, this.resolverFactory = compiler.resolverFactory, this.inputFileSystem = compiler.inputFileSystem, this.options = compiler.options, this.outputOptions = compiler.options.output, this.logging = new Map(), this.childrenCounters = {}, this.children = [], this.needAdditionalPass = !1, this.chunkGraph =
|
1540
|
+
}, this.compiler = compiler, this.resolverFactory = compiler.resolverFactory, this.inputFileSystem = compiler.inputFileSystem, this.options = compiler.options, this.outputOptions = compiler.options.output, this.logging = new Map(), this.childrenCounters = {}, this.children = [], this.needAdditionalPass = !1, this.chunkGraph = inner.chunkGraph, this.moduleGraph = ModuleGraph.__from_binding(inner.moduleGraph), this.#addIncludeDispatcher = new AddEntryItemDispatcher(inner.addInclude.bind(inner)), this.#addEntryDispatcher = new AddEntryItemDispatcher(inner.addEntry.bind(inner)), this[binding_.COMPILATION_HOOKS_MAP_SYMBOL] = new WeakMap();
|
1730
1541
|
}
|
1731
1542
|
get hash() {
|
1732
1543
|
return this.#inner.hash;
|
@@ -1738,25 +1549,19 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
1738
1549
|
return this.#createCachedAssets();
|
1739
1550
|
}
|
1740
1551
|
get entrypoints() {
|
1741
|
-
return new Map(this.#inner.entrypoints.map((
|
1742
|
-
let entrypoint = Entrypoint.__from_binding(binding);
|
1743
|
-
return [
|
1552
|
+
return new Map(this.#inner.entrypoints.map((entrypoint)=>[
|
1744
1553
|
entrypoint.name,
|
1745
1554
|
entrypoint
|
1746
|
-
];
|
1747
|
-
}));
|
1555
|
+
]));
|
1748
1556
|
}
|
1749
1557
|
get chunkGroups() {
|
1750
|
-
return this.#inner.chunkGroups
|
1558
|
+
return this.#inner.chunkGroups;
|
1751
1559
|
}
|
1752
1560
|
get namedChunkGroups() {
|
1753
1561
|
return createReadonlyMap({
|
1754
1562
|
keys: ()=>this.#inner.getNamedChunkGroupKeys()[Symbol.iterator](),
|
1755
1563
|
get: (property)=>{
|
1756
|
-
if ("string" == typeof property)
|
1757
|
-
let binding = this.#inner.getNamedChunkGroup(property);
|
1758
|
-
return ChunkGroup.__from_binding(binding);
|
1759
|
-
}
|
1564
|
+
if ("string" == typeof property) return this.#inner.getNamedChunkGroup(property);
|
1760
1565
|
}
|
1761
1566
|
});
|
1762
1567
|
}
|
@@ -1773,10 +1578,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
1773
1578
|
return createReadonlyMap({
|
1774
1579
|
keys: ()=>this.#inner.getNamedChunkKeys()[Symbol.iterator](),
|
1775
1580
|
get: (property)=>{
|
1776
|
-
if ("string" == typeof property)
|
1777
|
-
let binding = this.#inner.getNamedChunk(property);
|
1778
|
-
return binding ? Chunk.__from_binding(binding) : void 0;
|
1779
|
-
}
|
1581
|
+
if ("string" == typeof property) return this.#inner.getNamedChunk(property);
|
1780
1582
|
}
|
1781
1583
|
});
|
1782
1584
|
}
|
@@ -1968,7 +1770,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
1968
1770
|
this.#rebuildModuleTask.exec(module.identifier(), f);
|
1969
1771
|
}
|
1970
1772
|
addRuntimeModule(chunk, runtimeModule) {
|
1971
|
-
runtimeModule.attach(this, chunk, this.chunkGraph), this.#inner.addRuntimeModule(
|
1773
|
+
runtimeModule.attach(this, chunk, this.chunkGraph), this.#inner.addRuntimeModule(chunk, RuntimeModule.__to_binding(this, runtimeModule));
|
1972
1774
|
}
|
1973
1775
|
addInclude(context, dependency, options, callback) {
|
1974
1776
|
this.#addIncludeDispatcher.call(context, dependency, options, callback);
|
@@ -2846,7 +2648,32 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2846
2648
|
return this.resolverFactory.get(type, resolveOptions);
|
2847
2649
|
}
|
2848
2650
|
}
|
2849
|
-
|
2651
|
+
function isNil(value) {
|
2652
|
+
return null == value;
|
2653
|
+
}
|
2654
|
+
let toBuffer = (bufLike)=>{
|
2655
|
+
if (Buffer.isBuffer(bufLike)) return bufLike;
|
2656
|
+
if ("string" == typeof bufLike) return Buffer.from(bufLike);
|
2657
|
+
if (bufLike instanceof Uint8Array) return Buffer.from(bufLike.buffer);
|
2658
|
+
throw Error("Buffer, Uint8Array or string expected");
|
2659
|
+
}, toObject = (input)=>{
|
2660
|
+
let s;
|
2661
|
+
if (Buffer.isBuffer(input)) s = input.toString("utf8");
|
2662
|
+
else if (input && "object" == typeof input) return input;
|
2663
|
+
else if ("string" == typeof input) s = input;
|
2664
|
+
else throw Error("Buffer or string or object expected");
|
2665
|
+
return JSON.parse(s);
|
2666
|
+
};
|
2667
|
+
function serializeObject(map) {
|
2668
|
+
if (!isNil(map)) return "string" == typeof map ? map ? toBuffer(map) : void 0 : toBuffer(JSON.stringify(map));
|
2669
|
+
}
|
2670
|
+
function stringifyLoaderObject(o) {
|
2671
|
+
return o.path + o.query + o.fragment;
|
2672
|
+
}
|
2673
|
+
let unsupported = (name, issue)=>{
|
2674
|
+
let s = `${name} is not supported by rspack.`;
|
2675
|
+
throw issue && (s += ` Please refer to issue ${issue} for more information.`), Error(s);
|
2676
|
+
}, WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, relativePathToRequest = (relativePath)=>"" === relativePath ? "./." : ".." === relativePath ? "../." : relativePath.startsWith("../") ? relativePath : `./${relativePath}`, absoluteToRequest = (context, maybeAbsolutePath)=>{
|
2850
2677
|
if ("/" === maybeAbsolutePath[0]) {
|
2851
2678
|
if (maybeAbsolutePath.length > 1 && "/" === maybeAbsolutePath[maybeAbsolutePath.length - 1]) return maybeAbsolutePath;
|
2852
2679
|
let querySplitPos = maybeAbsolutePath.indexOf("?"), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
@@ -3152,6 +2979,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3152
2979
|
}
|
3153
2980
|
}
|
3154
2981
|
class JavaScriptTracer {
|
2982
|
+
static state = "uninitialized";
|
3155
2983
|
static startTime;
|
3156
2984
|
static events;
|
3157
2985
|
static layer;
|
@@ -3159,8 +2987,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3159
2987
|
static session;
|
3160
2988
|
static counter = 10000;
|
3161
2989
|
static async initJavaScriptTrace(layer, output) {
|
3162
|
-
let { Session } =
|
3163
|
-
this.session = new Session(), this.layer = layer, this.output = output, this.events = [], this.startTime = process.hrtime.bigint();
|
2990
|
+
let { Session } = __webpack_require__("node:inspector");
|
2991
|
+
this.session = new Session(), this.layer = layer, this.output = output, this.events = [], this.state = "on", this.startTime = process.hrtime.bigint();
|
3164
2992
|
}
|
3165
2993
|
static uuid() {
|
3166
2994
|
return this.counter++;
|
@@ -3169,7 +2997,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3169
2997
|
this.layer && (this.session.connect(), this.session.post("Profiler.enable"), this.session.post("Profiler.start"));
|
3170
2998
|
}
|
3171
2999
|
static async cleanupJavaScriptTrace() {
|
3172
|
-
if (
|
3000
|
+
if ("uninitialized" === this.state) throw Error("JavaScriptTracer is not initialized, please call initJavaScriptTrace first");
|
3001
|
+
if (!this.layer || "off" === this.state) return;
|
3173
3002
|
let profileHandler = (err, param)=>{
|
3174
3003
|
let cpu_profile;
|
3175
3004
|
if (err ? console.error("Error stopping profiler:", err) : cpu_profile = param.profile, cpu_profile) {
|
@@ -3208,7 +3037,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3208
3037
|
});
|
3209
3038
|
}
|
3210
3039
|
};
|
3211
|
-
|
3040
|
+
await new Promise((resolve, reject)=>{
|
3212
3041
|
this.session.post("Profiler.stop", (err, params)=>{
|
3213
3042
|
if (err) reject(err);
|
3214
3043
|
else try {
|
@@ -3217,7 +3046,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3217
3046
|
reject(err);
|
3218
3047
|
}
|
3219
3048
|
});
|
3220
|
-
});
|
3049
|
+
}), this.state = "off";
|
3221
3050
|
}
|
3222
3051
|
static getTs() {
|
3223
3052
|
return process.hrtime.bigint() - this.startTime;
|
@@ -3250,6 +3079,20 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3250
3079
|
});
|
3251
3080
|
}
|
3252
3081
|
}
|
3082
|
+
class ModuleError extends WebpackError {
|
3083
|
+
error;
|
3084
|
+
constructor(err, { from } = {}){
|
3085
|
+
let message = "Module Error";
|
3086
|
+
from ? message += ` (from ${from}):\n` : message += ": ", err && "object" == typeof err && err.message ? message += err.message : err && (message += err), super(message), this.name = "ModuleError", this.error = err, this.details = err && "object" == typeof err && err.stack ? cleanUp(err.stack, err.name, err.message) : void 0;
|
3087
|
+
}
|
3088
|
+
}
|
3089
|
+
class ModuleWarning extends WebpackError {
|
3090
|
+
error;
|
3091
|
+
constructor(err, { from } = {}){
|
3092
|
+
let message = "Module Warning";
|
3093
|
+
from ? message += ` (from ${from}):\n` : message += ": ", err && "object" == typeof err && err.message ? message += err.message : err && (message += err), super(message), this.name = "ModuleWarning", this.error = err, this.details = err && "object" == typeof err && err.stack ? cleanUp(err.stack, err.name, err.message) : void 0;
|
3094
|
+
}
|
3095
|
+
}
|
3253
3096
|
let external_node_worker_threads_namespaceObject = require("node:worker_threads"), ensureLoaderWorkerPool = async ()=>service_pool || (service_pool = Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "tinypool")).then(({ Tinypool })=>{
|
3254
3097
|
let availableThreads = Math.max(__webpack_require__("node:os").cpus().length - 1, 1);
|
3255
3098
|
return new Tinypool({
|
@@ -3618,15 +3461,21 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3618
3461
|
name,
|
3619
3462
|
resource
|
3620
3463
|
].filter(Boolean).join("|"));
|
3621
|
-
}, loaderContext.rootContext = compiler.context, loaderContext.emitError = function(
|
3622
|
-
|
3623
|
-
|
3464
|
+
}, loaderContext.rootContext = compiler.context, loaderContext.emitError = function(e) {
|
3465
|
+
e instanceof Error || (e = new NonErrorEmittedError(e));
|
3466
|
+
let error = new ModuleError(e, {
|
3467
|
+
from: stringifyLoaderObject(loaderContext.loaders[loaderContext.loaderIndex])
|
3468
|
+
});
|
3469
|
+
error.module = loaderContext._module, compiler._lastCompilation.__internal__pushRspackDiagnostic({
|
3624
3470
|
error,
|
3625
3471
|
severity: binding_.JsRspackSeverity.Error
|
3626
3472
|
});
|
3627
|
-
}, loaderContext.emitWarning = function(
|
3628
|
-
|
3629
|
-
|
3473
|
+
}, loaderContext.emitWarning = function(e) {
|
3474
|
+
e instanceof Error || (e = new NonErrorEmittedError(e));
|
3475
|
+
let warning = new ModuleWarning(e, {
|
3476
|
+
from: stringifyLoaderObject(loaderContext.loaders[loaderContext.loaderIndex])
|
3477
|
+
});
|
3478
|
+
warning.module = loaderContext._module, compiler._lastCompilation.__internal__pushRspackDiagnostic({
|
3630
3479
|
error: warning,
|
3631
3480
|
severity: binding_.JsRspackSeverity.Warn
|
3632
3481
|
});
|
@@ -3934,15 +3783,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3934
3783
|
}
|
3935
3784
|
context.loaderItems = loaderContext.loaders.map((item)=>LoaderObject.__to_binding(item));
|
3936
3785
|
} catch (e) {
|
3937
|
-
|
3938
|
-
|
3939
|
-
|
3940
|
-
}
|
3941
|
-
name: "ModuleBuildError",
|
3942
|
-
message: e.message,
|
3943
|
-
stack: "string" == typeof e.stack ? e.stack : void 0,
|
3944
|
-
hideStack: "hideStack" in e ? !0 === e.hideStack || "true" === e.hideStack : void 0
|
3945
|
-
};
|
3786
|
+
if ("object" != typeof e || null === e) {
|
3787
|
+
let error = Error(`(Emitted value instead of an instance of Error) ${e}`);
|
3788
|
+
error.name = "NonErrorEmittedError", context.__internal__error = error;
|
3789
|
+
} else context.__internal__error = e;
|
3946
3790
|
}
|
3947
3791
|
return JavaScriptTracer.endAsync({
|
3948
3792
|
name: "run_js_loaders",
|
@@ -4513,7 +4357,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
4513
4357
|
value: name
|
4514
4358
|
}), Plugin;
|
4515
4359
|
}
|
4516
|
-
let APIPlugin = base_create(binding_.BuiltinPluginName.APIPlugin, ()=>{}), ArrayPushCallbackChunkFormatPlugin = base_create(binding_.BuiltinPluginName.ArrayPushCallbackChunkFormatPlugin, ()=>{}), AssetModulesPlugin = base_create(binding_.BuiltinPluginName.AssetModulesPlugin, ()=>{}, "compilation"), AsyncWebAssemblyModulesPlugin = base_create(binding_.BuiltinPluginName.AsyncWebAssemblyModulesPlugin, ()=>{}, "compilation"), BannerPlugin = base_create(binding_.BuiltinPluginName.BannerPlugin, (args)=>"string" == typeof args || "function" == typeof args ? {
|
4360
|
+
let INTERNAL_PLUGIN_NAMES = Object.keys(binding_.BuiltinPluginName), APIPlugin = base_create(binding_.BuiltinPluginName.APIPlugin, ()=>{}), ArrayPushCallbackChunkFormatPlugin = base_create(binding_.BuiltinPluginName.ArrayPushCallbackChunkFormatPlugin, ()=>{}), AssetModulesPlugin = base_create(binding_.BuiltinPluginName.AssetModulesPlugin, ()=>{}, "compilation"), AsyncWebAssemblyModulesPlugin = base_create(binding_.BuiltinPluginName.AsyncWebAssemblyModulesPlugin, ()=>{}, "compilation"), BannerPlugin = base_create(binding_.BuiltinPluginName.BannerPlugin, (args)=>"string" == typeof args || "function" == typeof args ? {
|
4517
4361
|
banner: args
|
4518
4362
|
} : {
|
4519
4363
|
banner: args.banner,
|
@@ -8042,27 +7886,29 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8042
7886
|
let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
|
8043
7887
|
return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
|
8044
7888
|
};
|
8045
|
-
function applyPlugin(compiler, options, activeModules, filesByKey) {
|
7889
|
+
function applyPlugin(compiler, moduleToIndex, indexToModule, options, activeModules, filesByKey) {
|
8046
7890
|
new BuiltinLazyCompilationPlugin(({ module, path })=>{
|
8047
|
-
let
|
7891
|
+
let index = moduleToIndex.get(module);
|
7892
|
+
void 0 === index && (index = moduleToIndex.size.toString(), moduleToIndex.set(module, index), indexToModule.set(index, module));
|
7893
|
+
let key = indexToModule.get(index);
|
8048
7894
|
filesByKey.set(key, path);
|
8049
7895
|
let active = !0 === activeModules.get(key);
|
8050
7896
|
return {
|
8051
7897
|
client: `${options.client || getDefaultClient(compiler)}?${encodeURIComponent(getFullServerUrl(options))}`,
|
8052
|
-
data:
|
7898
|
+
data: index,
|
8053
7899
|
active
|
8054
7900
|
};
|
8055
7901
|
}, options.cacheable ?? !0, options.entries ?? !0, options.imports ?? !0, options.test).apply(compiler);
|
8056
7902
|
}
|
8057
|
-
let lazyCompilationMiddlewareInternal = (compiler, activeModules, filesByKey, lazyCompilationPrefix)=>{
|
7903
|
+
let lazyCompilationMiddlewareInternal = (compiler, indexToModule, activeModules, filesByKey, lazyCompilationPrefix)=>{
|
8058
7904
|
let logger = compiler.getInfrastructureLogger("LazyCompilation");
|
8059
7905
|
return (req, res, next)=>{
|
8060
7906
|
if (!req.url?.startsWith(lazyCompilationPrefix)) return next?.();
|
8061
|
-
let
|
7907
|
+
let indices = req.url.slice(lazyCompilationPrefix.length).split("@");
|
8062
7908
|
req.socket.setNoDelay(!0), res.setHeader("content-type", "text/event-stream"), res.writeHead(200), res.write("\n");
|
8063
7909
|
let moduleActivated = [];
|
8064
|
-
for (let
|
8065
|
-
let oldValue = activeModules.get(key) ?? !1;
|
7910
|
+
for (let index of indices){
|
7911
|
+
let key = indexToModule.get(index), oldValue = activeModules.get(key) ?? !1;
|
8066
7912
|
activeModules.set(key, !0), oldValue || (logger.log(`${key} is now in use and will be compiled.`), moduleActivated.push(key));
|
8067
7913
|
}
|
8068
7914
|
if (moduleActivated.length && compiler.watching) {
|
@@ -8143,21 +7989,21 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8143
7989
|
return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).createScript;
|
8144
7990
|
}, function(queried) {
|
8145
7991
|
return function(data) {
|
8146
|
-
return queried.call(data.code,
|
7992
|
+
return queried.call(data.code, data.chunk);
|
8147
7993
|
};
|
8148
7994
|
}),
|
8149
7995
|
registerRuntimePluginLinkPreloadTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginLinkPreload, function() {
|
8150
7996
|
return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).linkPreload;
|
8151
7997
|
}, function(queried) {
|
8152
7998
|
return function(data) {
|
8153
|
-
return queried.call(data.code,
|
7999
|
+
return queried.call(data.code, data.chunk);
|
8154
8000
|
};
|
8155
8001
|
}),
|
8156
8002
|
registerRuntimePluginLinkPrefetchTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginLinkPrefetch, function() {
|
8157
8003
|
return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).linkPrefetch;
|
8158
8004
|
}, function(queried) {
|
8159
8005
|
return function(data) {
|
8160
|
-
return queried.call(data.code,
|
8006
|
+
return queried.call(data.code, data.chunk);
|
8161
8007
|
};
|
8162
8008
|
})
|
8163
8009
|
}), SideEffectsFlagPlugin = base_create(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
|
@@ -8188,7 +8034,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8188
8034
|
return "function" == typeof name ? (ctx)=>void 0 === ctx.module ? name(void 0) : name(ctx.module, getChunks(ctx.chunks), ctx.cacheGroupKey) : name;
|
8189
8035
|
}
|
8190
8036
|
function getChunks(chunks) {
|
8191
|
-
return "function" == typeof chunks ? (chunk)=>chunks(
|
8037
|
+
return "function" == typeof chunks ? (chunk)=>chunks(chunk) : chunks;
|
8192
8038
|
}
|
8193
8039
|
let { name, chunks, defaultSizeTypes, cacheGroups = {}, fallbackCacheGroup, minSize, minSizeReduction, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = sc;
|
8194
8040
|
return {
|
@@ -8510,12 +8356,13 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8510
8356
|
var hashFuncNames, source;
|
8511
8357
|
if (tag.attributes && "integrity" in tag.attributes) return;
|
8512
8358
|
let tagSrc = function(tag) {
|
8513
|
-
if (
|
8514
|
-
"script"
|
8515
|
-
"link"
|
8516
|
-
|
8517
|
-
|
8518
|
-
|
8359
|
+
if (tag.attributes) {
|
8360
|
+
if ("script" === tag.tagName && "string" == typeof tag.attributes.src) return tag.attributes.src;
|
8361
|
+
if ("link" === tag.tagName && "string" == typeof tag.attributes.href) {
|
8362
|
+
let rel = tag.attributes.rel;
|
8363
|
+
if ("string" != typeof rel) return;
|
8364
|
+
return "stylesheet" === rel || "modulepreload" === rel || "preload" === rel && ("script" === tag.attributes.as || "style" === tag.attributes.as) ? tag.attributes.href : void 0;
|
8365
|
+
}
|
8519
8366
|
}
|
8520
8367
|
}(tag);
|
8521
8368
|
if (!tagSrc) return;
|
@@ -9176,6 +9023,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
9176
9023
|
See https://github.com/browserslist/browserslist#queries for possible ways to provide a config.
|
9177
9024
|
The recommended way is to add a 'browserslist' key to your package.json and list supported browsers (resp. node.js versions).
|
9178
9025
|
You can also more options via the 'target' option: 'browserslist' / 'browserslist:env' / 'browserslist:query' / 'browserslist:path-to-config' / 'browserslist:path-to-config:env'`);
|
9026
|
+
if (Array.isArray(browsers) && 0 === browsers.length) throw Error("Rspack cannot parse the browserslist query. This may happen when the query contains version requirements that exceed the supported range in the browserslist-rs database. Check your browserslist configuration for invalid version numbers.");
|
9179
9027
|
return getBrowserslistTargetHandler().resolve(browsers);
|
9180
9028
|
}
|
9181
9029
|
],
|
@@ -9433,7 +9281,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9433
9281
|
}, applyExperimentsDefaults = (experiments, { production, development })=>{
|
9434
9282
|
defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !0), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1);
|
9435
9283
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
9436
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.
|
9284
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.3"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
9437
9285
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyJavascriptParserOptionsDefaults = (parserOptions)=>{
|
9438
9286
|
D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
|
9439
9287
|
"..."
|
@@ -9597,7 +9445,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9597
9445
|
return "function" != typeof chunkFilename ? chunkFilename.replace(/\.[mc]?js(\?|$)/, ".css$1") : "[id].css";
|
9598
9446
|
}), D(output, "hotUpdateChunkFilename", `[id].[fullhash].hot-update.${output.module ? "mjs" : "js"}`), D(output, "hotUpdateMainFilename", "[runtime].[fullhash].hot-update.json");
|
9599
9447
|
let uniqueNameId = Template.toIdentifier(output.uniqueName);
|
9600
|
-
defaults_F(output, "hotUpdateGlobal", ()=>`webpackHotUpdate${uniqueNameId}`), defaults_F(output, "chunkLoadingGlobal", ()=>`webpackChunk${uniqueNameId}`), D(output, "assetModuleFilename", "[hash][ext][query]"), D(output, "webassemblyModuleFilename", "[hash].module.wasm"), D(output, "compareBeforeEmit", !0), defaults_F(output, "path", ()=>external_node_path_default().join(process.cwd(), "dist")), defaults_F(output, "pathinfo", ()=>development), D(output, "publicPath", tp && (tp.document || tp.importScripts) ? "auto" : ""), D(output, "hashFunction", "xxhash64"), D(output, "hashDigest", "hex"), D(output, "hashDigestLength", 16), D(output, "strictModuleErrorHandling", !1), output.library && defaults_F(output.library, "type", ()=>output.module ? "module" : "var"), defaults_F(output, "chunkFormat", ()=>{
|
9448
|
+
defaults_F(output, "hotUpdateGlobal", ()=>`webpackHotUpdate${uniqueNameId}`), defaults_F(output, "chunkLoadingGlobal", ()=>`webpackChunk${uniqueNameId}`), D(output, "assetModuleFilename", "[hash][ext][query]"), D(output, "webassemblyModuleFilename", "[hash].module.wasm"), D(output, "compareBeforeEmit", !0), defaults_F(output, "path", ()=>external_node_path_default().join(process.cwd(), "dist")), defaults_F(output, "pathinfo", ()=>development), D(output, "crossOriginLoading", !1), defaults_F(output, "scriptType", ()=>!!output.module && "module"), D(output, "publicPath", tp && (tp.document || tp.importScripts) || "module" === output.scriptType ? "auto" : ""), D(output, "hashFunction", "xxhash64"), D(output, "hashDigest", "hex"), D(output, "hashDigestLength", 16), D(output, "strictModuleErrorHandling", !1), output.library && defaults_F(output.library, "type", ()=>output.module ? "module" : "var"), defaults_F(output, "chunkFormat", ()=>{
|
9601
9449
|
if (tp) {
|
9602
9450
|
let helpMessage = isAffectedByBrowserslist ? "Make sure that your 'browserslist' includes only platforms that support these features or select an appropriate 'target' to allow selecting a chunk format by default. Alternatively specify the 'output.chunkFormat' directly." : "Select an appropriate 'target' to allow selecting one by default, or specify the 'output.chunkFormat' directly.";
|
9603
9451
|
if (output.module) {
|
@@ -9657,7 +9505,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9657
9505
|
if (tp.globalThis) return "globalThis";
|
9658
9506
|
}
|
9659
9507
|
return "self";
|
9660
|
-
}), D(output, "importFunctionName", "import"), D(output, "importMetaName", "import.meta"), defaults_F(output, "clean", ()=>!!output.clean), D(output, "
|
9508
|
+
}), D(output, "importFunctionName", "import"), D(output, "importMetaName", "import.meta"), defaults_F(output, "clean", ()=>!!output.clean), D(output, "workerPublicPath", ""), D(output, "sourceMapFilename", "[file].map[query]"), D(output, "charset", !futureDefaults), D(output, "chunkLoadTimeout", 120000);
|
9661
9509
|
let { trustedTypes } = output;
|
9662
9510
|
trustedTypes && (defaults_F(trustedTypes, "policyName", ()=>output.uniqueName.replace(/[^a-zA-Z0-9\-#=_/@.%]+/g, "_") || "webpack"), D(trustedTypes, "onPolicyCreationFailure", "stop"));
|
9663
9511
|
let forEachEntry = (fn)=>{
|
@@ -10339,7 +10187,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10339
10187
|
},
|
10340
10188
|
arm: "gnueabihf"
|
10341
10189
|
}
|
10342
|
-
}, BINDING_VERSION = __webpack_require__("@rspack/binding/package.json").version, CORE_VERSION = "1.4.
|
10190
|
+
}, BINDING_VERSION = __webpack_require__("@rspack/binding/package.json").version, CORE_VERSION = "1.4.3", getAddonPlatformArchAbi = ()=>{
|
10343
10191
|
let { platform, arch } = process, binding = "";
|
10344
10192
|
binding += platform;
|
10345
10193
|
let abi = NodePlatformArchToAbi[platform][arch];
|
@@ -10570,7 +10418,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10570
10418
|
}, function(queried) {
|
10571
10419
|
return function({ chunk, runtimeRequirements }) {
|
10572
10420
|
let set = __from_binding_runtime_globals(runtimeRequirements);
|
10573
|
-
return queried.call(
|
10421
|
+
return queried.call(chunk, set), {
|
10574
10422
|
runtimeRequirements: __to_binding_runtime_globals(set)
|
10575
10423
|
};
|
10576
10424
|
};
|
@@ -10578,8 +10426,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10578
10426
|
registerCompilationRuntimeRequirementInTreeTaps: createMapTap(binding_.RegisterJsTapKind.CompilationRuntimeRequirementInTree, function() {
|
10579
10427
|
return getCompiler().__internal__get_compilation().hooks.runtimeRequirementInTree;
|
10580
10428
|
}, function(queried) {
|
10581
|
-
return function({ chunk
|
10582
|
-
let set = __from_binding_runtime_globals(runtimeRequirements), all = __from_binding_runtime_globals(allRuntimeRequirements),
|
10429
|
+
return function({ chunk, allRuntimeRequirements, runtimeRequirements }) {
|
10430
|
+
let set = __from_binding_runtime_globals(runtimeRequirements), all = __from_binding_runtime_globals(allRuntimeRequirements), customRuntimeGlobals = new Set(), originalAdd = all.add.bind(all), add = function(r) {
|
10583
10431
|
return all.has(r) ? all : (isReservedRuntimeGlobal(r) || customRuntimeGlobals.add(r), originalAdd(r));
|
10584
10432
|
};
|
10585
10433
|
for (let r of (all.add = add.bind(add), set))queried.for(r).call(chunk, all);
|
@@ -10594,7 +10442,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10594
10442
|
}, function(queried) {
|
10595
10443
|
return function({ module, chunk }) {
|
10596
10444
|
let originSource = module.source?.source;
|
10597
|
-
queried.call(module,
|
10445
|
+
queried.call(module, chunk);
|
10598
10446
|
let newSource = module.source?.source;
|
10599
10447
|
if (newSource && newSource !== originSource) return module;
|
10600
10448
|
};
|
@@ -10625,7 +10473,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10625
10473
|
}, function(queried) {
|
10626
10474
|
return function({ entry, id, codegenResults, runtimeModules }) {
|
10627
10475
|
try {
|
10628
|
-
let
|
10476
|
+
let __nested_webpack_require_4786_4805__ = (id)=>{
|
10629
10477
|
let cached = moduleCache[id];
|
10630
10478
|
if (void 0 !== cached) {
|
10631
10479
|
if (cached.error) throw cached.error;
|
@@ -10639,7 +10487,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10639
10487
|
loaded: !1,
|
10640
10488
|
error: void 0
|
10641
10489
|
},
|
10642
|
-
require:
|
10490
|
+
require: __nested_webpack_require_4786_4805__
|
10643
10491
|
};
|
10644
10492
|
for (let handler of interceptModuleExecution)handler(execOptions);
|
10645
10493
|
let result = codegenResults.map[id]["build time"], moduleObject = execOptions.module;
|
@@ -10647,11 +10495,11 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10647
10495
|
codeGenerationResult: new CodeGenerationResult(result),
|
10648
10496
|
moduleObject
|
10649
10497
|
}, {
|
10650
|
-
__webpack_require__:
|
10498
|
+
__webpack_require__: __nested_webpack_require_4786_4805__
|
10651
10499
|
}), "Compilation.hooks.executeModule"), moduleObject.loaded = !0, moduleObject.exports;
|
10652
|
-
}, moduleCache =
|
10653
|
-
for (let runtimeModule of runtimeModules)
|
10654
|
-
let executeResult =
|
10500
|
+
}, moduleCache = __nested_webpack_require_4786_4805__[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {}, interceptModuleExecution = __nested_webpack_require_4786_4805__[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
|
10501
|
+
for (let runtimeModule of runtimeModules)__nested_webpack_require_4786_4805__(runtimeModule);
|
10502
|
+
let executeResult = __nested_webpack_require_4786_4805__(entry);
|
10655
10503
|
getCompiler().__internal__get_module_execution_results_map().set(id, executeResult);
|
10656
10504
|
} catch (e) {
|
10657
10505
|
throw getCompiler().__internal__get_module_execution_results_map().set(id, e), e;
|
@@ -10700,14 +10548,14 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10700
10548
|
let digestResult;
|
10701
10549
|
if (!getCompiler().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
|
10702
10550
|
let hash = createHash(getCompiler().options.output.hashFunction);
|
10703
|
-
return queried.call(
|
10551
|
+
return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler().options.output.hashDigest ? hash.digest(getCompiler().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
|
10704
10552
|
};
|
10705
10553
|
}),
|
10706
10554
|
registerCompilationChunkAssetTaps: createTap(binding_.RegisterJsTapKind.CompilationChunkAsset, function() {
|
10707
10555
|
return getCompiler().__internal__get_compilation().hooks.chunkAsset;
|
10708
10556
|
}, function(queried) {
|
10709
10557
|
return function({ chunk, filename }) {
|
10710
|
-
return queried.call(
|
10558
|
+
return queried.call(chunk, filename);
|
10711
10559
|
};
|
10712
10560
|
}),
|
10713
10561
|
registerCompilationProcessAssetsTaps: createTap(binding_.RegisterJsTapKind.CompilationProcessAssets, function() {
|
@@ -10944,7 +10792,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10944
10792
|
let digestResult;
|
10945
10793
|
if (!getCompiler().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
|
10946
10794
|
let hash = createHash(getCompiler().options.output.hashFunction);
|
10947
|
-
return queried.call(
|
10795
|
+
return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler().options.output.hashDigest ? hash.digest(getCompiler().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
|
10948
10796
|
};
|
10949
10797
|
})
|
10950
10798
|
}), createNormalModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap)=>({
|
@@ -11638,7 +11486,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
11638
11486
|
obj.children = this.stats.map((stat, idx)=>{
|
11639
11487
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
11640
11488
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
11641
|
-
}), childOptions.version && (obj.rspackVersion = "1.4.
|
11489
|
+
}), childOptions.version && (obj.rspackVersion = "1.4.3", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
11642
11490
|
let mapError = (j, obj)=>({
|
11643
11491
|
...obj,
|
11644
11492
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
@@ -12541,7 +12389,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
12541
12389
|
object.hash = context.getStatsCompilation(compilation).hash;
|
12542
12390
|
},
|
12543
12391
|
version: (object)=>{
|
12544
|
-
object.version = "5.75.0", object.rspackVersion = "1.4.
|
12392
|
+
object.version = "5.75.0", object.rspackVersion = "1.4.3";
|
12545
12393
|
},
|
12546
12394
|
env: (object, _compilation, _context, { _env })=>{
|
12547
12395
|
object.env = _env;
|
@@ -16021,7 +15869,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
16021
15869
|
let _options = JSON.stringify(options || {});
|
16022
15870
|
return binding_default().transform(source, _options);
|
16023
15871
|
}
|
16024
|
-
let exports_rspackVersion = "1.4.
|
15872
|
+
let exports_rspackVersion = "1.4.3", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
16025
15873
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
16026
15874
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
16027
15875
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
@@ -16122,8 +15970,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
16122
15970
|
...c.options.experiments.lazyCompilation
|
16123
15971
|
}, prefix = options.prefix || LAZY_COMPILATION_PREFIX;
|
16124
15972
|
options.prefix = `${prefix}__${i++}`;
|
16125
|
-
let activeModules = new Map(), filesByKey = new Map();
|
16126
|
-
middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, activeModules, filesByKey, options.prefix)), applyPlugin(c, options, activeModules, filesByKey);
|
15973
|
+
let activeModules = new Map(), filesByKey = new Map(), indexToModule = new Map(), moduleToIndex = new Map();
|
15974
|
+
middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, indexToModule, activeModules, filesByKey, options.prefix)), applyPlugin(c, moduleToIndex, indexToModule, options, activeModules, filesByKey);
|
16127
15975
|
}
|
16128
15976
|
let keys = [
|
16129
15977
|
...middlewareByCompiler.keys()
|
@@ -16136,10 +15984,10 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
16136
15984
|
};
|
16137
15985
|
}
|
16138
15986
|
if (!compiler.options.experiments.lazyCompilation) return noop;
|
16139
|
-
let activeModules = new Map(), filesByKey = new Map(), options = {
|
15987
|
+
let activeModules = new Map(), filesByKey = new Map(), indexToMap = new Map(), moduleToIndex = new Map(), options = {
|
16140
15988
|
...compiler.options.experiments.lazyCompilation
|
16141
15989
|
};
|
16142
|
-
return applyPlugin(compiler, options, activeModules, filesByKey), lazyCompilationMiddlewareInternal(compiler, activeModules, filesByKey, options.prefix || LAZY_COMPILATION_PREFIX);
|
15990
|
+
return applyPlugin(compiler, moduleToIndex, indexToMap, options, activeModules, filesByKey), lazyCompilationMiddlewareInternal(compiler, indexToMap, activeModules, filesByKey, options.prefix || LAZY_COMPILATION_PREFIX);
|
16143
15991
|
},
|
16144
15992
|
swc: {
|
16145
15993
|
minify: minify,
|
@@ -16153,7 +16001,11 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
16153
16001
|
return binding_default().transformSync(source, _options);
|
16154
16002
|
}
|
16155
16003
|
},
|
16156
|
-
CssChunkingPlugin: CssChunkingPlugin
|
16004
|
+
CssChunkingPlugin: CssChunkingPlugin,
|
16005
|
+
createNativePlugin: function(name, resolve, affectedHooks) {
|
16006
|
+
if (INTERNAL_PLUGIN_NAMES.includes(name)) throw Error(`Cannot register native plugin with name '${name}', it conflicts with internal plugin names.`);
|
16007
|
+
return base_create(name, resolve, affectedHooks);
|
16008
|
+
}
|
16157
16009
|
};
|
16158
16010
|
function createCompiler(userOptions) {
|
16159
16011
|
let options = getNormalizedRspackOptions(userOptions);
|