@rspack/core 1.4.6 → 1.4.7-alpha.1
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/@swc/types/index.d.ts +4 -5
- package/compiled/@swc/types/package.json +1 -1
- package/dist/cssExtractLoader.js +53 -55
- package/dist/index.js +1530 -1624
- package/dist/worker.js +19 -16
- package/package.json +11 -11
package/dist/index.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __webpack_modules__ = {
|
3
|
-
"../../node_modules/.pnpm/enhanced-resolve@5.18.
|
4
|
-
let nextTick = __webpack_require__("process")
|
3
|
+
"../../node_modules/.pnpm/enhanced-resolve@5.18.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
4
|
+
let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
|
5
5
|
let idx = path.length - 1;
|
6
6
|
for(; idx >= 0;){
|
7
|
-
let
|
8
|
-
if (47 ===
|
7
|
+
let char = path.charCodeAt(idx);
|
8
|
+
if (47 === char || 92 === char) break;
|
9
9
|
idx--;
|
10
10
|
}
|
11
11
|
return idx < 0 ? "" : path.slice(0, idx);
|
@@ -17,8 +17,8 @@ var __webpack_modules__ = {
|
|
17
17
|
}
|
18
18
|
for (let callback of callbacks)try {
|
19
19
|
callback(err, result);
|
20
|
-
} catch (
|
21
|
-
error || (error =
|
20
|
+
} catch (err) {
|
21
|
+
error || (error = err);
|
22
22
|
}
|
23
23
|
if (callbacks.length = 0, error) throw error;
|
24
24
|
};
|
@@ -182,13 +182,13 @@ var __webpack_modules__ = {
|
|
182
182
|
if (err) return callback(err);
|
183
183
|
if (!buffer || 0 === buffer.length) return callback(Error("No file content"));
|
184
184
|
try {
|
185
|
-
data = JSON.parse(buffer.toString("
|
186
|
-
} catch (
|
187
|
-
return callback(
|
185
|
+
data = JSON.parse(buffer.toString("utf8"));
|
186
|
+
} catch (err_) {
|
187
|
+
return callback(err_);
|
188
188
|
}
|
189
189
|
callback(null, data);
|
190
190
|
});
|
191
|
-
}), this.fileSystem.readJsonSync || this.readFileSync && ((path)=>JSON.parse(this.readFileSync(path).toString("
|
191
|
+
}), this.fileSystem.readJsonSync || this.readFileSync && ((path)=>JSON.parse(this.readFileSync(path).toString("utf8"))), this.fileSystem);
|
192
192
|
let readJson = this._readJsonBackend.provide;
|
193
193
|
this.readJson = readJson;
|
194
194
|
let readJsonSync = this._readJsonBackend.provideSync;
|
@@ -432,12 +432,12 @@ for(var __webpack_i__ in (()=>{
|
|
432
432
|
webworker: ()=>webworker
|
433
433
|
});
|
434
434
|
var binding_ = __webpack_require__("@rspack/binding"), binding_default = __webpack_require__.n(binding_);
|
435
|
-
let lite_tapable_namespaceObject = require("@rspack/lite-tapable"),
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
435
|
+
let lite_tapable_namespaceObject = require("@rspack/lite-tapable"), cutOffLoaderExecution = (stack)=>((stack, flag)=>{
|
436
|
+
let stacks = stack.split("\n");
|
437
|
+
for(let i = 0; i < stacks.length; i++)stacks[i].includes(flag) && (stacks.length = i);
|
438
|
+
return stacks.join("\n");
|
439
|
+
})(stack, "LOADER_EXECUTION"), cleanUp = (stack, name, message)=>{
|
440
|
+
cutOffLoaderExecution(stack);
|
441
441
|
return cutOffMessage(stack, name, message);
|
442
442
|
}, cutOffMessage = (stack, name, message)=>{
|
443
443
|
let nextLine = stack.indexOf("\n");
|
@@ -632,7 +632,7 @@ for(var __webpack_i__ in (()=>{
|
|
632
632
|
case "verbose":
|
633
633
|
return {
|
634
634
|
all: !0,
|
635
|
-
modulesSpace:
|
635
|
+
modulesSpace: 1 / 0
|
636
636
|
};
|
637
637
|
case "errors-only":
|
638
638
|
return {
|
@@ -826,76 +826,7 @@ for(var __webpack_i__ in (()=>{
|
|
826
826
|
return null != aValue ? null != bValue ? comparator(aValue, bValue) : -1 : +(null != bValue);
|
827
827
|
};
|
828
828
|
return compareSelectCache.set(getter, comparator, result), result;
|
829
|
-
}, compareNumbers = (a, b)=>typeof a != typeof b ? typeof a < typeof b ? -1 : 1 : a < b ? -1 : +(a > b)
|
830
|
-
let itemsWithGroups = new Set(), allGroups = new Map();
|
831
|
-
for (let item of items){
|
832
|
-
let groups = new Set();
|
833
|
-
for(let i = 0; i < groupConfigs.length; i++){
|
834
|
-
let groupConfig = groupConfigs[i], keys = groupConfig.getKeys(item);
|
835
|
-
if (keys) for (let name of keys){
|
836
|
-
let key = `${i}:${name}`, group = allGroups.get(key);
|
837
|
-
void 0 === group && allGroups.set(key, group = {
|
838
|
-
config: groupConfig,
|
839
|
-
name,
|
840
|
-
alreadyGrouped: !1,
|
841
|
-
items: void 0
|
842
|
-
}), groups.add(group);
|
843
|
-
}
|
844
|
-
}
|
845
|
-
itemsWithGroups.add({
|
846
|
-
item,
|
847
|
-
groups
|
848
|
-
});
|
849
|
-
}
|
850
|
-
let runGrouping = (itemsWithGroups)=>{
|
851
|
-
let totalSize = itemsWithGroups.size;
|
852
|
-
for (let entry of itemsWithGroups)for (let group of entry.groups){
|
853
|
-
if (group.alreadyGrouped) continue;
|
854
|
-
let items = group.items;
|
855
|
-
void 0 === items ? group.items = new Set([
|
856
|
-
entry
|
857
|
-
]) : items.add(entry);
|
858
|
-
}
|
859
|
-
let groupMap = new Map();
|
860
|
-
for (let group of allGroups.values())if (group.items) {
|
861
|
-
let items = group.items;
|
862
|
-
group.items = void 0, groupMap.set(group, {
|
863
|
-
items,
|
864
|
-
options: void 0,
|
865
|
-
used: !1
|
866
|
-
});
|
867
|
-
}
|
868
|
-
let results = [];
|
869
|
-
for(;;){
|
870
|
-
let bestGroup, bestGroupItems, bestGroupOptions, bestGroupSize = -1;
|
871
|
-
for (let [group, state] of groupMap){
|
872
|
-
let { items, used } = state, options = state.options;
|
873
|
-
if (void 0 === options) {
|
874
|
-
let groupConfig = group.config;
|
875
|
-
state.options = options = groupConfig.getOptions?.(group.name, Array.from(items, ({ item })=>item)) || !1;
|
876
|
-
}
|
877
|
-
let force = !1 !== options && options.force;
|
878
|
-
if (!force && (!1 !== bestGroupOptions && bestGroupOptions?.force || used || items.size <= 1 || totalSize - items.size <= 1)) continue;
|
879
|
-
let targetGroupCount = !1 !== options && options.targetGroupCount || 4, sizeValue = force ? items.size : Math.min(items.size, 2 * totalSize / targetGroupCount + itemsWithGroups.size - items.size);
|
880
|
-
(sizeValue > bestGroupSize || force && (!bestGroupOptions || !bestGroupOptions.force)) && (bestGroup = group, bestGroupSize = sizeValue, bestGroupItems = items, bestGroupOptions = options);
|
881
|
-
}
|
882
|
-
if (void 0 === bestGroup) break;
|
883
|
-
let items = new Set(bestGroupItems), options = bestGroupOptions, groupChildren = !options || !1 !== options.groupChildren;
|
884
|
-
for (let item of items)for (let group of (itemsWithGroups.delete(item), item.groups)){
|
885
|
-
let state = groupMap.get(group);
|
886
|
-
void 0 !== state && (state.items.delete(item), 0 === state.items.size ? groupMap.delete(group) : (state.options = void 0, groupChildren && (state.used = !0)));
|
887
|
-
}
|
888
|
-
groupMap.delete(bestGroup);
|
889
|
-
let key = bestGroup.name, groupConfig = bestGroup.config, allItems = Array.from(items, ({ item })=>item);
|
890
|
-
bestGroup.alreadyGrouped = !0;
|
891
|
-
let children = groupChildren ? runGrouping(items) : allItems;
|
892
|
-
bestGroup.alreadyGrouped = !1, results.push(groupConfig.createGroup(key, children, allItems));
|
893
|
-
}
|
894
|
-
for (let { item } of itemsWithGroups)results.push(item);
|
895
|
-
return results;
|
896
|
-
};
|
897
|
-
return runGrouping(itemsWithGroups);
|
898
|
-
};
|
829
|
+
}, compareNumbers = (a, b)=>typeof a != typeof b ? typeof a < typeof b ? -1 : 1 : a < b ? -1 : +(a > b);
|
899
830
|
class StatsFactory {
|
900
831
|
hooks;
|
901
832
|
_caches;
|
@@ -1018,7 +949,76 @@ for(var __webpack_i__ in (()=>{
|
|
1018
949
|
}), comparators2 = [];
|
1019
950
|
this._forEachLevel(this.hooks.sortResults, this._caches.sortResults, type, (h)=>h.call(comparators2, context)), comparators2.length > 0 && resultItems.sort(concatComparators(...comparators2));
|
1020
951
|
let groupConfigs = [];
|
1021
|
-
this._forEachLevel(this.hooks.groupResults, this._caches.groupResults, type, (h)=>h.call(groupConfigs, context)), groupConfigs.length > 0 && (resultItems =
|
952
|
+
this._forEachLevel(this.hooks.groupResults, this._caches.groupResults, type, (h)=>h.call(groupConfigs, context)), groupConfigs.length > 0 && (resultItems = ((items, groupConfigs)=>{
|
953
|
+
let itemsWithGroups = new Set(), allGroups = new Map();
|
954
|
+
for (let item of items){
|
955
|
+
let groups = new Set();
|
956
|
+
for(let i = 0; i < groupConfigs.length; i++){
|
957
|
+
let groupConfig = groupConfigs[i], keys = groupConfig.getKeys(item);
|
958
|
+
if (keys) for (let name of keys){
|
959
|
+
let key = `${i}:${name}`, group = allGroups.get(key);
|
960
|
+
void 0 === group && allGroups.set(key, group = {
|
961
|
+
config: groupConfig,
|
962
|
+
name,
|
963
|
+
alreadyGrouped: !1,
|
964
|
+
items: void 0
|
965
|
+
}), groups.add(group);
|
966
|
+
}
|
967
|
+
}
|
968
|
+
itemsWithGroups.add({
|
969
|
+
item,
|
970
|
+
groups
|
971
|
+
});
|
972
|
+
}
|
973
|
+
let runGrouping = (itemsWithGroups)=>{
|
974
|
+
let totalSize = itemsWithGroups.size;
|
975
|
+
for (let entry of itemsWithGroups)for (let group of entry.groups){
|
976
|
+
if (group.alreadyGrouped) continue;
|
977
|
+
let items = group.items;
|
978
|
+
void 0 === items ? group.items = new Set([
|
979
|
+
entry
|
980
|
+
]) : items.add(entry);
|
981
|
+
}
|
982
|
+
let groupMap = new Map();
|
983
|
+
for (let group of allGroups.values())if (group.items) {
|
984
|
+
let items = group.items;
|
985
|
+
group.items = void 0, groupMap.set(group, {
|
986
|
+
items,
|
987
|
+
options: void 0,
|
988
|
+
used: !1
|
989
|
+
});
|
990
|
+
}
|
991
|
+
let results = [];
|
992
|
+
for(;;){
|
993
|
+
let bestGroup, bestGroupItems, bestGroupOptions, bestGroupSize = -1;
|
994
|
+
for (let [group, state] of groupMap){
|
995
|
+
let { items, used } = state, options = state.options;
|
996
|
+
if (void 0 === options) {
|
997
|
+
let groupConfig = group.config;
|
998
|
+
state.options = options = groupConfig.getOptions?.(group.name, Array.from(items, ({ item })=>item)) || !1;
|
999
|
+
}
|
1000
|
+
let force = !1 !== options && options.force;
|
1001
|
+
if (!force && (!1 !== bestGroupOptions && bestGroupOptions?.force || used || items.size <= 1 || totalSize - items.size <= 1)) continue;
|
1002
|
+
let targetGroupCount = !1 !== options && options.targetGroupCount || 4, sizeValue = force ? items.size : Math.min(items.size, 2 * totalSize / targetGroupCount + itemsWithGroups.size - items.size);
|
1003
|
+
(sizeValue > bestGroupSize || force && (!bestGroupOptions || !bestGroupOptions.force)) && (bestGroup = group, bestGroupSize = sizeValue, bestGroupItems = items, bestGroupOptions = options);
|
1004
|
+
}
|
1005
|
+
if (void 0 === bestGroup) break;
|
1006
|
+
let items = new Set(bestGroupItems), options = bestGroupOptions, groupChildren = !options || !1 !== options.groupChildren;
|
1007
|
+
for (let item of items)for (let group of (itemsWithGroups.delete(item), item.groups)){
|
1008
|
+
let state = groupMap.get(group);
|
1009
|
+
void 0 !== state && (state.items.delete(item), 0 === state.items.size ? groupMap.delete(group) : (state.options = void 0, groupChildren && (state.used = !0)));
|
1010
|
+
}
|
1011
|
+
groupMap.delete(bestGroup);
|
1012
|
+
let key = bestGroup.name, groupConfig = bestGroup.config, allItems = Array.from(items, ({ item })=>item);
|
1013
|
+
bestGroup.alreadyGrouped = !0;
|
1014
|
+
let children = groupChildren ? runGrouping(items) : allItems;
|
1015
|
+
bestGroup.alreadyGrouped = !1, results.push(groupConfig.createGroup(key, children, allItems));
|
1016
|
+
}
|
1017
|
+
for (let { item } of itemsWithGroups)results.push(item);
|
1018
|
+
return results;
|
1019
|
+
};
|
1020
|
+
return runGrouping(itemsWithGroups);
|
1021
|
+
})(resultItems, groupConfigs));
|
1022
1022
|
let finalResultItems = this._forEachLevelFilter(this.hooks.filterResults, this._caches.filterResults, type, resultItems, (h, r, idx, i)=>h.call(r, context, idx, i), !1), result = this._forEachLevel(this.hooks.merge, this._caches.merge, type, (h)=>h.call(finalResultItems, context));
|
1023
1023
|
return void 0 === result && (result = finalResultItems), this._forEachLevelWaterfall(this.hooks.result, this._caches.result, type, result, (h, r)=>h.call(r, context));
|
1024
1024
|
}
|
@@ -1974,22 +1974,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
1974
1974
|
super(error.message), this.name = "HookWebpackError", this.hook = hook, this.error = error, this.hideStack = !0, this.details = `caused by plugins in ${hook}\n${error.stack}`, this.stack += `\n-- inner error --\n${error.stack}`;
|
1975
1975
|
}
|
1976
1976
|
}
|
1977
|
-
let
|
1977
|
+
let makeWebpackErrorCallback = (callback, hook)=>(err, result)=>{
|
1978
1978
|
if (err) return err instanceof WebpackError ? void callback(err) : void callback(new HookWebpackError(err, hook));
|
1979
1979
|
callback(null, result);
|
1980
|
-
}
|
1981
|
-
let r;
|
1982
|
-
try {
|
1983
|
-
r = fn();
|
1984
|
-
} catch (err) {
|
1985
|
-
if (err instanceof WebpackError) throw err;
|
1986
|
-
throw new HookWebpackError(err, hook);
|
1987
|
-
}
|
1988
|
-
return r;
|
1989
|
-
}, needCalls = (times, callback)=>{
|
1990
|
-
let leftTimes = times;
|
1991
|
-
return (err)=>0 == --leftTimes ? callback() : err && leftTimes > 0 ? (leftTimes = 0, callback()) : void 0;
|
1992
|
-
};
|
1980
|
+
};
|
1993
1981
|
class Cache {
|
1994
1982
|
static STAGE_DISK = 10;
|
1995
1983
|
static STAGE_MEMORY = -10;
|
@@ -2019,10 +2007,11 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2019
2007
|
get(identifier, etag, callback) {
|
2020
2008
|
let gotHandlers = [];
|
2021
2009
|
this.hooks.get.callAsync(identifier, etag, gotHandlers, (err, res)=>{
|
2022
|
-
|
2010
|
+
var error, hook, times, callback1;
|
2011
|
+
if (err) return void callback((hook = "Cache.hooks.get", (error = err) instanceof WebpackError ? error : new HookWebpackError(error, hook)));
|
2023
2012
|
let result = res;
|
2024
2013
|
if (null === result && (result = void 0), gotHandlers.length > 1) {
|
2025
|
-
let innerCallback =
|
2014
|
+
let leftTimes, innerCallback = (times = gotHandlers.length, callback1 = ()=>callback(null, result), leftTimes = times, (err)=>0 == --leftTimes ? callback1() : err && leftTimes > 0 ? (leftTimes = 0, callback1()) : void 0);
|
2026
2015
|
for (let gotHandler of gotHandlers)gotHandler(result, innerCallback);
|
2027
2016
|
} else 1 === gotHandlers.length ? gotHandlers[0](result, ()=>callback(null, result)) : callback(null, result);
|
2028
2017
|
});
|
@@ -2151,18 +2140,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2151
2140
|
return old.reset(), old;
|
2152
2141
|
}
|
2153
2142
|
return new WasmHash(new WebAssembly.Instance(wasmModule), instancesPool, chunkSize, digestSize);
|
2154
|
-
}, hash_md4 = ()=>{
|
2155
|
-
if (!createMd4) {
|
2156
|
-
let md4 = new WebAssembly.Module(Buffer.from("AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqLEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvSCgEZfyMBIQUjAiECIwMhAyMEIQQDQCAAIAFLBEAgASgCJCISIAEoAiAiEyABKAIcIgkgASgCGCIIIAEoAhQiByABKAIQIg4gASgCDCIGIAEoAggiDyABKAIEIhAgASgCACIRIAMgBHMgAnEgBHMgBWpqQQN3IgogAiADc3EgA3MgBGpqQQd3IgsgAiAKc3EgAnMgA2pqQQt3IgwgCiALc3EgCnMgAmpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IgogDCANc3EgDHMgC2pqQQd3IgsgCiANc3EgDXMgDGpqQQt3IgwgCiALc3EgCnMgDWpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IhQgDCANc3EgDHMgC2pqQQd3IRUgASgCLCILIAEoAigiCiAMIA0gDSAUcyAVcXNqakELdyIWIBQgFXNxIBRzIA1qakETdyEXIAEoAjQiGCABKAIwIhkgFSAWcyAXcSAVcyAUampBA3ciFCAWIBdzcSAWcyAVampBB3chFSABKAI8Ig0gASgCOCIMIBQgF3MgFXEgF3MgFmpqQQt3IhYgFCAVc3EgFHMgF2pqQRN3IRcgEyAOIBEgFCAVIBZyIBdxIBUgFnFyampBmfOJ1AVqQQN3IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEFdyIVIBQgF3JxIBQgF3FyIBZqakGZ84nUBWpBCXchFiAPIBggEiAWIAcgFSAQIBQgGSAUIBVyIBZxIBQgFXFyIBdqakGZ84nUBWpBDXciFCAVIBZycSAVIBZxcmpqQZnzidQFakEDdyIVIBQgFnJxIBQgFnFyampBmfOJ1AVqQQV3IhcgFCAVcnEgFCAVcXJqakGZ84nUBWpBCXciFiAVIBdycSAVIBdxciAUampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEDdyEVIBEgBiAVIAwgFCAKIBYgCCAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFyAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIWIBUgF3JxIBUgF3FyampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXJqakGZ84nUBWpBA3ciFSALIBYgCSAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFiAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIXIA0gFSAWciAXcSAVIBZxciAUampBmfOJ1AVqQQ13IhRzIBZzampBodfn9gZqQQN3IREgByAIIA4gFCARIBcgESAUc3MgFmogE2pBodfn9gZqQQl3IhNzcyAXampBodfn9gZqQQt3Ig4gDyARIBMgDiARIA4gE3NzIBRqIBlqQaHX5/YGakEPdyIRc3NqakGh1+f2BmpBA3ciDyAOIA8gEXNzIBNqIApqQaHX5/YGakEJdyIKcyARc2pqQaHX5/YGakELdyIIIBAgDyAKIAggDCAPIAggCnNzIBFqakGh1+f2BmpBD3ciDHNzampBodfn9gZqQQN3Ig4gEiAIIAwgDnNzIApqakGh1+f2BmpBCXciCHMgDHNqakGh1+f2BmpBC3chByAFIAYgCCAHIBggDiAHIAhzcyAMampBodfn9gZqQQ93IgpzcyAOampBodfn9gZqQQN3IgZqIQUgDSAGIAkgByAGIAsgByAGIApzcyAIampBodfn9gZqQQl3IgdzIApzampBodfn9gZqQQt3IgYgB3NzIApqakGh1+f2BmpBD3cgAmohAiADIAZqIQMgBCAHaiEEIAFBQGshAQwBCwsgBSQBIAIkAiADJAMgBCQECw0AIAAQASAAIwBqJAAL/wQCA38BfiAAIwBqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", "base64"));
|
2157
|
-
createMd4 = wasm_hash.bind(null, md4, [], 64, 32);
|
2158
|
-
}
|
2159
|
-
return createMd4();
|
2160
|
-
}, hash_xxhash64 = ()=>{
|
2161
|
-
if (!createXxhash64) {
|
2162
|
-
let xxhash64 = new WebAssembly.Module(Buffer.from("AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", "base64"));
|
2163
|
-
createXxhash64 = wasm_hash.bind(null, xxhash64, [], 32, 16);
|
2164
|
-
}
|
2165
|
-
return createXxhash64();
|
2166
2143
|
}, digestCaches = {};
|
2167
2144
|
class BulkUpdateDecorator extends Hash {
|
2168
2145
|
hash;
|
@@ -2221,9 +2198,21 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2221
2198
|
case "debug":
|
2222
2199
|
return new DebugHash();
|
2223
2200
|
case "xxhash64":
|
2224
|
-
return new WasmHashAdapter(
|
2201
|
+
return new WasmHashAdapter((()=>{
|
2202
|
+
if (!createXxhash64) {
|
2203
|
+
let xxhash64 = new WebAssembly.Module(Buffer.from("AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", "base64"));
|
2204
|
+
createXxhash64 = wasm_hash.bind(null, xxhash64, [], 32, 16);
|
2205
|
+
}
|
2206
|
+
return createXxhash64();
|
2207
|
+
})());
|
2225
2208
|
case "md4":
|
2226
|
-
return new WasmHashAdapter(
|
2209
|
+
return new WasmHashAdapter((()=>{
|
2210
|
+
if (!createMd4) {
|
2211
|
+
let md4 = new WebAssembly.Module(Buffer.from("AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqLEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvSCgEZfyMBIQUjAiECIwMhAyMEIQQDQCAAIAFLBEAgASgCJCISIAEoAiAiEyABKAIcIgkgASgCGCIIIAEoAhQiByABKAIQIg4gASgCDCIGIAEoAggiDyABKAIEIhAgASgCACIRIAMgBHMgAnEgBHMgBWpqQQN3IgogAiADc3EgA3MgBGpqQQd3IgsgAiAKc3EgAnMgA2pqQQt3IgwgCiALc3EgCnMgAmpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IgogDCANc3EgDHMgC2pqQQd3IgsgCiANc3EgDXMgDGpqQQt3IgwgCiALc3EgCnMgDWpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IhQgDCANc3EgDHMgC2pqQQd3IRUgASgCLCILIAEoAigiCiAMIA0gDSAUcyAVcXNqakELdyIWIBQgFXNxIBRzIA1qakETdyEXIAEoAjQiGCABKAIwIhkgFSAWcyAXcSAVcyAUampBA3ciFCAWIBdzcSAWcyAVampBB3chFSABKAI8Ig0gASgCOCIMIBQgF3MgFXEgF3MgFmpqQQt3IhYgFCAVc3EgFHMgF2pqQRN3IRcgEyAOIBEgFCAVIBZyIBdxIBUgFnFyampBmfOJ1AVqQQN3IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEFdyIVIBQgF3JxIBQgF3FyIBZqakGZ84nUBWpBCXchFiAPIBggEiAWIAcgFSAQIBQgGSAUIBVyIBZxIBQgFXFyIBdqakGZ84nUBWpBDXciFCAVIBZycSAVIBZxcmpqQZnzidQFakEDdyIVIBQgFnJxIBQgFnFyampBmfOJ1AVqQQV3IhcgFCAVcnEgFCAVcXJqakGZ84nUBWpBCXciFiAVIBdycSAVIBdxciAUampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEDdyEVIBEgBiAVIAwgFCAKIBYgCCAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFyAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIWIBUgF3JxIBUgF3FyampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXJqakGZ84nUBWpBA3ciFSALIBYgCSAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFiAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIXIA0gFSAWciAXcSAVIBZxciAUampBmfOJ1AVqQQ13IhRzIBZzampBodfn9gZqQQN3IREgByAIIA4gFCARIBcgESAUc3MgFmogE2pBodfn9gZqQQl3IhNzcyAXampBodfn9gZqQQt3Ig4gDyARIBMgDiARIA4gE3NzIBRqIBlqQaHX5/YGakEPdyIRc3NqakGh1+f2BmpBA3ciDyAOIA8gEXNzIBNqIApqQaHX5/YGakEJdyIKcyARc2pqQaHX5/YGakELdyIIIBAgDyAKIAggDCAPIAggCnNzIBFqakGh1+f2BmpBD3ciDHNzampBodfn9gZqQQN3Ig4gEiAIIAwgDnNzIApqakGh1+f2BmpBCXciCHMgDHNqakGh1+f2BmpBC3chByAFIAYgCCAHIBggDiAHIAhzcyAMampBodfn9gZqQQ93IgpzcyAOampBodfn9gZqQQN3IgZqIQUgDSAGIAkgByAGIAsgByAGIApzcyAIampBodfn9gZqQQl3IgdzIApzampBodfn9gZqQQt3IgYgB3NzIApqakGh1+f2BmpBD3cgAmohAiADIAZqIQMgBCAHaiEEIAFBQGshAQwBCwsgBSQBIAIkAiADJAMgBCQECw0AIAAQASAAIwBqJAAL/wQCA38BfiAAIwBqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", "base64"));
|
2212
|
+
createMd4 = wasm_hash.bind(null, md4, [], 64, 32);
|
2213
|
+
}
|
2214
|
+
return createMd4();
|
2215
|
+
})());
|
2227
2216
|
case "native-md4":
|
2228
2217
|
return new BulkUpdateDecorator(()=>external_node_crypto_default().createHash("md4"), "md4");
|
2229
2218
|
default:
|
@@ -2245,22 +2234,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2245
2234
|
return this._hash;
|
2246
2235
|
}
|
2247
2236
|
}
|
2248
|
-
let mapStrings = new Map(), mapObjects = new WeakMap()
|
2249
|
-
let innerMap;
|
2250
|
-
if ("string" == typeof hashFunction) {
|
2251
|
-
if (void 0 === (innerMap = mapStrings.get(hashFunction))) {
|
2252
|
-
let newHash = new LazyHashedEtag(obj, hashFunction);
|
2253
|
-
return (innerMap = new WeakMap()).set(obj, newHash), mapStrings.set(hashFunction, innerMap), newHash;
|
2254
|
-
}
|
2255
|
-
} else if (void 0 === (innerMap = mapObjects.get(hashFunction))) {
|
2256
|
-
let newHash = new LazyHashedEtag(obj, hashFunction);
|
2257
|
-
return (innerMap = new WeakMap()).set(obj, newHash), mapObjects.set(hashFunction, innerMap), newHash;
|
2258
|
-
}
|
2259
|
-
let hash = innerMap.get(obj);
|
2260
|
-
if (void 0 !== hash) return hash;
|
2261
|
-
let newHash = new LazyHashedEtag(obj, hashFunction);
|
2262
|
-
return innerMap.set(obj, newHash), newHash;
|
2263
|
-
};
|
2237
|
+
let mapStrings = new Map(), mapObjects = new WeakMap();
|
2264
2238
|
class MergedEtag {
|
2265
2239
|
a;
|
2266
2240
|
b;
|
@@ -2271,31 +2245,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2271
2245
|
return `${this.a.toString()}|${this.b.toString()}`;
|
2272
2246
|
}
|
2273
2247
|
}
|
2274
|
-
let dualObjectMap = new WeakMap(), objectStringMap = new WeakMap()
|
2275
|
-
let a = first, b = second;
|
2276
|
-
if ("string" == typeof a) {
|
2277
|
-
if ("string" == typeof b) return `${a}|${b}`;
|
2278
|
-
let temp = b;
|
2279
|
-
b = a, a = temp;
|
2280
|
-
} else if ("string" != typeof b) {
|
2281
|
-
let map = dualObjectMap.get(a);
|
2282
|
-
void 0 === map && dualObjectMap.set(a, map = new WeakMap());
|
2283
|
-
let mergedEtag = map.get(b);
|
2284
|
-
if (void 0 === mergedEtag) {
|
2285
|
-
let newMergedEtag = new MergedEtag(a, b);
|
2286
|
-
return map.set(b, newMergedEtag), newMergedEtag;
|
2287
|
-
}
|
2288
|
-
return mergedEtag;
|
2289
|
-
}
|
2290
|
-
let map = objectStringMap.get(a);
|
2291
|
-
void 0 === map && objectStringMap.set(a, map = new Map());
|
2292
|
-
let mergedEtag = map.get(b);
|
2293
|
-
if (void 0 === mergedEtag) {
|
2294
|
-
let newMergedEtag = new MergedEtag(a, b);
|
2295
|
-
return map.set(b, newMergedEtag), newMergedEtag;
|
2296
|
-
}
|
2297
|
-
return mergedEtag;
|
2298
|
-
};
|
2248
|
+
let dualObjectMap = new WeakMap(), objectStringMap = new WeakMap();
|
2299
2249
|
class ItemCacheFacade {
|
2300
2250
|
_cache;
|
2301
2251
|
_name;
|
@@ -2353,10 +2303,49 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2353
2303
|
return new ItemCacheFacade(this._cache, `${this._name}|${identifier}`, etag);
|
2354
2304
|
}
|
2355
2305
|
getLazyHashedEtag(obj) {
|
2356
|
-
return
|
2306
|
+
return ((obj, hashFunction = "xxhash64")=>{
|
2307
|
+
let innerMap;
|
2308
|
+
if ("string" == typeof hashFunction) {
|
2309
|
+
if (void 0 === (innerMap = mapStrings.get(hashFunction))) {
|
2310
|
+
let newHash = new LazyHashedEtag(obj, hashFunction);
|
2311
|
+
return (innerMap = new WeakMap()).set(obj, newHash), mapStrings.set(hashFunction, innerMap), newHash;
|
2312
|
+
}
|
2313
|
+
} else if (void 0 === (innerMap = mapObjects.get(hashFunction))) {
|
2314
|
+
let newHash = new LazyHashedEtag(obj, hashFunction);
|
2315
|
+
return (innerMap = new WeakMap()).set(obj, newHash), mapObjects.set(hashFunction, innerMap), newHash;
|
2316
|
+
}
|
2317
|
+
let hash = innerMap.get(obj);
|
2318
|
+
if (void 0 !== hash) return hash;
|
2319
|
+
let newHash = new LazyHashedEtag(obj, hashFunction);
|
2320
|
+
return innerMap.set(obj, newHash), newHash;
|
2321
|
+
})(obj, this._hashFunction);
|
2357
2322
|
}
|
2358
2323
|
mergeEtags(a, b) {
|
2359
|
-
return
|
2324
|
+
return ((first, second)=>{
|
2325
|
+
let a = first, b = second;
|
2326
|
+
if ("string" == typeof a) {
|
2327
|
+
if ("string" == typeof b) return `${a}|${b}`;
|
2328
|
+
let temp = b;
|
2329
|
+
b = a, a = temp;
|
2330
|
+
} else if ("string" != typeof b) {
|
2331
|
+
let map = dualObjectMap.get(a);
|
2332
|
+
void 0 === map && dualObjectMap.set(a, map = new WeakMap());
|
2333
|
+
let mergedEtag = map.get(b);
|
2334
|
+
if (void 0 === mergedEtag) {
|
2335
|
+
let newMergedEtag = new MergedEtag(a, b);
|
2336
|
+
return map.set(b, newMergedEtag), newMergedEtag;
|
2337
|
+
}
|
2338
|
+
return mergedEtag;
|
2339
|
+
}
|
2340
|
+
let map = objectStringMap.get(a);
|
2341
|
+
void 0 === map && objectStringMap.set(a, map = new Map());
|
2342
|
+
let mergedEtag = map.get(b);
|
2343
|
+
if (void 0 === mergedEtag) {
|
2344
|
+
let newMergedEtag = new MergedEtag(a, b);
|
2345
|
+
return map.set(b, newMergedEtag), newMergedEtag;
|
2346
|
+
}
|
2347
|
+
return mergedEtag;
|
2348
|
+
})(a, b);
|
2360
2349
|
}
|
2361
2350
|
get(identifier, etag, callback) {
|
2362
2351
|
this._cache.get(`${this._name}|${identifier}`, etag, callback);
|
@@ -2416,16 +2405,16 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2416
2405
|
if (external_node_path_default().posix.isAbsolute(rootPath)) return external_node_path_default().posix.join(rootPath, filename);
|
2417
2406
|
if (external_node_path_default().win32.isAbsolute(rootPath)) return external_node_path_default().win32.join(rootPath, filename);
|
2418
2407
|
throw Error(`${rootPath} is neither a posix nor a windows path, and there is no 'join' method defined in the file system`);
|
2419
|
-
}, dirname = (fs, absPath)=>{
|
2420
|
-
if (fs?.dirname) return fs.dirname(absPath);
|
2421
|
-
if (external_node_path_default().posix.isAbsolute(absPath)) return external_node_path_default().posix.dirname(absPath);
|
2422
|
-
if (external_node_path_default().win32.isAbsolute(absPath)) return external_node_path_default().win32.dirname(absPath);
|
2423
|
-
throw Error(`${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system`);
|
2424
2408
|
}, mkdirp = (fs, p, callback)=>{
|
2425
2409
|
fs.mkdir(p, (err)=>{
|
2426
2410
|
if (err) {
|
2427
2411
|
if ("ENOENT" === err.code) {
|
2428
|
-
let dir =
|
2412
|
+
let dir = ((fs, absPath)=>{
|
2413
|
+
if (fs?.dirname) return fs.dirname(absPath);
|
2414
|
+
if (external_node_path_default().posix.isAbsolute(absPath)) return external_node_path_default().posix.dirname(absPath);
|
2415
|
+
if (external_node_path_default().win32.isAbsolute(absPath)) return external_node_path_default().win32.dirname(absPath);
|
2416
|
+
throw Error(`${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system`);
|
2417
|
+
})(fs, p);
|
2429
2418
|
return dir === p ? void callback(err) : void mkdirp(fs, dir, (err)=>{
|
2430
2419
|
if (err) return void callback(err);
|
2431
2420
|
fs.mkdir(p, (err)=>{
|
@@ -2678,13 +2667,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2678
2667
|
if ("string" == typeof bufLike) return Buffer.from(bufLike);
|
2679
2668
|
if (bufLike instanceof Uint8Array) return Buffer.from(bufLike.buffer);
|
2680
2669
|
throw Error("Buffer, Uint8Array or string expected");
|
2681
|
-
}, toObject = (input)=>{
|
2682
|
-
let s;
|
2683
|
-
if (Buffer.isBuffer(input)) s = input.toString("utf8");
|
2684
|
-
else if (input && "object" == typeof input) return input;
|
2685
|
-
else if ("string" == typeof input) s = input;
|
2686
|
-
else throw Error("Buffer or string or object expected");
|
2687
|
-
return JSON.parse(s);
|
2688
2670
|
};
|
2689
2671
|
function serializeObject(map) {
|
2690
2672
|
if (!isNil(map)) return "string" == typeof map ? map ? toBuffer(map) : void 0 : toBuffer(JSON.stringify(map));
|
@@ -2706,7 +2688,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2706
2688
|
return resource = external_node_path_default().win32.relative(context, resource), WINDOWS_ABS_PATH_REGEXP.test(resource) || (resource = relativePathToRequest(resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, "/"))), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
|
2707
2689
|
}
|
2708
2690
|
return maybeAbsolutePath;
|
2709
|
-
},
|
2691
|
+
}, makeCacheable = (realFn)=>{
|
2710
2692
|
let cache = new WeakMap(), getCache = (associatedObjectForCache)=>{
|
2711
2693
|
let entry = cache.get(associatedObjectForCache);
|
2712
2694
|
if (void 0 !== entry) return entry;
|
@@ -2760,7 +2742,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2760
2742
|
return innerSubCache?.set(identifier, result), result;
|
2761
2743
|
};
|
2762
2744
|
}, cachedFn;
|
2763
|
-
}, makePathsRelative = makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join("")), contextify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>absoluteToRequest(context, r)).join("!")), absolutify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>
|
2745
|
+
}, makePathsRelative = makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join("")), contextify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>absoluteToRequest(context, r)).join("!")), absolutify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>{
|
2746
|
+
var context1, relativePath;
|
2747
|
+
return context1 = context, (relativePath = r).startsWith("./") || relativePath.startsWith("../") ? external_node_path_default().join(context1, relativePath) : relativePath;
|
2748
|
+
}).join("!")), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/, parseResource = makeCacheable((str)=>{
|
2764
2749
|
let match = PATH_QUERY_FRAGMENT_REGEXP.exec(str);
|
2765
2750
|
return {
|
2766
2751
|
resource: str,
|
@@ -2915,9 +2900,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2915
2900
|
"contextDependencies",
|
2916
2901
|
"missingDependencies",
|
2917
2902
|
"buildDependencies"
|
2918
|
-
])
|
2919
|
-
Object.keys(buildInfo).some((key)=>!knownBuildInfoFields.has(key)) && buildInfo[binding_.COMMIT_CUSTOM_FIELDS_SYMBOL]();
|
2920
|
-
};
|
2903
|
+
]);
|
2921
2904
|
Object.defineProperty(binding_.NormalModule.prototype, "identifier", {
|
2922
2905
|
enumerable: !0,
|
2923
2906
|
configurable: !0,
|
@@ -2938,9 +2921,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2938
2921
|
return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
|
2939
2922
|
}
|
2940
2923
|
});
|
2941
|
-
let
|
2942
|
-
_fakeHook: !0
|
2943
|
-
})), deprecateAllProperties = (obj, message, code)=>{
|
2924
|
+
let deprecateAllProperties = (obj, message, code)=>{
|
2944
2925
|
let newObj = {}, descriptors = Object.getOwnPropertyDescriptors(obj);
|
2945
2926
|
for (let name of Object.keys(descriptors)){
|
2946
2927
|
let descriptor = descriptors[name];
|
@@ -2977,12 +2958,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2977
2958
|
"module"
|
2978
2959
|
]),
|
2979
2960
|
readResourceForScheme: new lite_tapable_namespaceObject.HookMap((scheme)=>{
|
2980
|
-
let hook = hooks.readResource.for(scheme);
|
2981
|
-
return
|
2961
|
+
let fakeHook, message, code, hook = hooks.readResource.for(scheme);
|
2962
|
+
return fakeHook = {
|
2982
2963
|
tap: (options, fn)=>hook.tap(options, (loaderContext)=>fn(loaderContext.resource)),
|
2983
2964
|
tapAsync: (options, fn)=>hook.tapAsync(options, (loaderContext, callback)=>fn(loaderContext.resource, callback)),
|
2984
2965
|
tapPromise: (options, fn)=>hook.tapPromise(options, (loaderContext)=>fn(loaderContext.resource))
|
2985
|
-
})
|
2966
|
+
}, Object.freeze(Object.assign(message && code ? deprecateAllProperties(fakeHook, message, code) : fakeHook, {
|
2967
|
+
_fakeHook: !0
|
2968
|
+
}));
|
2986
2969
|
}),
|
2987
2970
|
readResource: new lite_tapable_namespaceObject.HookMap(()=>new lite_tapable_namespaceObject.AsyncSeriesBailHook([
|
2988
2971
|
"loaderContext"
|
@@ -3020,55 +3003,53 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3020
3003
|
}
|
3021
3004
|
static async cleanupJavaScriptTrace() {
|
3022
3005
|
if ("uninitialized" === this.state) throw Error("JavaScriptTracer is not initialized, please call initJavaScriptTrace first");
|
3023
|
-
|
3024
|
-
let profileHandler = (err, param)=>{
|
3025
|
-
let cpu_profile;
|
3026
|
-
if (err ? console.error("Error stopping profiler:", err) : cpu_profile = param.profile, cpu_profile) {
|
3027
|
-
let uuid = this.uuid();
|
3028
|
-
this.pushEvent({
|
3029
|
-
name: "Profile",
|
3030
|
-
ph: "P",
|
3031
|
-
trackName: "JavaScript CPU Profiler",
|
3032
|
-
processName: "JavaScript CPU",
|
3033
|
-
uuid,
|
3034
|
-
...this.getCommonEv(),
|
3035
|
-
categories: [
|
3036
|
-
"disabled-by-default-v8.cpu_profiler"
|
3037
|
-
],
|
3038
|
-
args: {
|
3039
|
-
data: {
|
3040
|
-
startTime: 0
|
3041
|
-
}
|
3042
|
-
}
|
3043
|
-
}), this.pushEvent({
|
3044
|
-
name: "ProfileChunk",
|
3045
|
-
ph: "P",
|
3046
|
-
trackName: "JavaScript CPU Profiler",
|
3047
|
-
processName: "JavaScript CPU",
|
3048
|
-
...this.getCommonEv(),
|
3049
|
-
categories: [
|
3050
|
-
"disabled-by-default-v8.cpu_profiler"
|
3051
|
-
],
|
3052
|
-
uuid,
|
3053
|
-
args: {
|
3054
|
-
data: {
|
3055
|
-
cpuProfile: cpu_profile,
|
3056
|
-
timeDeltas: cpu_profile.timeDeltas
|
3057
|
-
}
|
3058
|
-
}
|
3059
|
-
});
|
3060
|
-
}
|
3061
|
-
};
|
3062
|
-
await new Promise((resolve, reject)=>{
|
3006
|
+
this.layer && "off" !== this.state && (await new Promise((resolve, reject)=>{
|
3063
3007
|
this.session.post("Profiler.stop", (err, params)=>{
|
3064
3008
|
if (err) reject(err);
|
3065
3009
|
else try {
|
3066
|
-
|
3010
|
+
let cpu_profile;
|
3011
|
+
var err1 = err, param = params;
|
3012
|
+
if (err1 ? console.error("Error stopping profiler:", err1) : cpu_profile = param.profile, cpu_profile) {
|
3013
|
+
let uuid = this.uuid();
|
3014
|
+
this.pushEvent({
|
3015
|
+
name: "Profile",
|
3016
|
+
ph: "P",
|
3017
|
+
trackName: "JavaScript CPU Profiler",
|
3018
|
+
processName: "JavaScript CPU",
|
3019
|
+
uuid,
|
3020
|
+
...this.getCommonEv(),
|
3021
|
+
categories: [
|
3022
|
+
"disabled-by-default-v8.cpu_profiler"
|
3023
|
+
],
|
3024
|
+
args: {
|
3025
|
+
data: {
|
3026
|
+
startTime: 0
|
3027
|
+
}
|
3028
|
+
}
|
3029
|
+
}), this.pushEvent({
|
3030
|
+
name: "ProfileChunk",
|
3031
|
+
ph: "P",
|
3032
|
+
trackName: "JavaScript CPU Profiler",
|
3033
|
+
processName: "JavaScript CPU",
|
3034
|
+
...this.getCommonEv(),
|
3035
|
+
categories: [
|
3036
|
+
"disabled-by-default-v8.cpu_profiler"
|
3037
|
+
],
|
3038
|
+
uuid,
|
3039
|
+
args: {
|
3040
|
+
data: {
|
3041
|
+
cpuProfile: cpu_profile,
|
3042
|
+
timeDeltas: cpu_profile.timeDeltas
|
3043
|
+
}
|
3044
|
+
}
|
3045
|
+
});
|
3046
|
+
}
|
3047
|
+
resolve();
|
3067
3048
|
} catch (err) {
|
3068
3049
|
reject(err);
|
3069
3050
|
}
|
3070
3051
|
});
|
3071
|
-
}), this.state = "off";
|
3052
|
+
}), this.state = "off");
|
3072
3053
|
}
|
3073
3054
|
static getTs() {
|
3074
3055
|
return process.hrtime.bigint() - this.startTime;
|
@@ -3182,7 +3163,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3182
3163
|
error: serializeError(e)
|
3183
3164
|
});
|
3184
3165
|
}
|
3185
|
-
Atomics.add(sharedBufferView, 0, 1), Atomics.notify(sharedBufferView, 0,
|
3166
|
+
Atomics.add(sharedBufferView, 0, 1), Atomics.notify(sharedBufferView, 0, 1 / 0);
|
3186
3167
|
}), mainSyncPort.on("messageerror", handleError);
|
3187
3168
|
var obj = task, loaderName1 = loaderName;
|
3188
3169
|
let errors = [];
|
@@ -3356,7 +3337,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3356
3337
|
}
|
3357
3338
|
class JsSourceMap {
|
3358
3339
|
static __from_binding(map) {
|
3359
|
-
return isNil(map) ? void 0 :
|
3340
|
+
return isNil(map) ? void 0 : ((input)=>{
|
3341
|
+
let s;
|
3342
|
+
if (Buffer.isBuffer(input)) s = input.toString("utf8");
|
3343
|
+
else if (input && "object" == typeof input) return input;
|
3344
|
+
else if ("string" == typeof input) s = input;
|
3345
|
+
else throw Error("Buffer or string or object expected");
|
3346
|
+
return JSON.parse(s);
|
3347
|
+
})(map);
|
3360
3348
|
}
|
3361
3349
|
static __to_binding(map) {
|
3362
3350
|
return serializeObject(map);
|
@@ -3366,6 +3354,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3366
3354
|
return loaderContext.loaders?.length && index < loaderContext.loaders.length && index >= 0 && loaderContext.loaders[index] ? loaderContext.loaders[index] : null;
|
3367
3355
|
}
|
3368
3356
|
async function runLoaders(compiler, context) {
|
3357
|
+
var buildInfo;
|
3369
3358
|
let loaderState = context.loaderState, pitch = loaderState === binding_.JsLoaderState.Pitching, { resource } = context, uuid = JavaScriptTracer.uuid();
|
3370
3359
|
JavaScriptTracer.startAsync({
|
3371
3360
|
name: "run_js_loaders",
|
@@ -3564,63 +3553,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3564
3553
|
enumerable: !0,
|
3565
3554
|
get: ()=>context.__internal__parseMeta
|
3566
3555
|
});
|
3567
|
-
let
|
3568
|
-
let normalModule = loaderContext._module instanceof binding_.NormalModule ? loaderContext._module : void 0, workerLoaderContext = {
|
3569
|
-
hot: loaderContext.hot,
|
3570
|
-
context: loaderContext.context,
|
3571
|
-
resourcePath: loaderContext.resourcePath,
|
3572
|
-
resourceQuery: loaderContext.resourceQuery,
|
3573
|
-
resourceFragment: loaderContext.resourceFragment,
|
3574
|
-
resource: loaderContext.resource,
|
3575
|
-
mode: loaderContext.mode,
|
3576
|
-
sourceMap: loaderContext.sourceMap,
|
3577
|
-
rootContext: loaderContext.context,
|
3578
|
-
loaderIndex: loaderContext.loaderIndex,
|
3579
|
-
loaders: loaderContext.loaders.map((item)=>{
|
3580
|
-
let options = item.options;
|
3581
|
-
return (!item.parallel || item.request.startsWith(BUILTIN_LOADER_PREFIX)) && (options = void 0), {
|
3582
|
-
...item,
|
3583
|
-
options,
|
3584
|
-
pitch: void 0,
|
3585
|
-
normal: void 0,
|
3586
|
-
normalExecuted: item.normalExecuted,
|
3587
|
-
pitchExecuted: item.pitchExecuted
|
3588
|
-
};
|
3589
|
-
}),
|
3590
|
-
__internal__workerInfo: {
|
3591
|
-
hashFunction: compiler._lastCompilation.outputOptions.hashFunction
|
3592
|
-
},
|
3593
|
-
_compiler: {
|
3594
|
-
options: {
|
3595
|
-
experiments: {
|
3596
|
-
css: compiler.options.experiments.css
|
3597
|
-
}
|
3598
|
-
}
|
3599
|
-
},
|
3600
|
-
_compilation: {
|
3601
|
-
options: {
|
3602
|
-
output: {
|
3603
|
-
environment: compiler._lastCompilation.outputOptions.environment
|
3604
|
-
}
|
3605
|
-
},
|
3606
|
-
outputOptions: {
|
3607
|
-
hashSalt: compiler._lastCompilation.outputOptions.hashSalt,
|
3608
|
-
hashFunction: compiler._lastCompilation.outputOptions.hashFunction,
|
3609
|
-
hashDigest: compiler._lastCompilation.outputOptions.hashDigest,
|
3610
|
-
hashDigestLength: compiler._lastCompilation.outputOptions.hashDigestLength
|
3611
|
-
}
|
3612
|
-
},
|
3613
|
-
_module: {
|
3614
|
-
type: loaderContext._module.type,
|
3615
|
-
identifier: loaderContext._module.identifier(),
|
3616
|
-
matchResource: normalModule?.matchResource,
|
3617
|
-
request: normalModule?.request,
|
3618
|
-
userRequest: normalModule?.userRequest,
|
3619
|
-
rawRequest: normalModule?.rawRequest
|
3620
|
-
}
|
3621
|
-
};
|
3622
|
-
return Object.assign(workerLoaderContext, compiler.options.loader), workerLoaderContext;
|
3623
|
-
}, enableParallelism = (currentLoaderObject)=>compiler.options.experiments.parallelLoader && currentLoaderObject?.parallel, isomorphoicRun = async (fn, args)=>{
|
3556
|
+
let enableParallelism = (currentLoaderObject)=>compiler.options.experiments.parallelLoader && currentLoaderObject?.parallel, isomorphoicRun = async (fn, args)=>{
|
3624
3557
|
let result, currentLoaderObject = getCurrentLoader(loaderContext), parallelism = enableParallelism(currentLoaderObject), pitch = loaderState === binding_.JsLoaderState.Pitching, loaderName = function(loaderPath, cwd = "") {
|
3625
3558
|
let res = loaderPath.replace(cwd, "");
|
3626
3559
|
if (!external_node_path_default().isAbsolute(res)) return res;
|
@@ -3642,7 +3575,63 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3642
3575
|
resource: resource
|
3643
3576
|
}
|
3644
3577
|
}), parallelism) result = await service_run(loaderName, {
|
3645
|
-
loaderContext:
|
3578
|
+
loaderContext: (()=>{
|
3579
|
+
let normalModule = loaderContext._module instanceof binding_.NormalModule ? loaderContext._module : void 0, workerLoaderContext = {
|
3580
|
+
hot: loaderContext.hot,
|
3581
|
+
context: loaderContext.context,
|
3582
|
+
resourcePath: loaderContext.resourcePath,
|
3583
|
+
resourceQuery: loaderContext.resourceQuery,
|
3584
|
+
resourceFragment: loaderContext.resourceFragment,
|
3585
|
+
resource: loaderContext.resource,
|
3586
|
+
mode: loaderContext.mode,
|
3587
|
+
sourceMap: loaderContext.sourceMap,
|
3588
|
+
rootContext: loaderContext.context,
|
3589
|
+
loaderIndex: loaderContext.loaderIndex,
|
3590
|
+
loaders: loaderContext.loaders.map((item)=>{
|
3591
|
+
let options = item.options;
|
3592
|
+
return (!item.parallel || item.request.startsWith(BUILTIN_LOADER_PREFIX)) && (options = void 0), {
|
3593
|
+
...item,
|
3594
|
+
options,
|
3595
|
+
pitch: void 0,
|
3596
|
+
normal: void 0,
|
3597
|
+
normalExecuted: item.normalExecuted,
|
3598
|
+
pitchExecuted: item.pitchExecuted
|
3599
|
+
};
|
3600
|
+
}),
|
3601
|
+
__internal__workerInfo: {
|
3602
|
+
hashFunction: compiler._lastCompilation.outputOptions.hashFunction
|
3603
|
+
},
|
3604
|
+
_compiler: {
|
3605
|
+
options: {
|
3606
|
+
experiments: {
|
3607
|
+
css: compiler.options.experiments.css
|
3608
|
+
}
|
3609
|
+
}
|
3610
|
+
},
|
3611
|
+
_compilation: {
|
3612
|
+
options: {
|
3613
|
+
output: {
|
3614
|
+
environment: compiler._lastCompilation.outputOptions.environment
|
3615
|
+
}
|
3616
|
+
},
|
3617
|
+
outputOptions: {
|
3618
|
+
hashSalt: compiler._lastCompilation.outputOptions.hashSalt,
|
3619
|
+
hashFunction: compiler._lastCompilation.outputOptions.hashFunction,
|
3620
|
+
hashDigest: compiler._lastCompilation.outputOptions.hashDigest,
|
3621
|
+
hashDigestLength: compiler._lastCompilation.outputOptions.hashDigestLength
|
3622
|
+
}
|
3623
|
+
},
|
3624
|
+
_module: {
|
3625
|
+
type: loaderContext._module.type,
|
3626
|
+
identifier: loaderContext._module.identifier(),
|
3627
|
+
matchResource: normalModule?.matchResource,
|
3628
|
+
request: normalModule?.request,
|
3629
|
+
userRequest: normalModule?.userRequest,
|
3630
|
+
rawRequest: normalModule?.rawRequest
|
3631
|
+
}
|
3632
|
+
};
|
3633
|
+
return Object.assign(workerLoaderContext, compiler.options.loader), workerLoaderContext;
|
3634
|
+
})(),
|
3646
3635
|
loaderState,
|
3647
3636
|
args
|
3648
3637
|
}, {
|
@@ -3833,7 +3822,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3833
3822
|
is_pitch: pitch,
|
3834
3823
|
resource: resource
|
3835
3824
|
}
|
3836
|
-
}), compiler.options.experiments.cache && compiler.options?.cache &&
|
3825
|
+
}), compiler.options.experiments.cache && compiler.options?.cache && Object.keys(buildInfo = context._module.buildInfo).some((key)=>!knownBuildInfoFields.has(key)) && buildInfo[binding_.COMMIT_CUSTOM_FIELDS_SYMBOL](), context;
|
3837
3826
|
}
|
3838
3827
|
let loader_runner_PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/;
|
3839
3828
|
function parsePathQueryFragment(str) {
|
@@ -3857,8 +3846,41 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3857
3846
|
], path1 = path, options1 = options, uses1.length ? uses1.filter(Boolean).map((use, index)=>{
|
3858
3847
|
let o, isBuiltin = !1;
|
3859
3848
|
if (use.loader.startsWith(BUILTIN_LOADER_PREFIX)) {
|
3860
|
-
|
3861
|
-
|
3849
|
+
let temp = function(identifier, o, options) {
|
3850
|
+
if (identifier.startsWith(`${BUILTIN_LOADER_PREFIX}swc-loader`)) {
|
3851
|
+
var o1, options1, options2 = o;
|
3852
|
+
if (options2 && "object" == typeof options2) {
|
3853
|
+
options2.jsc ??= {}, options2.jsc.experimental ??= {}, options2.jsc.experimental.disableAllLints ??= !0;
|
3854
|
+
let { rspackExperiments } = options2;
|
3855
|
+
rspackExperiments && ((rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
|
3856
|
+
if (pluginImport) return pluginImport.map((config)=>{
|
3857
|
+
let rawConfig = {
|
3858
|
+
...config,
|
3859
|
+
style: {}
|
3860
|
+
};
|
3861
|
+
if ("boolean" == typeof config.style) rawConfig.style.bool = config.style;
|
3862
|
+
else if ("string" == typeof config.style) {
|
3863
|
+
let isTpl = config.style.includes("{{");
|
3864
|
+
rawConfig.style[isTpl ? "custom" : "css"] = config.style;
|
3865
|
+
} else {
|
3866
|
+
var val;
|
3867
|
+
val = config.style, "[object Object]" === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
|
3868
|
+
}
|
3869
|
+
return config.styleLibraryDirectory && (rawConfig.style = {
|
3870
|
+
styleLibraryDirectory: config.styleLibraryDirectory
|
3871
|
+
}), rawConfig;
|
3872
|
+
});
|
3873
|
+
}(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (rspackExperiments.collectTypeScriptInfo = {
|
3874
|
+
typeExports: (options1 = rspackExperiments.collectTypeScriptInfo).typeExports,
|
3875
|
+
exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum ? "none" : "const-only"
|
3876
|
+
}));
|
3877
|
+
}
|
3878
|
+
return options2;
|
3879
|
+
}
|
3880
|
+
return identifier.startsWith(`${BUILTIN_LOADER_PREFIX}lightningcss-loader`) ? ((o1 = o) && "object" == typeof o1 && ("string" == typeof o1.targets && (o1.targets = [
|
3881
|
+
o1.targets
|
3882
|
+
]), o1.include && "object" == typeof o1.include && (o1.include = toFeatures(o1.include)), o1.exclude && "object" == typeof o1.exclude && (o1.exclude = toFeatures(o1.exclude))), o1) : o;
|
3883
|
+
}(use.loader, use.options, 0);
|
3862
3884
|
o = isNil(temp) ? void 0 : "string" == typeof temp ? temp : JSON.stringify(temp, null, 2), isBuiltin = !0;
|
3863
3885
|
}
|
3864
3886
|
return {
|
@@ -3873,125 +3895,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3873
3895
|
};
|
3874
3896
|
}) : [];
|
3875
3897
|
}
|
3876
|
-
let getSwcLoaderOptions = (options, _)=>{
|
3877
|
-
if (options && "object" == typeof options) {
|
3878
|
-
options.jsc ??= {}, options.jsc.experimental ??= {}, options.jsc.experimental.disableAllLints ??= !0;
|
3879
|
-
let { rspackExperiments } = options;
|
3880
|
-
if (rspackExperiments) {
|
3881
|
-
var options1;
|
3882
|
-
(rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
|
3883
|
-
if (pluginImport) return pluginImport.map((config)=>{
|
3884
|
-
let rawConfig = {
|
3885
|
-
...config,
|
3886
|
-
style: {}
|
3887
|
-
};
|
3888
|
-
if ("boolean" == typeof config.style) rawConfig.style.bool = config.style;
|
3889
|
-
else if ("string" == typeof config.style) {
|
3890
|
-
let isTpl = config.style.includes("{{");
|
3891
|
-
rawConfig.style[isTpl ? "custom" : "css"] = config.style;
|
3892
|
-
} else {
|
3893
|
-
var val;
|
3894
|
-
val = config.style, "[object Object]" === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
|
3895
|
-
}
|
3896
|
-
return config.styleLibraryDirectory && (rawConfig.style = {
|
3897
|
-
styleLibraryDirectory: config.styleLibraryDirectory
|
3898
|
-
}), rawConfig;
|
3899
|
-
});
|
3900
|
-
}(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (rspackExperiments.collectTypeScriptInfo = {
|
3901
|
-
typeExports: (options1 = rspackExperiments.collectTypeScriptInfo).typeExports,
|
3902
|
-
exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum ? "none" : "const-only"
|
3903
|
-
});
|
3904
|
-
}
|
3905
|
-
}
|
3906
|
-
return options;
|
3907
|
-
}, getLightningcssLoaderOptions = (o, _)=>(o && "object" == typeof o && ("string" == typeof o.targets && (o.targets = [
|
3908
|
-
o.targets
|
3909
|
-
]), o.include && "object" == typeof o.include && (o.include = toFeatures(o.include)), o.exclude && "object" == typeof o.exclude && (o.exclude = toFeatures(o.exclude))), o);
|
3910
3898
|
function isUseSourceMap(devtool) {
|
3911
3899
|
return !!devtool && devtool.includes("source-map") && (devtool.includes("module") || !devtool.includes("cheap"));
|
3912
3900
|
}
|
3913
|
-
let getRawOptions = (options, compiler)=>{
|
3914
|
-
var output, module, options1, parser, generator, stats;
|
3915
|
-
let mode = options.mode, experiments = options.experiments;
|
3916
|
-
return {
|
3917
|
-
name: options.name,
|
3918
|
-
mode,
|
3919
|
-
context: options.context,
|
3920
|
-
output: {
|
3921
|
-
...output = options.output,
|
3922
|
-
environment: function(environment = {}) {
|
3923
|
-
return {
|
3924
|
-
const: !!environment.const,
|
3925
|
-
arrowFunction: !!environment.arrowFunction,
|
3926
|
-
nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
|
3927
|
-
asyncFunction: !!environment.asyncFunction,
|
3928
|
-
bigIntLiteral: !!environment.bigIntLiteral,
|
3929
|
-
destructuring: !!environment.destructuring,
|
3930
|
-
document: !!environment.document,
|
3931
|
-
dynamicImport: !!environment.dynamicImport,
|
3932
|
-
forOf: !!environment.forOf,
|
3933
|
-
globalThis: !!environment.globalThis,
|
3934
|
-
module: !!environment.module,
|
3935
|
-
optionalChaining: !!environment.optionalChaining,
|
3936
|
-
templateLiteral: !!environment.templateLiteral
|
3937
|
-
};
|
3938
|
-
}(output.environment)
|
3939
|
-
},
|
3940
|
-
resolve: getRawResolve(options.resolve),
|
3941
|
-
resolveLoader: getRawResolve(options.resolveLoader),
|
3942
|
-
module: (module = options.module, options1 = {
|
3943
|
-
compiler,
|
3944
|
-
mode,
|
3945
|
-
context: options.context,
|
3946
|
-
experiments
|
3947
|
-
}, external_node_assert_default()(!isNil(module.defaultRules), "module.defaultRules should not be nil after defaults"), {
|
3948
|
-
rules: [
|
3949
|
-
{
|
3950
|
-
rules: module.defaultRules
|
3951
|
-
},
|
3952
|
-
{
|
3953
|
-
rules: module.rules
|
3954
|
-
}
|
3955
|
-
].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options1, "javascript/auto")),
|
3956
|
-
parser: Object.fromEntries(Object.entries(parser = module.parser).map(([k, v])=>[
|
3957
|
-
k,
|
3958
|
-
getRawParserOptions(v, k)
|
3959
|
-
]).filter(([k, v])=>void 0 !== v)),
|
3960
|
-
generator: Object.fromEntries(Object.entries(generator = module.generator).map(([k, v])=>[
|
3961
|
-
k,
|
3962
|
-
getRawGeneratorOptions(v, k)
|
3963
|
-
]).filter(([k, v])=>void 0 !== v)),
|
3964
|
-
noParse: module.noParse
|
3965
|
-
}),
|
3966
|
-
optimization: options.optimization,
|
3967
|
-
stats: {
|
3968
|
-
colors: function(options) {
|
3969
|
-
if ("boolean" == typeof options || "string" == typeof options) return presetToOptions(options);
|
3970
|
-
if (!options) return {};
|
3971
|
-
let obj = {
|
3972
|
-
...presetToOptions(options.preset),
|
3973
|
-
...options
|
3974
|
-
};
|
3975
|
-
return delete obj.preset, obj;
|
3976
|
-
}(stats = options.stats).colors ?? !1
|
3977
|
-
},
|
3978
|
-
cache: {
|
3979
|
-
type: options.cache ? "memory" : "disable"
|
3980
|
-
},
|
3981
|
-
experiments,
|
3982
|
-
node: function(node) {
|
3983
|
-
if (!1 !== node) return external_node_assert_default()(!isNil(node.__dirname) && !isNil(node.global) && !isNil(node.__filename)), {
|
3984
|
-
dirname: String(node.__dirname),
|
3985
|
-
filename: String(node.__filename),
|
3986
|
-
global: String(node.global)
|
3987
|
-
};
|
3988
|
-
}(options.node),
|
3989
|
-
profile: options.profile,
|
3990
|
-
amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
|
3991
|
-
bail: options.bail,
|
3992
|
-
__references: {}
|
3993
|
-
};
|
3994
|
-
};
|
3995
3901
|
function getRawAlias(alias = {}) {
|
3996
3902
|
return !("object" != typeof alias || null === alias || Array.isArray(alias)) && Object.entries(alias).map(([key, value])=>({
|
3997
3903
|
path: key,
|
@@ -4217,7 +4123,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
4217
4123
|
};
|
4218
4124
|
}
|
4219
4125
|
function getRawGeneratorOptions(generator, type) {
|
4220
|
-
var options, options1
|
4126
|
+
var options, options1;
|
4221
4127
|
if ("asset" === type) {
|
4222
4128
|
return {
|
4223
4129
|
type: "asset",
|
@@ -4252,14 +4158,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
4252
4158
|
type: "css/module",
|
4253
4159
|
cssModule: getRawCssAutoOrModuleGeneratorOptions(generator)
|
4254
4160
|
};
|
4255
|
-
if ("json" === type) {
|
4256
|
-
|
4257
|
-
|
4258
|
-
|
4259
|
-
|
4260
|
-
|
4261
|
-
};
|
4262
|
-
}
|
4161
|
+
if ("json" === type) return {
|
4162
|
+
type: "json",
|
4163
|
+
json: {
|
4164
|
+
JSONParse: generator.JSONParse
|
4165
|
+
}
|
4166
|
+
};
|
4263
4167
|
if (![
|
4264
4168
|
"asset/source",
|
4265
4169
|
"javascript",
|
@@ -4339,7 +4243,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
4339
4243
|
return Array.isArray(str) ? str.join("\n") : str;
|
4340
4244
|
}
|
4341
4245
|
static getModulesArrayBounds(modules) {
|
4342
|
-
let maxId =
|
4246
|
+
let maxId = -1 / 0, minId = 1 / 0;
|
4343
4247
|
for (let module of modules){
|
4344
4248
|
let moduleId = module.id;
|
4345
4249
|
if ("number" != typeof moduleId) return !1;
|
@@ -4571,10 +4475,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
4571
4475
|
class DynamicEntryPlugin extends RspackBuiltinPlugin {
|
4572
4476
|
context;
|
4573
4477
|
entry;
|
4574
|
-
name;
|
4575
|
-
affectedHooks;
|
4478
|
+
name = binding_.BuiltinPluginName.DynamicEntryPlugin;
|
4479
|
+
affectedHooks = "make";
|
4576
4480
|
constructor(context, entry){
|
4577
|
-
super(), this.context = context, this.entry = entry
|
4481
|
+
super(), this.context = context, this.entry = entry;
|
4578
4482
|
}
|
4579
4483
|
raw(compiler) {
|
4580
4484
|
let raw = {
|
@@ -4622,9 +4526,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4622
4526
|
};
|
4623
4527
|
class EnableLibraryPlugin extends RspackBuiltinPlugin {
|
4624
4528
|
type;
|
4625
|
-
name;
|
4529
|
+
name = binding_.BuiltinPluginName.EnableLibraryPlugin;
|
4626
4530
|
constructor(type){
|
4627
|
-
super(), this.type = type
|
4531
|
+
super(), this.type = type;
|
4628
4532
|
}
|
4629
4533
|
static setEnabled(compiler, type) {
|
4630
4534
|
EnableLibraryPlugin_getEnabledTypes(compiler).add(type);
|
@@ -4641,9 +4545,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4641
4545
|
class ExternalsPlugin extends RspackBuiltinPlugin {
|
4642
4546
|
type;
|
4643
4547
|
externals;
|
4644
|
-
name;
|
4548
|
+
name = binding_.BuiltinPluginName.ExternalsPlugin;
|
4645
4549
|
constructor(type, externals){
|
4646
|
-
super(), this.type = type, this.externals = externals
|
4550
|
+
super(), this.type = type, this.externals = externals;
|
4647
4551
|
}
|
4648
4552
|
raw(compiler) {
|
4649
4553
|
let { type, externals } = this, raw = {
|
@@ -4712,10 +4616,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4712
4616
|
let FileUriPlugin = base_create(binding_.BuiltinPluginName.FileUriPlugin, ()=>{}, "compilation"), FlagDependencyExportsPlugin = base_create(binding_.BuiltinPluginName.FlagDependencyExportsPlugin, ()=>{}, "compilation");
|
4713
4617
|
class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
|
4714
4618
|
global;
|
4715
|
-
name;
|
4716
|
-
affectedHooks;
|
4619
|
+
name = binding_.BuiltinPluginName.FlagDependencyUsagePlugin;
|
4620
|
+
affectedHooks = "compilation";
|
4717
4621
|
constructor(global){
|
4718
|
-
super(), this.global = global
|
4622
|
+
super(), this.global = global;
|
4719
4623
|
}
|
4720
4624
|
raw(compiler) {
|
4721
4625
|
return createBuiltinPlugin(this.name, this.global);
|
@@ -4727,9 +4631,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4727
4631
|
return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0), createBuiltinPlugin(this.name, void 0);
|
4728
4632
|
}
|
4729
4633
|
}
|
4730
|
-
let hooks_compilationHooksMap = new WeakMap()
|
4731
|
-
hooks_compilationHooksMap.delete(compilation);
|
4732
|
-
};
|
4634
|
+
let hooks_compilationHooksMap = new WeakMap();
|
4733
4635
|
function $constructor(name, initializer, params) {
|
4734
4636
|
function init(inst, def) {
|
4735
4637
|
var _a;
|
@@ -4760,7 +4662,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4760
4662
|
value: name
|
4761
4663
|
}), _;
|
4762
4664
|
}
|
4763
|
-
|
4665
|
+
Object.freeze({
|
4666
|
+
status: "aborted"
|
4667
|
+
}), Symbol("zod_brand");
|
4764
4668
|
class $ZodAsyncError extends Error {
|
4765
4669
|
constructor(){
|
4766
4670
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
@@ -4770,9 +4674,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4770
4674
|
function core_config(newConfig) {
|
4771
4675
|
return newConfig && Object.assign(globalConfig, newConfig), globalConfig;
|
4772
4676
|
}
|
4773
|
-
|
4774
|
-
|
4677
|
+
let cuid = /^[cC][^\s-]{8,}$/, cuid2 = /^[0-9a-z]+$/, ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, xid = /^[0-9a-vA-V]{20}$/, ksuid = /^[A-Za-z0-9]{27}$/, nanoid = /^[a-zA-Z0-9_-]{21}$/, duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, regexes_uuid = (version)=>version ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, base64url = /^[A-Za-z0-9_-]*$/, hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, e164 = /^\+(?:[0-9]){6,14}[0-9]$/, dateSource = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", regexes_date = RegExp(`^${dateSource}$`);
|
4678
|
+
function timeSource(args) {
|
4679
|
+
let hhmm = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
4680
|
+
return "number" == typeof args.precision ? -1 === args.precision ? `${hhmm}` : 0 === args.precision ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
4775
4681
|
}
|
4682
|
+
let integer = /^\d+$/, number = /^-?\d+(?:\.\d+)?/i, regexes_boolean = /true|false/i, _null = /null/i, _undefined = /undefined/i, lowercase = /^[^A-Z]*$/, uppercase = /^[^a-z]*$/;
|
4776
4683
|
function jsonStringifyReplacer(_, value) {
|
4777
4684
|
return "bigint" == typeof value ? value.toString() : value;
|
4778
4685
|
}
|
@@ -4816,18 +4723,15 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4816
4723
|
configurable: !0
|
4817
4724
|
});
|
4818
4725
|
}
|
4819
|
-
function randomString(length = 10) {
|
4820
|
-
let chars = "abcdefghijklmnopqrstuvwxyz", str = "";
|
4821
|
-
for(let i = 0; i < length; i++)str += chars[Math.floor(Math.random() * chars.length)];
|
4822
|
-
return str;
|
4823
|
-
}
|
4824
4726
|
function esc(str) {
|
4825
4727
|
return JSON.stringify(str);
|
4826
4728
|
}
|
4729
|
+
let captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args)=>{};
|
4827
4730
|
function util_isObject(data) {
|
4828
4731
|
return "object" == typeof data && null !== data && !Array.isArray(data);
|
4829
4732
|
}
|
4830
4733
|
let util_allowsEval = util_cached(()=>{
|
4734
|
+
if ("undefined" != typeof navigator && navigator?.userAgent?.includes("Cloudflare")) return !1;
|
4831
4735
|
try {
|
4832
4736
|
return Function(""), !0;
|
4833
4737
|
} catch (_) {
|
@@ -4841,36 +4745,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4841
4745
|
let prot = ctor.prototype;
|
4842
4746
|
return !1 !== util_isObject(prot) && !1 !== Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf");
|
4843
4747
|
}
|
4844
|
-
let
|
4845
|
-
let t = typeof data;
|
4846
|
-
switch(t){
|
4847
|
-
case "undefined":
|
4848
|
-
return "undefined";
|
4849
|
-
case "string":
|
4850
|
-
return "string";
|
4851
|
-
case "number":
|
4852
|
-
return Number.isNaN(data) ? "nan" : "number";
|
4853
|
-
case "boolean":
|
4854
|
-
return "boolean";
|
4855
|
-
case "function":
|
4856
|
-
return "function";
|
4857
|
-
case "bigint":
|
4858
|
-
return "bigint";
|
4859
|
-
case "symbol":
|
4860
|
-
return "symbol";
|
4861
|
-
case "object":
|
4862
|
-
if (Array.isArray(data)) return "array";
|
4863
|
-
if (null === data) return "null";
|
4864
|
-
if (data.then && "function" == typeof data.then && data.catch && "function" == typeof data.catch) return "promise";
|
4865
|
-
if ("undefined" != typeof Map && data instanceof Map) return "map";
|
4866
|
-
if ("undefined" != typeof Set && data instanceof Set) return "set";
|
4867
|
-
if ("undefined" != typeof Date && data instanceof Date) return "date";
|
4868
|
-
if ("undefined" != typeof File && data instanceof File) return "file";
|
4869
|
-
return "object";
|
4870
|
-
default:
|
4871
|
-
throw Error(`Unknown data type: ${t}`);
|
4872
|
-
}
|
4873
|
-
}, propertyKeyTypes = new Set([
|
4748
|
+
let propertyKeyTypes = new Set([
|
4874
4749
|
"string",
|
4875
4750
|
"number",
|
4876
4751
|
"symbol"
|
@@ -4896,9 +4771,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4896
4771
|
error: ()=>_params.error
|
4897
4772
|
} : _params;
|
4898
4773
|
}
|
4899
|
-
function stringifyPrimitive(value) {
|
4900
|
-
return "bigint" == typeof value ? value.toString() + "n" : "string" == typeof value ? `"${value}"` : `${value}`;
|
4901
|
-
}
|
4902
4774
|
let NUMBER_FORMAT_RANGES = {
|
4903
4775
|
safeint: [
|
4904
4776
|
Number.MIN_SAFE_INTEGER,
|
@@ -4922,7 +4794,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4922
4794
|
]
|
4923
4795
|
};
|
4924
4796
|
function aborted(x, startIndex = 0) {
|
4925
|
-
for(let i = startIndex; i < x.issues.length; i++)if (
|
4797
|
+
for(let i = startIndex; i < x.issues.length; i++)if (x.issues[i]?.continue !== !0) return !0;
|
4926
4798
|
return !1;
|
4927
4799
|
}
|
4928
4800
|
function prefixIssues(path, issues) {
|
@@ -4952,62 +4824,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4952
4824
|
...iss
|
4953
4825
|
};
|
4954
4826
|
}
|
4955
|
-
let
|
4956
|
-
inst.name = "$ZodError", Object.defineProperty(inst, "_zod", {
|
4957
|
-
value: inst._zod,
|
4958
|
-
enumerable: !1
|
4959
|
-
}), Object.defineProperty(inst, "issues", {
|
4960
|
-
value: def,
|
4961
|
-
enumerable: !1
|
4962
|
-
}), Object.defineProperty(inst, "message", {
|
4963
|
-
get: ()=>JSON.stringify(def, jsonStringifyReplacer, 2),
|
4964
|
-
enumerable: !0
|
4965
|
-
});
|
4966
|
-
}, $ZodError = $constructor("$ZodError", errors_initializer), $ZodRealError = $constructor("$ZodError", errors_initializer, {
|
4967
|
-
Parent: Error
|
4968
|
-
}), _safeParse = (_Err)=>(schema, value, _ctx)=>{
|
4969
|
-
let ctx = _ctx ? {
|
4970
|
-
..._ctx,
|
4971
|
-
async: !1
|
4972
|
-
} : {
|
4973
|
-
async: !1
|
4974
|
-
}, result = schema._zod.run({
|
4975
|
-
value,
|
4976
|
-
issues: []
|
4977
|
-
}, ctx);
|
4978
|
-
if (result instanceof Promise) throw new $ZodAsyncError();
|
4979
|
-
return result.issues.length ? {
|
4980
|
-
success: !1,
|
4981
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
|
4982
|
-
} : {
|
4983
|
-
success: !0,
|
4984
|
-
data: result.value
|
4985
|
-
};
|
4986
|
-
}, safeParse = _safeParse($ZodRealError), _safeParseAsync = (_Err)=>async (schema, value, _ctx)=>{
|
4987
|
-
let ctx = _ctx ? Object.assign(_ctx, {
|
4988
|
-
async: !0
|
4989
|
-
}) : {
|
4990
|
-
async: !0
|
4991
|
-
}, result = schema._zod.run({
|
4992
|
-
value,
|
4993
|
-
issues: []
|
4994
|
-
}, ctx);
|
4995
|
-
return result instanceof Promise && (result = await result), result.issues.length ? {
|
4996
|
-
success: !1,
|
4997
|
-
error: new _Err(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
|
4998
|
-
} : {
|
4999
|
-
success: !0,
|
5000
|
-
data: result.value
|
5001
|
-
};
|
5002
|
-
}, safeParseAsync = _safeParseAsync($ZodRealError), cuid = /^[cC][^\s-]{8,}$/, cuid2 = /^[0-9a-z]+$/, ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, xid = /^[0-9a-vA-V]{20}$/, ksuid = /^[A-Za-z0-9]{27}$/, nanoid = /^[a-zA-Z0-9_-]{21}$/, duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, regexes_uuid = (version)=>version ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, base64url = /^[A-Za-z0-9_-]*$/, hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, e164 = /^\+(?:[0-9]){6,14}[0-9]$/, dateSource = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", regexes_date = RegExp(`^${dateSource}$`);
|
5003
|
-
function timeSource(args) {
|
5004
|
-
let regex = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
5005
|
-
return args.precision ? regex = `${regex}\\.\\d{${args.precision}}` : null == args.precision && (regex = `${regex}(\\.\\d+)?`), regex;
|
5006
|
-
}
|
5007
|
-
let string = (params)=>{
|
5008
|
-
let regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : "[\\s\\S]*";
|
5009
|
-
return RegExp(`^${regex}$`);
|
5010
|
-
}, integer = /^\d+$/, number = /^-?\d+(?:\.\d+)?/i, regexes_boolean = /true|false/i, _null = /null/i, _undefined = /undefined/i, lowercase = /^[^A-Z]*$/, uppercase = /^[^a-z]*$/, $ZodCheck = $constructor("$ZodCheck", (inst, def)=>{
|
4827
|
+
let $ZodCheck = $constructor("$ZodCheck", (inst, def)=>{
|
5011
4828
|
var _a;
|
5012
4829
|
inst._zod ?? (inst._zod = {}), inst._zod.def = def, (_a = inst._zod).onattach ?? (_a.onattach = []);
|
5013
4830
|
}), numericOriginMap = {
|
@@ -5018,7 +4835,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5018
4835
|
$ZodCheck.init(inst, def);
|
5019
4836
|
let origin = numericOriginMap[typeof def.value];
|
5020
4837
|
inst._zod.onattach.push((inst)=>{
|
5021
|
-
let bag = inst._zod.bag, curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ??
|
4838
|
+
let bag = inst._zod.bag, curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? 1 / 0;
|
5022
4839
|
def.value < curr && (def.inclusive ? bag.maximum = def.value : bag.exclusiveMaximum = def.value);
|
5023
4840
|
}), inst._zod.check = (payload)=>{
|
5024
4841
|
(def.inclusive ? payload.value <= def.value : payload.value < def.value) || payload.issues.push({
|
@@ -5035,11 +4852,11 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5035
4852
|
$ZodCheck.init(inst, def);
|
5036
4853
|
let origin = numericOriginMap[typeof def.value];
|
5037
4854
|
inst._zod.onattach.push((inst)=>{
|
5038
|
-
let bag = inst._zod.bag, curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ??
|
4855
|
+
let bag = inst._zod.bag, curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? -1 / 0;
|
5039
4856
|
def.value > curr && (def.inclusive ? bag.minimum = def.value : bag.exclusiveMinimum = def.value);
|
5040
4857
|
}), inst._zod.check = (payload)=>{
|
5041
4858
|
(def.inclusive ? payload.value >= def.value : payload.value > def.value) || payload.issues.push({
|
5042
|
-
origin
|
4859
|
+
origin,
|
5043
4860
|
code: "too_small",
|
5044
4861
|
minimum: def.value,
|
5045
4862
|
input: payload.value,
|
@@ -5102,9 +4919,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5102
4919
|
}
|
5103
4920
|
input < minimum && payload.issues.push({
|
5104
4921
|
origin: "number",
|
5105
|
-
input
|
4922
|
+
input,
|
5106
4923
|
code: "too_small",
|
5107
|
-
minimum
|
4924
|
+
minimum,
|
5108
4925
|
inclusive: !0,
|
5109
4926
|
inst,
|
5110
4927
|
continue: !def.abort
|
@@ -5117,12 +4934,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5117
4934
|
});
|
5118
4935
|
};
|
5119
4936
|
}), $ZodCheckMaxLength = $constructor("$ZodCheckMaxLength", (inst, def)=>{
|
5120
|
-
|
5121
|
-
|
4937
|
+
var _a;
|
4938
|
+
$ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
|
5122
4939
|
let val = payload.value;
|
5123
4940
|
return null != val && void 0 !== val.length;
|
5124
|
-
}, inst._zod.onattach.push((inst)=>{
|
5125
|
-
let curr = inst._zod.bag.maximum ??
|
4941
|
+
}), inst._zod.onattach.push((inst)=>{
|
4942
|
+
let curr = inst._zod.bag.maximum ?? 1 / 0;
|
5126
4943
|
def.maximum < curr && (inst._zod.bag.maximum = def.maximum);
|
5127
4944
|
}), inst._zod.check = (payload)=>{
|
5128
4945
|
let input = payload.value;
|
@@ -5139,12 +4956,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5139
4956
|
});
|
5140
4957
|
};
|
5141
4958
|
}), $ZodCheckMinLength = $constructor("$ZodCheckMinLength", (inst, def)=>{
|
5142
|
-
|
5143
|
-
|
4959
|
+
var _a;
|
4960
|
+
$ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
|
5144
4961
|
let val = payload.value;
|
5145
4962
|
return null != val && void 0 !== val.length;
|
5146
|
-
}, inst._zod.onattach.push((inst)=>{
|
5147
|
-
let curr = inst._zod.bag.minimum ??
|
4963
|
+
}), inst._zod.onattach.push((inst)=>{
|
4964
|
+
let curr = inst._zod.bag.minimum ?? -1 / 0;
|
5148
4965
|
def.minimum > curr && (inst._zod.bag.minimum = def.minimum);
|
5149
4966
|
}), inst._zod.check = (payload)=>{
|
5150
4967
|
let input = payload.value;
|
@@ -5161,11 +4978,11 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5161
4978
|
});
|
5162
4979
|
};
|
5163
4980
|
}), $ZodCheckLengthEquals = $constructor("$ZodCheckLengthEquals", (inst, def)=>{
|
5164
|
-
|
5165
|
-
|
4981
|
+
var _a;
|
4982
|
+
$ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
|
5166
4983
|
let val = payload.value;
|
5167
4984
|
return null != val && void 0 !== val.length;
|
5168
|
-
}, inst._zod.onattach.push((inst)=>{
|
4985
|
+
}), inst._zod.onattach.push((inst)=>{
|
5169
4986
|
let bag = inst._zod.bag;
|
5170
4987
|
bag.minimum = def.length, bag.maximum = def.length, bag.length = def.length;
|
5171
4988
|
}), inst._zod.check = (payload)=>{
|
@@ -5181,18 +4998,19 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5181
4998
|
code: "too_small",
|
5182
4999
|
minimum: def.length
|
5183
5000
|
},
|
5001
|
+
inclusive: !0,
|
5002
|
+
exact: !0,
|
5184
5003
|
input: payload.value,
|
5185
5004
|
inst,
|
5186
5005
|
continue: !def.abort
|
5187
5006
|
});
|
5188
5007
|
};
|
5189
5008
|
}), $ZodCheckStringFormat = $constructor("$ZodCheckStringFormat", (inst, def)=>{
|
5190
|
-
var _a;
|
5009
|
+
var _a, _b;
|
5191
5010
|
$ZodCheck.init(inst, def), inst._zod.onattach.push((inst)=>{
|
5192
5011
|
let bag = inst._zod.bag;
|
5193
5012
|
bag.format = def.format, def.pattern && (bag.patterns ?? (bag.patterns = new Set()), bag.patterns.add(def.pattern));
|
5194
|
-
}), (_a = inst._zod).check ?? (_a.check = (payload)=>{
|
5195
|
-
if (!def.pattern) throw Error("Not implemented.");
|
5013
|
+
}), def.pattern ? (_a = inst._zod).check ?? (_a.check = (payload)=>{
|
5196
5014
|
def.pattern.lastIndex = 0, def.pattern.test(payload.value) || payload.issues.push({
|
5197
5015
|
origin: "string",
|
5198
5016
|
code: "invalid_format",
|
@@ -5204,7 +5022,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5204
5022
|
inst,
|
5205
5023
|
continue: !def.abort
|
5206
5024
|
});
|
5207
|
-
});
|
5025
|
+
}) : (_b = inst._zod).check ?? (_b.check = ()=>{});
|
5208
5026
|
}), $ZodCheckRegex = $constructor("$ZodCheckRegex", (inst, def)=>{
|
5209
5027
|
$ZodCheckStringFormat.init(inst, def), inst._zod.check = (payload)=>{
|
5210
5028
|
def.pattern.lastIndex = 0, def.pattern.test(payload.value) || payload.issues.push({
|
@@ -5305,45 +5123,95 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5305
5123
|
].join("\n"));
|
5306
5124
|
}
|
5307
5125
|
}
|
5308
|
-
let
|
5309
|
-
|
5310
|
-
|
5311
|
-
|
5312
|
-
|
5313
|
-
|
5314
|
-
|
5315
|
-
|
5316
|
-
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
|
5126
|
+
let errors_initializer = (inst, def)=>{
|
5127
|
+
inst.name = "$ZodError", Object.defineProperty(inst, "_zod", {
|
5128
|
+
value: inst._zod,
|
5129
|
+
enumerable: !1
|
5130
|
+
}), Object.defineProperty(inst, "issues", {
|
5131
|
+
value: def,
|
5132
|
+
enumerable: !1
|
5133
|
+
}), Object.defineProperty(inst, "message", {
|
5134
|
+
get: ()=>JSON.stringify(def, jsonStringifyReplacer, 2),
|
5135
|
+
enumerable: !0
|
5136
|
+
}), Object.defineProperty(inst, "toString", {
|
5137
|
+
value: ()=>inst.message,
|
5138
|
+
enumerable: !1
|
5321
5139
|
});
|
5322
|
-
|
5323
|
-
|
5324
|
-
|
5325
|
-
|
5326
|
-
|
5327
|
-
|
5328
|
-
|
5329
|
-
|
5330
|
-
|
5331
|
-
|
5332
|
-
|
5333
|
-
|
5334
|
-
|
5335
|
-
|
5336
|
-
|
5337
|
-
|
5338
|
-
|
5339
|
-
|
5340
|
-
|
5341
|
-
|
5342
|
-
|
5343
|
-
|
5344
|
-
|
5345
|
-
|
5346
|
-
|
5140
|
+
}, $ZodError = $constructor("$ZodError", errors_initializer), $ZodRealError = $constructor("$ZodError", errors_initializer, {
|
5141
|
+
Parent: Error
|
5142
|
+
}), _safeParse = (_Err)=>(schema, value, _ctx)=>{
|
5143
|
+
let ctx = _ctx ? {
|
5144
|
+
..._ctx,
|
5145
|
+
async: !1
|
5146
|
+
} : {
|
5147
|
+
async: !1
|
5148
|
+
}, result = schema._zod.run({
|
5149
|
+
value,
|
5150
|
+
issues: []
|
5151
|
+
}, ctx);
|
5152
|
+
if (result instanceof Promise) throw new $ZodAsyncError();
|
5153
|
+
return result.issues.length ? {
|
5154
|
+
success: !1,
|
5155
|
+
error: new (_Err ?? $ZodError)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
|
5156
|
+
} : {
|
5157
|
+
success: !0,
|
5158
|
+
data: result.value
|
5159
|
+
};
|
5160
|
+
}, safeParse = _safeParse($ZodRealError), _safeParseAsync = (_Err)=>async (schema, value, _ctx)=>{
|
5161
|
+
let ctx = _ctx ? Object.assign(_ctx, {
|
5162
|
+
async: !0
|
5163
|
+
}) : {
|
5164
|
+
async: !0
|
5165
|
+
}, result = schema._zod.run({
|
5166
|
+
value,
|
5167
|
+
issues: []
|
5168
|
+
}, ctx);
|
5169
|
+
return result instanceof Promise && (result = await result), result.issues.length ? {
|
5170
|
+
success: !1,
|
5171
|
+
error: new _Err(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
|
5172
|
+
} : {
|
5173
|
+
success: !0,
|
5174
|
+
data: result.value
|
5175
|
+
};
|
5176
|
+
}, safeParseAsync = _safeParseAsync($ZodRealError), versions_version = {
|
5177
|
+
major: 4,
|
5178
|
+
minor: 0,
|
5179
|
+
patch: 0
|
5180
|
+
}, $ZodType = $constructor("$ZodType", (inst, def)=>{
|
5181
|
+
var _a;
|
5182
|
+
inst ?? (inst = {}), inst._zod.def = def, inst._zod.bag = inst._zod.bag || {}, inst._zod.version = versions_version;
|
5183
|
+
let checks = [
|
5184
|
+
...inst._zod.def.checks ?? []
|
5185
|
+
];
|
5186
|
+
for (let ch of (inst._zod.traits.has("$ZodCheck") && checks.unshift(inst), checks))for (let fn of ch._zod.onattach)fn(inst);
|
5187
|
+
if (0 === checks.length) (_a = inst._zod).deferred ?? (_a.deferred = []), inst._zod.deferred?.push(()=>{
|
5188
|
+
inst._zod.run = inst._zod.parse;
|
5189
|
+
});
|
5190
|
+
else {
|
5191
|
+
let runChecks = (payload, checks, ctx)=>{
|
5192
|
+
let asyncResult, isAborted = aborted(payload);
|
5193
|
+
for (let ch of checks){
|
5194
|
+
if (ch._zod.def.when) {
|
5195
|
+
if (!ch._zod.def.when(payload)) continue;
|
5196
|
+
} else if (isAborted) continue;
|
5197
|
+
let currLen = payload.issues.length, _ = ch._zod.check(payload);
|
5198
|
+
if (_ instanceof Promise && ctx?.async === !1) throw new $ZodAsyncError();
|
5199
|
+
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async ()=>{
|
5200
|
+
await _, payload.issues.length !== currLen && (isAborted || (isAborted = aborted(payload, currLen)));
|
5201
|
+
});
|
5202
|
+
else {
|
5203
|
+
if (payload.issues.length === currLen) continue;
|
5204
|
+
isAborted || (isAborted = aborted(payload, currLen));
|
5205
|
+
}
|
5206
|
+
}
|
5207
|
+
return asyncResult ? asyncResult.then(()=>payload) : payload;
|
5208
|
+
};
|
5209
|
+
inst._zod.run = (payload, ctx)=>{
|
5210
|
+
let result = inst._zod.parse(payload, ctx);
|
5211
|
+
if (result instanceof Promise) {
|
5212
|
+
if (!1 === ctx.async) throw new $ZodAsyncError();
|
5213
|
+
return result.then((result)=>runChecks(result, checks, ctx));
|
5214
|
+
}
|
5347
5215
|
return runChecks(result, checks, ctx);
|
5348
5216
|
};
|
5349
5217
|
}
|
@@ -5370,7 +5238,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5370
5238
|
}), $ZodString = $constructor("$ZodString", (inst, def)=>{
|
5371
5239
|
$ZodType.init(inst, def), inst._zod.pattern = [
|
5372
5240
|
...inst?._zod.bag?.patterns ?? []
|
5373
|
-
].pop() ??
|
5241
|
+
].pop() ?? ((params)=>{
|
5242
|
+
let regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : "[\\s\\S]*";
|
5243
|
+
return RegExp(`^${regex}$`);
|
5244
|
+
})(inst._zod.bag), inst._zod.parse = (payload, _)=>{
|
5374
5245
|
if (def.coerce) try {
|
5375
5246
|
payload.value = String(payload.value);
|
5376
5247
|
} catch (_) {}
|
@@ -5406,7 +5277,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5406
5277
|
}), $ZodURL = $constructor("$ZodURL", (inst, def)=>{
|
5407
5278
|
$ZodStringFormat.init(inst, def), inst._zod.check = (payload)=>{
|
5408
5279
|
try {
|
5409
|
-
let url = new URL(
|
5280
|
+
let orig = payload.value, url = new URL(orig), href = url.href;
|
5410
5281
|
def.hostname && (def.hostname.lastIndex = 0, def.hostname.test(url.hostname) || payload.issues.push({
|
5411
5282
|
code: "invalid_format",
|
5412
5283
|
format: "url",
|
@@ -5423,7 +5294,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5423
5294
|
input: payload.value,
|
5424
5295
|
inst,
|
5425
5296
|
continue: !def.abort
|
5426
|
-
}));
|
5297
|
+
})), !orig.endsWith("/") && href.endsWith("/") ? payload.value = href.slice(0, -1) : payload.value = href;
|
5427
5298
|
return;
|
5428
5299
|
} catch (_) {
|
5429
5300
|
payload.issues.push({
|
@@ -5451,8 +5322,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5451
5322
|
def.pattern ?? (def.pattern = ksuid), $ZodStringFormat.init(inst, def);
|
5452
5323
|
}), $ZodISODateTime = $constructor("$ZodISODateTime", (inst, def)=>{
|
5453
5324
|
def.pattern ?? (def.pattern = function(args) {
|
5454
|
-
let
|
5455
|
-
|
5325
|
+
let time = timeSource({
|
5326
|
+
precision: args.precision
|
5327
|
+
}), opts = [
|
5328
|
+
"Z"
|
5329
|
+
];
|
5330
|
+
args.local && opts.push(""), args.offset && opts.push("([+-]\\d{2}:\\d{2})");
|
5331
|
+
let timeRegex = `${time}(?:${opts.join("|")})`;
|
5332
|
+
return RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
5456
5333
|
}(def)), $ZodStringFormat.init(inst, def);
|
5457
5334
|
}), $ZodISODate = $constructor("$ZodISODate", (inst, def)=>{
|
5458
5335
|
def.pattern ?? (def.pattern = regexes_date), $ZodStringFormat.init(inst, def);
|
@@ -5547,7 +5424,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5547
5424
|
try {
|
5548
5425
|
let tokensParts = token.split(".");
|
5549
5426
|
if (3 !== tokensParts.length) return !1;
|
5550
|
-
let [header] = tokensParts
|
5427
|
+
let [header] = tokensParts;
|
5428
|
+
if (!header) return !1;
|
5429
|
+
let parsedHeader = JSON.parse(atob(header));
|
5551
5430
|
if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT" || !parsedHeader.alg || algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return !1;
|
5552
5431
|
return !0;
|
5553
5432
|
} catch {
|
@@ -5597,8 +5476,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5597
5476
|
}), $ZodUndefined = $constructor("$ZodUndefined", (inst, def)=>{
|
5598
5477
|
$ZodType.init(inst, def), inst._zod.pattern = _undefined, inst._zod.values = new Set([
|
5599
5478
|
void 0
|
5600
|
-
]), inst._zod.parse = (payload, _ctx)=>{
|
5601
|
-
let
|
5479
|
+
]), inst._zod.optin = "optional", inst._zod.optout = "optional", inst._zod.parse = (payload, _ctx)=>{
|
5480
|
+
let input = payload.value;
|
5602
5481
|
return void 0 === input || payload.issues.push({
|
5603
5482
|
expected: "undefined",
|
5604
5483
|
code: "invalid_type",
|
@@ -5610,7 +5489,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5610
5489
|
$ZodType.init(inst, def), inst._zod.pattern = _null, inst._zod.values = new Set([
|
5611
5490
|
null
|
5612
5491
|
]), inst._zod.parse = (payload, _ctx)=>{
|
5613
|
-
let
|
5492
|
+
let input = payload.value;
|
5614
5493
|
return null === input || payload.issues.push({
|
5615
5494
|
expected: "null",
|
5616
5495
|
code: "invalid_type",
|
@@ -5684,23 +5563,34 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5684
5563
|
}
|
5685
5564
|
return propValues;
|
5686
5565
|
});
|
5687
|
-
let
|
5688
|
-
|
5689
|
-
|
5690
|
-
|
5691
|
-
|
5692
|
-
|
5693
|
-
|
5694
|
-
|
5695
|
-
|
5696
|
-
|
5697
|
-
let
|
5698
|
-
|
5699
|
-
|
5700
|
-
|
5701
|
-
|
5702
|
-
|
5703
|
-
|
5566
|
+
let jit = !globalConfig.jitless, fastEnabled = jit && util_allowsEval.value, catchall = def.catchall;
|
5567
|
+
inst._zod.parse = (payload, ctx)=>{
|
5568
|
+
value ?? (value = _normalized.value);
|
5569
|
+
let input = payload.value;
|
5570
|
+
if (!util_isObject(input)) return payload.issues.push({
|
5571
|
+
expected: "object",
|
5572
|
+
code: "invalid_type",
|
5573
|
+
input,
|
5574
|
+
inst
|
5575
|
+
}), payload;
|
5576
|
+
let proms = [];
|
5577
|
+
if (jit && fastEnabled && ctx?.async === !1 && !0 !== ctx.jitless) fastpass || (fastpass = ((shape)=>{
|
5578
|
+
let doc = new Doc([
|
5579
|
+
"shape",
|
5580
|
+
"payload",
|
5581
|
+
"ctx"
|
5582
|
+
]), normalized = _normalized.value, parseStr = (key)=>{
|
5583
|
+
let k = esc(key);
|
5584
|
+
return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
5585
|
+
};
|
5586
|
+
doc.write("const input = payload.value;");
|
5587
|
+
let ids = Object.create(null), counter = 0;
|
5588
|
+
for (let key of normalized.keys)ids[key] = `key_${counter++}`;
|
5589
|
+
for (let key of (doc.write("const newResult = {}"), normalized.keys))if (normalized.optionalKeys.has(key)) {
|
5590
|
+
let id = ids[key];
|
5591
|
+
doc.write(`const ${id} = ${parseStr(key)};`);
|
5592
|
+
let k = esc(key);
|
5593
|
+
doc.write(`
|
5704
5594
|
if (${id}.issues.length) {
|
5705
5595
|
if (input[${k}] === undefined) {
|
5706
5596
|
if (${k} in input) {
|
@@ -5720,29 +5610,18 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5720
5610
|
newResult[${k}] = ${id}.value;
|
5721
5611
|
}
|
5722
5612
|
`);
|
5723
|
-
|
5724
|
-
|
5725
|
-
|
5613
|
+
} else {
|
5614
|
+
let id = ids[key];
|
5615
|
+
doc.write(`const ${id} = ${parseStr(key)};`), doc.write(`
|
5726
5616
|
if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
5727
5617
|
...iss,
|
5728
5618
|
path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
|
5729
5619
|
})));`), doc.write(`newResult[${esc(key)}] = ${id}.value`);
|
5730
|
-
|
5731
|
-
|
5732
|
-
|
5733
|
-
|
5734
|
-
|
5735
|
-
inst._zod.parse = (payload, ctx)=>{
|
5736
|
-
value ?? (value = _normalized.value);
|
5737
|
-
let input = payload.value;
|
5738
|
-
if (!util_isObject(input)) return payload.issues.push({
|
5739
|
-
expected: "object",
|
5740
|
-
code: "invalid_type",
|
5741
|
-
input,
|
5742
|
-
inst
|
5743
|
-
}), payload;
|
5744
|
-
let proms = [];
|
5745
|
-
if (jit && fastEnabled && ctx?.async === !1 && !0 !== ctx.jitless) fastpass || (fastpass = generateFastpass(def.shape)), payload = fastpass(payload, ctx);
|
5620
|
+
}
|
5621
|
+
doc.write("payload.value = newResult;"), doc.write("return payload;");
|
5622
|
+
let fn = doc.compile();
|
5623
|
+
return (payload, ctx)=>fn(shape, payload, ctx);
|
5624
|
+
})(def.shape)), payload = fastpass(payload, ctx);
|
5746
5625
|
else {
|
5747
5626
|
payload.value = {};
|
5748
5627
|
let shape = value.shape;
|
@@ -5786,7 +5665,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5786
5665
|
}), final;
|
5787
5666
|
}
|
5788
5667
|
let $ZodUnion = $constructor("$ZodUnion", (inst, def)=>{
|
5789
|
-
$ZodType.init(inst, def), defineLazy(inst._zod, "values", ()=>{
|
5668
|
+
$ZodType.init(inst, def), defineLazy(inst._zod, "optin", ()=>def.options.some((o)=>"optional" === o._zod.optin) ? "optional" : void 0), defineLazy(inst._zod, "optout", ()=>def.options.some((o)=>"optional" === o._zod.optout) ? "optional" : void 0), defineLazy(inst._zod, "values", ()=>{
|
5790
5669
|
if (def.options.every((o)=>o._zod.values)) return new Set(def.options.flatMap((option)=>Array.from(option._zod.values)));
|
5791
5670
|
}), defineLazy(inst._zod, "pattern", ()=>{
|
5792
5671
|
if (def.options.every((o)=>o._zod.pattern)) {
|
@@ -5810,7 +5689,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5810
5689
|
};
|
5811
5690
|
}), $ZodIntersection = $constructor("$ZodIntersection", (inst, def)=>{
|
5812
5691
|
$ZodType.init(inst, def), inst._zod.parse = (payload, ctx)=>{
|
5813
|
-
let
|
5692
|
+
let input = payload.value, left = def.left._zod.run({
|
5814
5693
|
value: input,
|
5815
5694
|
issues: []
|
5816
5695
|
}, ctx), right = def.right._zod.run({
|
@@ -5881,7 +5760,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5881
5760
|
if (!merged.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
|
5882
5761
|
return result.value = merged.data, result;
|
5883
5762
|
}
|
5884
|
-
let
|
5763
|
+
let $ZodTuple = $constructor("$ZodTuple", (inst, def)=>{
|
5885
5764
|
$ZodType.init(inst, def);
|
5886
5765
|
let items = def.items, optStart = items.length - [
|
5887
5766
|
...items
|
@@ -6031,7 +5910,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6031
5910
|
]) : void 0), defineLazy(inst._zod, "pattern", ()=>{
|
6032
5911
|
let pattern = def.innerType._zod.pattern;
|
6033
5912
|
return pattern ? RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
6034
|
-
}), inst._zod.parse = (payload, ctx)=>void 0 === payload.value ? payload : def.innerType._zod.run(payload, ctx);
|
5913
|
+
}), inst._zod.parse = (payload, ctx)=>"optional" === def.innerType._zod.optin ? def.innerType._zod.run(payload, ctx) : void 0 === payload.value ? payload : def.innerType._zod.run(payload, ctx);
|
6035
5914
|
}), $ZodNullable = $constructor("$ZodNullable", (inst, def)=>{
|
6036
5915
|
$ZodType.init(inst, def), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), defineLazy(inst._zod, "pattern", ()=>{
|
6037
5916
|
let pattern = def.innerType._zod.pattern;
|
@@ -6072,7 +5951,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6072
5951
|
}), payload;
|
6073
5952
|
}
|
6074
5953
|
let $ZodCatch = $constructor("$ZodCatch", (inst, def)=>{
|
6075
|
-
$ZodType.init(inst, def),
|
5954
|
+
$ZodType.init(inst, def), inst._zod.optin = "optional", defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), defineLazy(inst._zod, "values", ()=>def.innerType._zod.values), inst._zod.parse = (payload, ctx)=>{
|
6076
5955
|
let result = def.innerType._zod.run(payload, ctx);
|
6077
5956
|
return result instanceof Promise ? result.then((result)=>(payload.value = result.value, result.issues.length && (payload.value = def.catchValue({
|
6078
5957
|
...payload,
|
@@ -6101,7 +5980,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6101
5980
|
}, ctx);
|
6102
5981
|
}
|
6103
5982
|
let $ZodReadonly = $constructor("$ZodReadonly", (inst, def)=>{
|
6104
|
-
$ZodType.init(inst, def), defineLazy(inst._zod, "propValues", ()=>def.innerType._zod.propValues), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), inst._zod.parse = (payload, ctx)=>{
|
5983
|
+
$ZodType.init(inst, def), defineLazy(inst._zod, "propValues", ()=>def.innerType._zod.propValues), defineLazy(inst._zod, "values", ()=>def.innerType._zod.values), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), inst._zod.parse = (payload, ctx)=>{
|
6105
5984
|
let result = def.innerType._zod.run(payload, ctx);
|
6106
5985
|
return result instanceof Promise ? result.then(handleReadonlyResult) : handleReadonlyResult(result);
|
6107
5986
|
};
|
@@ -6132,108 +6011,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6132
6011
|
inst._zod.def.params && (_iss.params = inst._zod.def.params), payload.issues.push(util_issue(_iss));
|
6133
6012
|
}
|
6134
6013
|
}
|
6135
|
-
let en_parsedType = (data)=>{
|
6136
|
-
let t = typeof data;
|
6137
|
-
switch(t){
|
6138
|
-
case "number":
|
6139
|
-
return Number.isNaN(data) ? "NaN" : "number";
|
6140
|
-
case "object":
|
6141
|
-
if (Array.isArray(data)) return "array";
|
6142
|
-
if (null === data) return "null";
|
6143
|
-
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
|
6144
|
-
}
|
6145
|
-
return t;
|
6146
|
-
}, en_error = ()=>{
|
6147
|
-
let Sizable = {
|
6148
|
-
string: {
|
6149
|
-
unit: "characters",
|
6150
|
-
verb: "to have"
|
6151
|
-
},
|
6152
|
-
file: {
|
6153
|
-
unit: "bytes",
|
6154
|
-
verb: "to have"
|
6155
|
-
},
|
6156
|
-
array: {
|
6157
|
-
unit: "items",
|
6158
|
-
verb: "to have"
|
6159
|
-
},
|
6160
|
-
set: {
|
6161
|
-
unit: "items",
|
6162
|
-
verb: "to have"
|
6163
|
-
}
|
6164
|
-
}, Nouns = {
|
6165
|
-
regex: "input",
|
6166
|
-
email: "email address",
|
6167
|
-
url: "URL",
|
6168
|
-
emoji: "emoji",
|
6169
|
-
uuid: "UUID",
|
6170
|
-
uuidv4: "UUIDv4",
|
6171
|
-
uuidv6: "UUIDv6",
|
6172
|
-
nanoid: "nanoid",
|
6173
|
-
guid: "GUID",
|
6174
|
-
cuid: "cuid",
|
6175
|
-
cuid2: "cuid2",
|
6176
|
-
ulid: "ULID",
|
6177
|
-
xid: "XID",
|
6178
|
-
ksuid: "KSUID",
|
6179
|
-
datetime: "ISO datetime",
|
6180
|
-
date: "ISO date",
|
6181
|
-
time: "ISO time",
|
6182
|
-
duration: "ISO duration",
|
6183
|
-
ipv4: "IPv4 address",
|
6184
|
-
ipv6: "IPv6 address",
|
6185
|
-
cidrv4: "IPv4 range",
|
6186
|
-
cidrv6: "IPv6 range",
|
6187
|
-
base64: "base64-encoded string",
|
6188
|
-
base64url: "base64url-encoded string",
|
6189
|
-
json_string: "JSON string",
|
6190
|
-
e164: "E.164 number",
|
6191
|
-
jwt: "JWT",
|
6192
|
-
template_literal: "input"
|
6193
|
-
};
|
6194
|
-
return (issue)=>{
|
6195
|
-
switch(issue.code){
|
6196
|
-
case "invalid_type":
|
6197
|
-
return `Invalid input: expected ${issue.expected}, received ${en_parsedType(issue.input)}`;
|
6198
|
-
case "invalid_value":
|
6199
|
-
if (1 === issue.values.length) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
|
6200
|
-
return `Invalid option: expected one of ${joinValues(issue.values, "|")}`;
|
6201
|
-
case "too_big":
|
6202
|
-
{
|
6203
|
-
let adj = issue.inclusive ? "<=" : "<", sizing = Sizable[issue.origin] ?? null;
|
6204
|
-
if (sizing) return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
6205
|
-
return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
|
6206
|
-
}
|
6207
|
-
case "too_small":
|
6208
|
-
{
|
6209
|
-
let adj = issue.inclusive ? ">=" : ">", sizing = Sizable[issue.origin] ?? null;
|
6210
|
-
if (sizing) return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
6211
|
-
return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
|
6212
|
-
}
|
6213
|
-
case "invalid_format":
|
6214
|
-
if ("starts_with" === issue.format) return `Invalid string: must start with "${issue.prefix}"`;
|
6215
|
-
if ("ends_with" === issue.format) return `Invalid string: must end with "${issue.suffix}"`;
|
6216
|
-
if ("includes" === issue.format) return `Invalid string: must include "${issue.includes}"`;
|
6217
|
-
if ("regex" === issue.format) return `Invalid string: must match pattern ${issue.pattern}`;
|
6218
|
-
return `Invalid ${Nouns[issue.format] ?? issue.format}`;
|
6219
|
-
case "not_multiple_of":
|
6220
|
-
return `Invalid number: must be a multiple of ${issue.divisor}`;
|
6221
|
-
case "unrecognized_keys":
|
6222
|
-
return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
|
6223
|
-
case "invalid_key":
|
6224
|
-
return `Invalid key in ${issue.origin}`;
|
6225
|
-
case "invalid_union":
|
6226
|
-
default:
|
6227
|
-
return "Invalid input";
|
6228
|
-
case "invalid_element":
|
6229
|
-
return `Invalid value in ${issue.origin}`;
|
6230
|
-
}
|
6231
|
-
};
|
6232
|
-
};
|
6233
6014
|
Symbol("ZodOutput"), Symbol("ZodInput");
|
6234
|
-
class
|
6015
|
+
class $ZodRegistry {
|
6235
6016
|
constructor(){
|
6236
|
-
this._map = new
|
6017
|
+
this._map = new Map(), this._idmap = new Map();
|
6237
6018
|
}
|
6238
6019
|
add(schema, ..._meta) {
|
6239
6020
|
let meta = _meta[0];
|
@@ -6243,8 +6024,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6243
6024
|
}
|
6244
6025
|
return this;
|
6245
6026
|
}
|
6027
|
+
clear() {
|
6028
|
+
return this._map = new Map(), this._idmap = new Map(), this;
|
6029
|
+
}
|
6246
6030
|
remove(schema) {
|
6247
|
-
|
6031
|
+
let meta = this._map.get(schema);
|
6032
|
+
return meta && "object" == typeof meta && "id" in meta && this._idmap.delete(meta.id), this._map.delete(schema), this;
|
6248
6033
|
}
|
6249
6034
|
get(schema) {
|
6250
6035
|
let p = schema._zod.parent;
|
@@ -6263,7 +6048,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6263
6048
|
return this._map.has(schema);
|
6264
6049
|
}
|
6265
6050
|
}
|
6266
|
-
let
|
6051
|
+
let globalRegistry = new $ZodRegistry();
|
6267
6052
|
function _guid(Class, params) {
|
6268
6053
|
return new Class({
|
6269
6054
|
type: "string",
|
@@ -6405,7 +6190,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6405
6190
|
$constructor("ZodError", classic_errors_initializer);
|
6406
6191
|
let ZodRealError = $constructor("ZodError", classic_errors_initializer, {
|
6407
6192
|
Parent: Error
|
6408
|
-
}),
|
6193
|
+
}), parse_parse = (_Err = ZodRealError, (schema, value, _ctx, _params)=>{
|
6409
6194
|
let ctx = _ctx ? Object.assign(_ctx, {
|
6410
6195
|
async: !1
|
6411
6196
|
}) : {
|
@@ -6417,10 +6202,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6417
6202
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
6418
6203
|
if (result.issues.length) {
|
6419
6204
|
let e = new (_params?.Err ?? _Err)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())));
|
6420
|
-
throw
|
6205
|
+
throw captureStackTrace(e, _params?.callee), e;
|
6421
6206
|
}
|
6422
6207
|
return result.value;
|
6423
|
-
}),
|
6208
|
+
}), parse_parseAsync = (_Err1 = ZodRealError, async (schema, value, _ctx, params)=>{
|
6424
6209
|
let ctx = _ctx ? Object.assign(_ctx, {
|
6425
6210
|
async: !0
|
6426
6211
|
}) : {
|
@@ -6431,7 +6216,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6431
6216
|
}, ctx);
|
6432
6217
|
if (result instanceof Promise && (result = await result), result.issues.length) {
|
6433
6218
|
let e = new (params?.Err ?? _Err1)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())));
|
6434
|
-
throw
|
6219
|
+
throw captureStackTrace(e, params?.callee), e;
|
6435
6220
|
}
|
6436
6221
|
return result.value;
|
6437
6222
|
}), parse_safeParse = _safeParse(ZodRealError), parse_safeParseAsync = _safeParseAsync(ZodRealError), ZodType = $constructor("ZodType", (inst, def)=>($ZodType.init(inst, def), inst.def = def, Object.defineProperty(inst, "_def", {
|
@@ -6450,9 +6235,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6450
6235
|
}
|
6451
6236
|
} : ch)
|
6452
6237
|
]
|
6453
|
-
}), inst.clone = (def, params)=>clone(inst, def, params), inst.brand = ()=>inst, inst.register = (reg, meta)=>(reg.add(inst, meta), inst), inst.parse = (data, params)=>
|
6238
|
+
}), inst.clone = (def, params)=>clone(inst, def, params), inst.brand = ()=>inst, inst.register = (reg, meta)=>(reg.add(inst, meta), inst), inst.parse = (data, params)=>parse_parse(inst, data, params, {
|
6454
6239
|
callee: inst.parse
|
6455
|
-
}), inst.safeParse = (data, params)=>parse_safeParse(inst, data, params), inst.parseAsync = async (data, params)=>
|
6240
|
+
}), inst.safeParse = (data, params)=>parse_safeParse(inst, data, params), inst.parseAsync = async (data, params)=>parse_parseAsync(inst, data, params, {
|
6456
6241
|
callee: inst.parseAsync
|
6457
6242
|
}), inst.safeParseAsync = async (data, params)=>parse_safeParseAsync(inst, data, params), inst.spa = inst.safeParseAsync, inst.refine = (check, params)=>inst.check(function(fn, _params = {}) {
|
6458
6243
|
return new ZodCustom({
|
@@ -6461,41 +6246,31 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6461
6246
|
fn: fn,
|
6462
6247
|
...normalizeParams(_params)
|
6463
6248
|
});
|
6464
|
-
}(check, params)), inst.superRefine = (refinement)=>inst.check(function(fn
|
6465
|
-
let ch = function(fn
|
6249
|
+
}(check, params)), inst.superRefine = (refinement)=>inst.check(function(fn) {
|
6250
|
+
let ch = function(fn) {
|
6466
6251
|
let ch = new $ZodCheck({
|
6467
|
-
check: "custom"
|
6468
|
-
...normalizeParams(params)
|
6252
|
+
check: "custom"
|
6469
6253
|
});
|
6470
6254
|
return ch._zod.check = fn, ch;
|
6471
6255
|
}((payload)=>(payload.addIssue = (issue)=>{
|
6472
6256
|
"string" == typeof issue ? payload.issues.push(util_issue(issue, payload.value, ch._zod.def)) : (issue.fatal && (issue.continue = !1), issue.code ?? (issue.code = "custom"), issue.input ?? (issue.input = payload.value), issue.inst ?? (issue.inst = ch), issue.continue ?? (issue.continue = !ch._zod.def.abort), payload.issues.push(util_issue(issue)));
|
6473
|
-
}, fn(payload.value, payload))
|
6257
|
+
}, fn(payload.value, payload)));
|
6474
6258
|
return ch;
|
6475
|
-
}(refinement)), inst.overwrite = (fn)=>inst.check(_overwrite(fn)), inst.optional = ()=>schemas_optional(inst), inst.nullable = ()=>nullable(inst), inst.nullish = ()=>schemas_optional(nullable(inst)), inst.nonoptional = (params)=>{
|
6476
|
-
var innerType, params1;
|
6477
|
-
return new ZodNonOptional({
|
6259
|
+
}(refinement)), inst.overwrite = (fn)=>inst.check(_overwrite(fn)), inst.optional = ()=>schemas_optional(inst), inst.nullable = ()=>nullable(inst), inst.nullish = ()=>schemas_optional(nullable(inst)), inst.nonoptional = (params)=>new ZodNonOptional({
|
6478
6260
|
type: "nonoptional",
|
6479
|
-
innerType:
|
6480
|
-
...normalizeParams(
|
6481
|
-
})
|
6482
|
-
}, inst.array = ()=>schemas_array(inst), inst.or = (arg)=>union([
|
6261
|
+
innerType: inst,
|
6262
|
+
...normalizeParams(params)
|
6263
|
+
}), inst.array = ()=>schemas_array(inst), inst.or = (arg)=>union([
|
6483
6264
|
inst,
|
6484
6265
|
arg
|
6485
|
-
]), inst.and = (arg)=>{
|
6486
|
-
var left, right;
|
6487
|
-
return new ZodIntersection({
|
6266
|
+
]), inst.and = (arg)=>new ZodIntersection({
|
6488
6267
|
type: "intersection",
|
6489
|
-
left:
|
6490
|
-
right:
|
6491
|
-
})
|
6492
|
-
}, inst.transform = (tx)=>{
|
6493
|
-
var fn;
|
6494
|
-
return pipe(inst, new ZodTransform({
|
6268
|
+
left: inst,
|
6269
|
+
right: arg
|
6270
|
+
}), inst.transform = (tx)=>pipe(inst, new ZodTransform({
|
6495
6271
|
type: "transform",
|
6496
|
-
transform:
|
6497
|
-
}))
|
6498
|
-
}, inst.default = (def)=>{
|
6272
|
+
transform: tx
|
6273
|
+
})), inst.default = (def)=>{
|
6499
6274
|
var innerType, defaultValue;
|
6500
6275
|
return innerType = inst, defaultValue = def, new ZodDefault({
|
6501
6276
|
type: "default",
|
@@ -6514,30 +6289,27 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6514
6289
|
}
|
6515
6290
|
});
|
6516
6291
|
}, inst.catch = (params)=>{
|
6517
|
-
var
|
6292
|
+
var catchValue;
|
6518
6293
|
return new ZodCatch({
|
6519
6294
|
type: "catch",
|
6520
|
-
innerType:
|
6295
|
+
innerType: inst,
|
6521
6296
|
catchValue: "function" == typeof (catchValue = params) ? catchValue : ()=>catchValue
|
6522
6297
|
});
|
6523
|
-
}, inst.pipe = (target)=>pipe(inst, target), inst.readonly = ()=>{
|
6524
|
-
var innerType;
|
6525
|
-
return new ZodReadonly({
|
6298
|
+
}, inst.pipe = (target)=>pipe(inst, target), inst.readonly = ()=>new ZodReadonly({
|
6526
6299
|
type: "readonly",
|
6527
|
-
innerType:
|
6528
|
-
})
|
6529
|
-
}, inst.describe = (description)=>{
|
6300
|
+
innerType: inst
|
6301
|
+
}), inst.describe = (description)=>{
|
6530
6302
|
let cl = inst.clone();
|
6531
|
-
return
|
6303
|
+
return globalRegistry.add(cl, {
|
6532
6304
|
description
|
6533
6305
|
}), cl;
|
6534
6306
|
}, Object.defineProperty(inst, "description", {
|
6535
|
-
get: ()=>
|
6307
|
+
get: ()=>globalRegistry.get(inst)?.description,
|
6536
6308
|
configurable: !0
|
6537
6309
|
}), inst.meta = (...args)=>{
|
6538
|
-
if (0 === args.length) return
|
6310
|
+
if (0 === args.length) return globalRegistry.get(inst);
|
6539
6311
|
let cl = inst.clone();
|
6540
|
-
return
|
6312
|
+
return globalRegistry.add(cl, args[0]), cl;
|
6541
6313
|
}, inst.isOptional = ()=>inst.safeParse(void 0).success, inst.isNullable = ()=>inst.safeParse(null).success, inst)), _ZodString = $constructor("_ZodString", (inst, def)=>{
|
6542
6314
|
$ZodString.init(inst, def), ZodType.init(inst, def);
|
6543
6315
|
let bag = inst._zod.bag;
|
@@ -6710,43 +6482,31 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6710
6482
|
check: "string_format",
|
6711
6483
|
abort: !1,
|
6712
6484
|
...normalizeParams(params)
|
6713
|
-
})), inst.datetime = (params)=>{
|
6714
|
-
var params1;
|
6715
|
-
return inst.check(new ZodISODateTime({
|
6485
|
+
})), inst.datetime = (params)=>inst.check(new ZodISODateTime({
|
6716
6486
|
type: "string",
|
6717
6487
|
format: "datetime",
|
6718
6488
|
check: "string_format",
|
6719
6489
|
offset: !1,
|
6720
6490
|
local: !1,
|
6721
6491
|
precision: null,
|
6722
|
-
...normalizeParams(
|
6723
|
-
}))
|
6724
|
-
}, inst.date = (params)=>{
|
6725
|
-
var params1;
|
6726
|
-
return inst.check(new ZodISODate({
|
6492
|
+
...normalizeParams(params)
|
6493
|
+
})), inst.date = (params)=>inst.check(new ZodISODate({
|
6727
6494
|
type: "string",
|
6728
6495
|
format: "date",
|
6729
6496
|
check: "string_format",
|
6730
|
-
...normalizeParams(
|
6731
|
-
}))
|
6732
|
-
}, inst.time = (params)=>{
|
6733
|
-
var params1;
|
6734
|
-
return inst.check(new ZodISOTime({
|
6497
|
+
...normalizeParams(params)
|
6498
|
+
})), inst.time = (params)=>inst.check(new ZodISOTime({
|
6735
6499
|
type: "string",
|
6736
6500
|
format: "time",
|
6737
6501
|
check: "string_format",
|
6738
6502
|
precision: null,
|
6739
|
-
...normalizeParams(
|
6740
|
-
}))
|
6741
|
-
}, inst.duration = (params)=>{
|
6742
|
-
var params1;
|
6743
|
-
return inst.check(new ZodISODuration({
|
6503
|
+
...normalizeParams(params)
|
6504
|
+
})), inst.duration = (params)=>inst.check(new ZodISODuration({
|
6744
6505
|
type: "string",
|
6745
6506
|
format: "duration",
|
6746
6507
|
check: "string_format",
|
6747
|
-
...normalizeParams(
|
6508
|
+
...normalizeParams(params)
|
6748
6509
|
}));
|
6749
|
-
};
|
6750
6510
|
});
|
6751
6511
|
function schemas_string(params) {
|
6752
6512
|
return new ZodString({
|
@@ -6797,7 +6557,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6797
6557
|
}), ZodNumber = $constructor("ZodNumber", (inst, def)=>{
|
6798
6558
|
$ZodNumber.init(inst, def), ZodType.init(inst, def), inst.gt = (value, params)=>inst.check(_gt(value, params)), inst.gte = (value, params)=>inst.check(_gte(value, params)), inst.min = (value, params)=>inst.check(_gte(value, params)), inst.lt = (value, params)=>inst.check(_lt(value, params)), inst.lte = (value, params)=>inst.check(_lte(value, params)), inst.max = (value, params)=>inst.check(_lte(value, params)), inst.int = (params)=>inst.check(schemas_int(params)), inst.safe = (params)=>inst.check(schemas_int(params)), inst.positive = (params)=>inst.check(_gt(0, params)), inst.nonnegative = (params)=>inst.check(_gte(0, params)), inst.negative = (params)=>inst.check(_lt(0, params)), inst.nonpositive = (params)=>inst.check(_lte(0, params)), inst.multipleOf = (value, params)=>inst.check(_multipleOf(value, params)), inst.step = (value, params)=>inst.check(_multipleOf(value, params)), inst.finite = ()=>inst;
|
6799
6559
|
let bag = inst._zod.bag;
|
6800
|
-
inst.minValue = Math.max(bag.minimum ??
|
6560
|
+
inst.minValue = Math.max(bag.minimum ?? -1 / 0, bag.exclusiveMinimum ?? -1 / 0) ?? null, inst.maxValue = Math.min(bag.maximum ?? 1 / 0, bag.exclusiveMaximum ?? 1 / 0) ?? null, inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5), inst.isFinite = !0, inst.format = bag.format ?? null;
|
6801
6561
|
});
|
6802
6562
|
function schemas_number(params) {
|
6803
6563
|
return new ZodNumber({
|
@@ -6867,15 +6627,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6867
6627
|
$ZodArray.init(inst, def), ZodType.init(inst, def), inst.element = def.element, inst.min = (minLength, params)=>inst.check(_minLength(minLength, params)), inst.nonempty = (params)=>inst.check(_minLength(1, params)), inst.max = (maxLength, params)=>inst.check(_maxLength(maxLength, params)), inst.length = (len, params)=>inst.check(_length(len, params)), inst.unwrap = ()=>inst.element;
|
6868
6628
|
});
|
6869
6629
|
function schemas_array(element, params) {
|
6870
|
-
|
6871
|
-
return new (Class = ZodArray)({
|
6630
|
+
return new ZodArray({
|
6872
6631
|
type: "array",
|
6873
6632
|
element: element,
|
6874
6633
|
...normalizeParams(params)
|
6875
6634
|
});
|
6876
6635
|
}
|
6877
6636
|
let ZodObject = $constructor("ZodObject", (inst, def)=>{
|
6878
|
-
$ZodObject.init(inst, def), ZodType.init(inst, def), defineLazy(inst, "shape", ()=>
|
6637
|
+
$ZodObject.init(inst, def), ZodType.init(inst, def), defineLazy(inst, "shape", ()=>def.shape), inst.keyof = ()=>schemas_enum(Object.keys(inst._zod.def.shape)), inst.catchall = (catchall)=>inst.clone({
|
6879
6638
|
...inst._zod.def,
|
6880
6639
|
catchall: catchall
|
6881
6640
|
}), inst.passthrough = ()=>inst.clone({
|
@@ -6891,6 +6650,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6891
6650
|
...inst._zod.def,
|
6892
6651
|
catchall: void 0
|
6893
6652
|
}), inst.extend = (incoming)=>(function(schema, shape) {
|
6653
|
+
if (!isPlainObject(shape)) throw Error("Invalid input to extend: expected a plain object");
|
6894
6654
|
let def = {
|
6895
6655
|
...schema._zod.def,
|
6896
6656
|
get shape () {
|
@@ -7019,7 +6779,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7019
6779
|
let ZodIntersection = $constructor("ZodIntersection", (inst, def)=>{
|
7020
6780
|
$ZodIntersection.init(inst, def), ZodType.init(inst, def);
|
7021
6781
|
}), ZodTuple = $constructor("ZodTuple", (inst, def)=>{
|
7022
|
-
|
6782
|
+
$ZodTuple.init(inst, def), ZodType.init(inst, def), inst.rest = (rest)=>inst.clone({
|
7023
6783
|
...inst._zod.def,
|
7024
6784
|
rest: rest
|
7025
6785
|
});
|
@@ -7178,14 +6938,38 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7178
6938
|
});
|
7179
6939
|
return inst._zod.bag.Class = cls, inst;
|
7180
6940
|
}
|
7181
|
-
|
7182
|
-
status: "aborted"
|
7183
|
-
}), core_config({
|
7184
|
-
localeError: en_error()
|
7185
|
-
});
|
7186
|
-
let numberOrInfinity = schemas_number().or(literal(Number.POSITIVE_INFINITY)), anyFunction = custom((data)=>"function" == typeof data, {
|
6941
|
+
let numberOrInfinity = schemas_number().or(literal(1 / 0)), anyFunction = custom((data)=>"function" == typeof data, {
|
7187
6942
|
error: (input)=>({
|
7188
|
-
message: `Expected function, received ${
|
6943
|
+
message: `Expected function, received ${((data)=>{
|
6944
|
+
let t = typeof data;
|
6945
|
+
switch(t){
|
6946
|
+
case "undefined":
|
6947
|
+
return "undefined";
|
6948
|
+
case "string":
|
6949
|
+
return "string";
|
6950
|
+
case "number":
|
6951
|
+
return Number.isNaN(data) ? "nan" : "number";
|
6952
|
+
case "boolean":
|
6953
|
+
return "boolean";
|
6954
|
+
case "function":
|
6955
|
+
return "function";
|
6956
|
+
case "bigint":
|
6957
|
+
return "bigint";
|
6958
|
+
case "symbol":
|
6959
|
+
return "symbol";
|
6960
|
+
case "object":
|
6961
|
+
if (Array.isArray(data)) return "array";
|
6962
|
+
if (null === data) return "null";
|
6963
|
+
if (data.then && "function" == typeof data.then && data.catch && "function" == typeof data.catch) return "promise";
|
6964
|
+
if ("undefined" != typeof Map && data instanceof Map) return "map";
|
6965
|
+
if ("undefined" != typeof Set && data instanceof Set) return "set";
|
6966
|
+
if ("undefined" != typeof Date && data instanceof Date) return "date";
|
6967
|
+
if ("undefined" != typeof File && data instanceof File) return "file";
|
6968
|
+
return "object";
|
6969
|
+
default:
|
6970
|
+
throw Error(`Unknown data type: ${t}`);
|
6971
|
+
}
|
6972
|
+
})(input)}`
|
7189
6973
|
})
|
7190
6974
|
}), getIgnorePluginOptionsSchema = memoize(()=>union([
|
7191
6975
|
schemas_object({
|
@@ -7515,29 +7299,29 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7515
7299
|
message: `value must be in ${issue.format} format`
|
7516
7300
|
};
|
7517
7301
|
default:
|
7518
|
-
var issue1, issue2, issue3
|
7519
|
-
if ("starts_with" ===
|
7302
|
+
var issue1, issue2, issue3;
|
7303
|
+
if ("starts_with" === issue.format) {
|
7520
7304
|
return {
|
7521
|
-
type: (
|
7522
|
-
path:
|
7523
|
-
message: `value must start with "${
|
7305
|
+
type: (issue1 = issue).code,
|
7306
|
+
path: issue1.path,
|
7307
|
+
message: `value must start with "${issue1.prefix}"`
|
7524
7308
|
};
|
7525
7309
|
}
|
7526
|
-
if ("ends_with" ===
|
7310
|
+
if ("ends_with" === issue.format) {
|
7527
7311
|
return {
|
7528
|
-
type: (
|
7529
|
-
path:
|
7530
|
-
message: `value must end with "${
|
7312
|
+
type: (issue2 = issue).code,
|
7313
|
+
path: issue2.path,
|
7314
|
+
message: `value must end with "${issue2.suffix}"`
|
7531
7315
|
};
|
7532
7316
|
}
|
7533
|
-
if ("includes" ===
|
7317
|
+
if ("includes" === issue.format) {
|
7534
7318
|
return {
|
7535
|
-
type: (
|
7536
|
-
path:
|
7537
|
-
message: `value must include "${
|
7319
|
+
type: (issue3 = issue).code,
|
7320
|
+
path: issue3.path,
|
7321
|
+
message: `value must include "${issue3.includes}"`
|
7538
7322
|
};
|
7539
7323
|
}
|
7540
|
-
if ("regex" ===
|
7324
|
+
if ("regex" === issue.format) return function(issue, options = {
|
7541
7325
|
displayInvalidFormatDetails: !1
|
7542
7326
|
}) {
|
7543
7327
|
let message = "value must match pattern";
|
@@ -7547,7 +7331,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7547
7331
|
message
|
7548
7332
|
};
|
7549
7333
|
}(issue, options);
|
7550
|
-
if ("jwt" ===
|
7334
|
+
if ("jwt" === issue.format) return function(issue, options = {
|
7551
7335
|
displayInvalidFormatDetails: !1
|
7552
7336
|
}) {
|
7553
7337
|
return {
|
@@ -7681,10 +7465,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7681
7465
|
}
|
7682
7466
|
return path.reduce((acc, propertyKey)=>{
|
7683
7467
|
if ("number" == typeof propertyKey) return acc + "[" + propertyKey.toString() + "]";
|
7684
|
-
if ("symbol" == typeof propertyKey && (propertyKey = stringifySymbol(propertyKey)), propertyKey.includes('"'))
|
7685
|
-
var str;
|
7686
|
-
return acc + '["' + (str = propertyKey).replace(/"/g, '\\"') + '"]';
|
7687
|
-
}
|
7468
|
+
if ("symbol" == typeof propertyKey && (propertyKey = stringifySymbol(propertyKey)), propertyKey.includes('"')) return acc + '["' + propertyKey.replace(/"/g, '\\"') + '"]';
|
7688
7469
|
if (!identifierRegex.test(propertyKey)) return acc + '["' + propertyKey + '"]';
|
7689
7470
|
let separator = 0 === acc.length ? "" : ".";
|
7690
7471
|
return acc + separator + propertyKey;
|
@@ -7707,7 +7488,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7707
7488
|
}
|
7708
7489
|
function fromZodErrorWithoutRuntimeCheck(zodError, options = {}) {
|
7709
7490
|
var options1;
|
7710
|
-
let
|
7491
|
+
let zodIssues = zodError.issues;
|
7711
7492
|
return new ValidationError(isNonEmptyArray(zodIssues) ? ("messageBuilder" in (options1 = options) ? options1.messageBuilder : function(partialOptions = {}) {
|
7712
7493
|
let options = {
|
7713
7494
|
...defaultMessageBuilderOptions,
|
@@ -7724,11 +7505,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7724
7505
|
cause: zodError
|
7725
7506
|
});
|
7726
7507
|
}
|
7727
|
-
var toValidationError = (options = {})=>(err)=>isZodErrorLike(err) ? fromZodErrorWithoutRuntimeCheck(err, options) : err instanceof Error ? new ValidationError(err.message, {
|
7728
|
-
cause: err
|
7729
|
-
}) : new ValidationError("Unknown error");
|
7730
7508
|
function fromError(err, options = {}) {
|
7731
|
-
return
|
7509
|
+
return ((options = {})=>(err)=>isZodErrorLike(err) ? fromZodErrorWithoutRuntimeCheck(err, options) : err instanceof Error ? new ValidationError(err.message, {
|
7510
|
+
cause: err
|
7511
|
+
}) : new ValidationError("Unknown error"))(options)(err);
|
7732
7512
|
}
|
7733
7513
|
class validate_ValidationError extends Error {
|
7734
7514
|
constructor(message){
|
@@ -7775,16 +7555,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7775
7555
|
return !1;
|
7776
7556
|
}
|
7777
7557
|
}
|
7778
|
-
let compilationOptionsMap = new WeakMap(),
|
7779
|
-
if (!(compilation instanceof Compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
|
7780
|
-
return compilationOptionsMap.get(compilation)?.[uid];
|
7781
|
-
}, setPluginOptions = (compilation, uid, options)=>{
|
7782
|
-
let optionsMap = compilationOptionsMap.get(compilation) || {};
|
7783
|
-
optionsMap[uid] = options, compilationOptionsMap.set(compilation, optionsMap);
|
7784
|
-
}, cleanPluginOptions = (compilation, uid)=>{
|
7785
|
-
let optionsMap = compilationOptionsMap.get(compilation) || {};
|
7786
|
-
delete optionsMap[uid], 0 === Object.keys(optionsMap).length ? compilationOptionsMap.delete(compilation) : compilationOptionsMap.set(compilation, optionsMap);
|
7787
|
-
}, HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
|
7558
|
+
let compilationOptionsMap = new WeakMap(), HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
|
7788
7559
|
let templateParameters, templateFn, filenames;
|
7789
7560
|
validate(c, getHtmlPluginOptionsSchema);
|
7790
7561
|
let uid = HTML_PLUGIN_UID++, meta = {};
|
@@ -7824,9 +7595,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7824
7595
|
return json;
|
7825
7596
|
}
|
7826
7597
|
this.hooks.compilation.tap("HtmlRspackPlugin", (compilationInstance)=>{
|
7827
|
-
|
7598
|
+
var compilation1 = compilation = compilationInstance, uid1 = uid, options = c;
|
7599
|
+
let optionsMap = compilationOptionsMap.get(compilation1) || {};
|
7600
|
+
optionsMap[uid1] = options, compilationOptionsMap.set(compilation1, optionsMap);
|
7828
7601
|
}), this.hooks.done.tap("HtmlRspackPlugin", (stats)=>{
|
7829
|
-
|
7602
|
+
compilation = stats.compilation, hooks_compilationHooksMap.delete(compilation);
|
7603
|
+
var compilation, compilation1 = stats.compilation, uid1 = uid;
|
7604
|
+
let optionsMap = compilationOptionsMap.get(compilation1) || {};
|
7605
|
+
delete optionsMap[uid1], 0 === Object.keys(optionsMap).length ? compilationOptionsMap.delete(compilation1) : compilationOptionsMap.set(compilation1, optionsMap);
|
7830
7606
|
});
|
7831
7607
|
let templateContent = c.templateContent;
|
7832
7608
|
if ("function" == typeof templateContent) templateFn = async (data)=>{
|
@@ -7965,10 +7741,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7965
7741
|
};
|
7966
7742
|
class HttpUriPlugin extends RspackBuiltinPlugin {
|
7967
7743
|
options;
|
7968
|
-
name;
|
7969
|
-
affectedHooks;
|
7744
|
+
name = binding_.BuiltinPluginName.HttpUriPlugin;
|
7745
|
+
affectedHooks = "compilation";
|
7970
7746
|
constructor(options){
|
7971
|
-
super(), this.options = options
|
7747
|
+
super(), this.options = options;
|
7972
7748
|
}
|
7973
7749
|
raw(compiler) {
|
7974
7750
|
let { options } = this, lockfileLocation = options.lockfileLocation ?? external_node_path_default().join(compiler.context, compiler.name ? `${compiler.name}.rspack.lock` : "rspack.lock"), cacheLocation = !1 === options.cacheLocation ? void 0 : options.cacheLocation ?? `${lockfileLocation}.data`, raw = {
|
@@ -8005,21 +7781,21 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8005
7781
|
imports,
|
8006
7782
|
entries,
|
8007
7783
|
test
|
8008
|
-
}), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-",
|
7784
|
+
}), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", noop = (_req, _res, next)=>{
|
8009
7785
|
"function" == typeof next && next();
|
8010
|
-
}, getFullServerUrl = ({ serverUrl, prefix })=>{
|
8011
|
-
let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
|
8012
|
-
return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
|
8013
7786
|
};
|
8014
7787
|
function applyPlugin(compiler, moduleToIndex, indexToModule, options, activeModules, filesByKey) {
|
8015
7788
|
new BuiltinLazyCompilationPlugin(({ module, path })=>{
|
8016
|
-
let index = moduleToIndex.get(module);
|
7789
|
+
let compiler1, index = moduleToIndex.get(module);
|
8017
7790
|
void 0 === index && (index = moduleToIndex.size.toString(), moduleToIndex.set(module, index), indexToModule.set(index, module));
|
8018
7791
|
let key = indexToModule.get(index);
|
8019
7792
|
filesByKey.set(key, path);
|
8020
7793
|
let active = !0 === activeModules.get(key);
|
8021
7794
|
return {
|
8022
|
-
client: `${options.client ||
|
7795
|
+
client: `${options.client || (compiler1 = compiler, require.resolve(`../hot/lazy-compilation-${compiler1.options.externalsPresets.node ? "node" : "web"}.js`))}?${encodeURIComponent((({ serverUrl, prefix })=>{
|
7796
|
+
let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
|
7797
|
+
return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
|
7798
|
+
})(options))}`,
|
8023
7799
|
data: index,
|
8024
7800
|
active
|
8025
7801
|
};
|
@@ -8047,10 +7823,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8047
7823
|
}, LimitChunkCountPlugin = base_create(binding_.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options);
|
8048
7824
|
class MangleExportsPlugin extends RspackBuiltinPlugin {
|
8049
7825
|
deterministic;
|
8050
|
-
name;
|
8051
|
-
affectedHooks;
|
7826
|
+
name = binding_.BuiltinPluginName.MangleExportsPlugin;
|
7827
|
+
affectedHooks = "compilation";
|
8052
7828
|
constructor(deterministic){
|
8053
|
-
super(), this.deterministic = deterministic
|
7829
|
+
super(), this.deterministic = deterministic;
|
8054
7830
|
}
|
8055
7831
|
raw(compiler) {
|
8056
7832
|
return createBuiltinPlugin(this.name, this.deterministic);
|
@@ -8109,29 +7885,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8109
7885
|
])
|
8110
7886
|
}, RuntimePlugin_compilationHooksMap.set(compilation, hooks)), hooks;
|
8111
7887
|
};
|
8112
|
-
let
|
8113
|
-
registerRuntimePluginCreateScriptTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginCreateScript, function() {
|
8114
|
-
return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).createScript;
|
8115
|
-
}, function(queried) {
|
8116
|
-
return function(data) {
|
8117
|
-
return queried.call(data.code, data.chunk);
|
8118
|
-
};
|
8119
|
-
}),
|
8120
|
-
registerRuntimePluginLinkPreloadTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginLinkPreload, function() {
|
8121
|
-
return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).linkPreload;
|
8122
|
-
}, function(queried) {
|
8123
|
-
return function(data) {
|
8124
|
-
return queried.call(data.code, data.chunk);
|
8125
|
-
};
|
8126
|
-
}),
|
8127
|
-
registerRuntimePluginLinkPrefetchTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginLinkPrefetch, function() {
|
8128
|
-
return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).linkPrefetch;
|
8129
|
-
}, function(queried) {
|
8130
|
-
return function(data) {
|
8131
|
-
return queried.call(data.code, data.chunk);
|
8132
|
-
};
|
8133
|
-
})
|
8134
|
-
}), SideEffectsFlagPlugin = base_create(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
|
7888
|
+
let SideEffectsFlagPlugin = base_create(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
|
8135
7889
|
let hints = !1 === options.hints ? void 0 : options.hints;
|
8136
7890
|
return {
|
8137
7891
|
...options,
|
@@ -8147,10 +7901,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8147
7901
|
}
|
8148
7902
|
class SplitChunksPlugin extends RspackBuiltinPlugin {
|
8149
7903
|
options;
|
8150
|
-
name;
|
8151
|
-
affectedHooks;
|
7904
|
+
name = binding_.BuiltinPluginName.SplitChunksPlugin;
|
7905
|
+
affectedHooks = "thisCompilation";
|
8152
7906
|
constructor(options){
|
8153
|
-
super(), this.options = options
|
7907
|
+
super(), this.options = options;
|
8154
7908
|
}
|
8155
7909
|
raw(compiler) {
|
8156
7910
|
let rawOptions = function(sc, compiler) {
|
@@ -8293,9 +8047,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8293
8047
|
wasmLoading;
|
8294
8048
|
module;
|
8295
8049
|
workerPublicPath;
|
8296
|
-
name;
|
8050
|
+
name = binding_.BuiltinPluginName.WorkerPlugin;
|
8297
8051
|
constructor(chunkLoading, wasmLoading, module, workerPublicPath){
|
8298
|
-
super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath
|
8052
|
+
super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath;
|
8299
8053
|
}
|
8300
8054
|
raw(compiler) {
|
8301
8055
|
return this.chunkLoading && new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler), this.wasmLoading && new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler), createBuiltinPlugin(this.name, void 0);
|
@@ -8350,43 +8104,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8350
8104
|
])
|
8351
8105
|
}, RsdoctorPlugin_compilationHooksMap.set(compilation, hooks)), hooks;
|
8352
8106
|
};
|
8353
|
-
let
|
8354
|
-
registerRsdoctorPluginModuleGraphTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleGraph, function() {
|
8355
|
-
return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleGraph;
|
8356
|
-
}, function(queried) {
|
8357
|
-
return async function(data) {
|
8358
|
-
return await queried.promise(data);
|
8359
|
-
};
|
8360
|
-
}),
|
8361
|
-
registerRsdoctorPluginChunkGraphTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginChunkGraph, function() {
|
8362
|
-
return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).chunkGraph;
|
8363
|
-
}, function(queried) {
|
8364
|
-
return async function(data) {
|
8365
|
-
return await queried.promise(data);
|
8366
|
-
};
|
8367
|
-
}),
|
8368
|
-
registerRsdoctorPluginModuleIdsTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleIds, function() {
|
8369
|
-
return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleIds;
|
8370
|
-
}, function(queried) {
|
8371
|
-
return async function(data) {
|
8372
|
-
return await queried.promise(data);
|
8373
|
-
};
|
8374
|
-
}),
|
8375
|
-
registerRsdoctorPluginModuleSourcesTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleSources, function() {
|
8376
|
-
return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleSources;
|
8377
|
-
}, function(queried) {
|
8378
|
-
return async function(data) {
|
8379
|
-
return await queried.promise(data);
|
8380
|
-
};
|
8381
|
-
}),
|
8382
|
-
registerRsdoctorPluginAssetsTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginAssets, function() {
|
8383
|
-
return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).assets;
|
8384
|
-
}, function(queried) {
|
8385
|
-
return async function(data) {
|
8386
|
-
return await queried.promise(data);
|
8387
|
-
};
|
8388
|
-
})
|
8389
|
-
}), SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
|
8107
|
+
let SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
|
8390
8108
|
let htmlPlugin = "Disabled";
|
8391
8109
|
return options.htmlPlugin === NATIVE_HTML_PLUGIN ? htmlPlugin = "Native" : "string" == typeof options.htmlPlugin && (htmlPlugin = "JavaScript"), {
|
8392
8110
|
hashFuncNames: options.hashFuncNames,
|
@@ -8711,8 +8429,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8711
8429
|
let requiredVersion = versions[name];
|
8712
8430
|
if (!requiredVersion) return !1;
|
8713
8431
|
let [parsedMajor, parserMinor] = "TP" === parsedVersion ? [
|
8714
|
-
|
8715
|
-
|
8432
|
+
1 / 0,
|
8433
|
+
1 / 0
|
8716
8434
|
] : parsedVersion.includes("-") ? parsedVersion.split("-")[0].split(".") : parsedVersion.split(".");
|
8717
8435
|
return "number" == typeof requiredVersion ? +parsedMajor >= requiredVersion : requiredVersion[0] === +parsedMajor ? +parserMinor >= requiredVersion[1] : +parsedMajor > requiredVersion[0];
|
8718
8436
|
}), anyNode = browsers.some((b)=>b.startsWith("node ")), anyBrowser = browsers.some((b)=>/^(?!node)/.test(b)), browserProperty = !!anyBrowser && (!anyNode || null), nodeProperty = !!anyNode && (!anyBrowser || null), es6DynamicImport = rawChecker({
|
@@ -9104,7 +8822,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
9104
8822
|
}, getBrowserslistTargetHandler = memoize(()=>browserslistTargetHandler_namespaceObject), hasBrowserslistConfig = (context)=>{
|
9105
8823
|
let { findConfig } = __webpack_require__("browserslist-load-config");
|
9106
8824
|
return !!findConfig(context);
|
9107
|
-
},
|
8825
|
+
}, versionDependent = (major, minor)=>{
|
9108
8826
|
if (!major) return ()=>void 0;
|
9109
8827
|
let nMajor = +major, nMinor = minor ? +minor : 0;
|
9110
8828
|
return (vMajor, vMinor = 0)=>nMajor > vMajor || nMajor === vMajor && nMinor >= vMinor;
|
@@ -9304,27 +9022,28 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9304
9022
|
}
|
9305
9023
|
}
|
9306
9024
|
throw Error(`Unknown target '${target}'. The following targets are supported:\n${TARGETS.map(([name, description])=>`* ${name}: ${description}`).join("\n")}`);
|
9307
|
-
},
|
9308
|
-
let
|
9309
|
-
|
9310
|
-
let result = {};
|
9311
|
-
for (let key of keys){
|
9312
|
-
let hasTrue = !1, hasFalse = !1;
|
9313
|
-
for (let tp of targetProperties)switch(tp[key]){
|
9314
|
-
case !0:
|
9315
|
-
hasTrue = !0;
|
9316
|
-
break;
|
9317
|
-
case !1:
|
9318
|
-
hasFalse = !0;
|
9319
|
-
}
|
9320
|
-
(hasTrue || hasFalse) && (result[key] = hasFalse && hasTrue ? null : hasTrue);
|
9321
|
-
}
|
9322
|
-
return result;
|
9323
|
-
}, getTargetsProperties = (targets, context)=>mergeTargetProperties(targets.map((t)=>getTargetProperties(t, context))), applyRspackOptionsDefaults = (options)=>{
|
9324
|
-
defaults_F(options, "context", ()=>process.cwd()), defaults_F(options, "target", ()=>getDefaultTarget(options.context));
|
9025
|
+
}, applyRspackOptionsDefaults = (options)=>{
|
9026
|
+
let targets, context;
|
9027
|
+
defaults_F(options, "context", ()=>process.cwd()), defaults_F(options, "target", ()=>hasBrowserslistConfig(options.context) ? "browserslist" : "web");
|
9325
9028
|
let { mode, target } = options;
|
9326
9029
|
external_node_assert_default()(!isNil(target));
|
9327
|
-
let targetProperties = !1 !== target && ("string" == typeof target ? getTargetProperties(target, options.context) :
|
9030
|
+
let targetProperties = !1 !== target && ("string" == typeof target ? getTargetProperties(target, options.context) : (targets = target, context = options.context, ((targetProperties)=>{
|
9031
|
+
let keys = new Set();
|
9032
|
+
for (let tp of targetProperties)for (let key of Object.keys(tp))keys.add(key);
|
9033
|
+
let result = {};
|
9034
|
+
for (let key of keys){
|
9035
|
+
let hasTrue = !1, hasFalse = !1;
|
9036
|
+
for (let tp of targetProperties)switch(tp[key]){
|
9037
|
+
case !0:
|
9038
|
+
hasTrue = !0;
|
9039
|
+
break;
|
9040
|
+
case !1:
|
9041
|
+
hasFalse = !0;
|
9042
|
+
}
|
9043
|
+
(hasTrue || hasFalse) && (result[key] = hasFalse && hasTrue ? null : hasTrue);
|
9044
|
+
}
|
9045
|
+
return result;
|
9046
|
+
})(targets.map((t)=>getTargetProperties(t, context))))), development = "development" === mode, production = "production" === mode || !mode;
|
9328
9047
|
if ("function" != typeof options.entry) for (let key of Object.keys(options.entry))defaults_F(options.entry[key], "import", ()=>[
|
9329
9048
|
"./src"
|
9330
9049
|
]);
|
@@ -9368,8 +9087,6 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9368
9087
|
mode: options.mode,
|
9369
9088
|
css: options.experiments.css
|
9370
9089
|
}), options.resolve), options.resolveLoader = cleverMerge(getResolveLoaderDefaults(), options.resolveLoader);
|
9371
|
-
}, applyRspackOptionsBaseDefaults = (options)=>{
|
9372
|
-
defaults_F(options, "context", ()=>process.cwd()), applyInfrastructureLoggingDefaults(options.infrastructureLogging);
|
9373
9090
|
}, applyInfrastructureLoggingDefaults = (infrastructureLogging)=>{
|
9374
9091
|
defaults_F(infrastructureLogging, "stream", ()=>process.stderr);
|
9375
9092
|
let tty = infrastructureLogging.stream.isTTY && "dumb" !== process.env.TERM;
|
@@ -9377,15 +9094,12 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9377
9094
|
}, applyExperimentsDefaults = (experiments, { production, development })=>{
|
9378
9095
|
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);
|
9379
9096
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
9380
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.
|
9381
|
-
}, applySnapshotDefaults = (_snapshot, _env)=>{},
|
9382
|
-
|
9097
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.7-alpha.1"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
9098
|
+
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
|
9099
|
+
var parserOptions;
|
9100
|
+
if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), D(parserOptions = module.parser.javascript, "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", [
|
9383
9101
|
"..."
|
9384
|
-
]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", !1), D(parserOptions, "typeReexportsPresence", "no-tolerant")
|
9385
|
-
}, applyJsonGeneratorOptionsDefaults = (generatorOptions)=>{
|
9386
|
-
D(generatorOptions, "JSONParse", !0);
|
9387
|
-
}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
|
9388
|
-
if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), applyJavascriptParserOptionsDefaults(module.parser.javascript), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), applyJsonGeneratorOptionsDefaults(module.generator.json), css) {
|
9102
|
+
]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", !1), D(parserOptions, "typeReexportsPresence", "no-tolerant"), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, "JSONParse", !0), css) {
|
9389
9103
|
defaults_F(module.parser, "css", ()=>({})), assertNotNill(module.parser.css), D(module.parser.css, "namedExports", !0), D(module.parser.css, "url", !0), defaults_F(module.parser, "css/auto", ()=>({})), assertNotNill(module.parser["css/auto"]), D(module.parser["css/auto"], "namedExports", !0), D(module.parser["css/auto"], "url", !0), defaults_F(module.parser, "css/module", ()=>({})), assertNotNill(module.parser["css/module"]), D(module.parser["css/module"], "namedExports", !0), D(module.parser["css/module"], "url", !0), defaults_F(module.generator, "css", ()=>({})), assertNotNill(module.generator.css), D(module.generator.css, "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator.css, "esModule", !0), defaults_F(module.generator, "css/auto", ()=>({})), assertNotNill(module.generator["css/auto"]), D(module.generator["css/auto"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/auto"], "exportsConvention", "as-is");
|
9390
9104
|
let localIdentName = uniqueName && uniqueName.length > 0 ? "[uniqueName]-[id]-[local]" : "[id]-[local]";
|
9391
9105
|
D(module.generator["css/auto"], "localIdentName", localIdentName), D(module.generator["css/auto"], "esModule", !0), defaults_F(module.generator, "css/module", ()=>({})), assertNotNill(module.generator["css/module"]), D(module.generator["css/module"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/module"], "exportsConvention", "as-is"), D(module.generator["css/module"], "localIdentName", localIdentName), D(module.generator["css/module"], "esModule", !0);
|
@@ -9525,8 +9239,38 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9525
9239
|
return "";
|
9526
9240
|
}
|
9527
9241
|
}), defaults_F(output, "devtoolNamespace", ()=>output.uniqueName), defaults_F(output, "module", ()=>!!outputModule);
|
9528
|
-
let environment = output.environment,
|
9529
|
-
defaults_F(environment, "globalThis", ()=>tp?.globalThis), defaults_F(environment, "bigIntLiteral", ()=>
|
9242
|
+
let environment = output.environment, conditionallyOptimistic = (v, c)=>void 0 === v && c || v;
|
9243
|
+
defaults_F(environment, "globalThis", ()=>tp?.globalThis), defaults_F(environment, "bigIntLiteral", ()=>{
|
9244
|
+
let v;
|
9245
|
+
return tp && ((v = tp.bigIntLiteral) || void 0 === v);
|
9246
|
+
}), defaults_F(environment, "const", ()=>{
|
9247
|
+
let v;
|
9248
|
+
return tp && ((v = tp.const) || void 0 === v);
|
9249
|
+
}), defaults_F(environment, "arrowFunction", ()=>{
|
9250
|
+
let v;
|
9251
|
+
return tp && ((v = tp.arrowFunction) || void 0 === v);
|
9252
|
+
}), defaults_F(environment, "asyncFunction", ()=>{
|
9253
|
+
let v;
|
9254
|
+
return tp && ((v = tp.asyncFunction) || void 0 === v);
|
9255
|
+
}), defaults_F(environment, "forOf", ()=>{
|
9256
|
+
let v;
|
9257
|
+
return tp && ((v = tp.forOf) || void 0 === v);
|
9258
|
+
}), defaults_F(environment, "destructuring", ()=>{
|
9259
|
+
let v;
|
9260
|
+
return tp && ((v = tp.destructuring) || void 0 === v);
|
9261
|
+
}), defaults_F(environment, "optionalChaining", ()=>{
|
9262
|
+
let v;
|
9263
|
+
return tp && ((v = tp.optionalChaining) || void 0 === v);
|
9264
|
+
}), defaults_F(environment, "nodePrefixForCoreModules", ()=>{
|
9265
|
+
let v;
|
9266
|
+
return tp && ((v = tp.nodePrefixForCoreModules) || void 0 === v);
|
9267
|
+
}), defaults_F(environment, "templateLiteral", ()=>{
|
9268
|
+
let v;
|
9269
|
+
return tp && ((v = tp.templateLiteral) || void 0 === v);
|
9270
|
+
}), defaults_F(environment, "dynamicImport", ()=>conditionallyOptimistic(tp?.dynamicImport, output.module)), defaults_F(environment, "dynamicImportInWorker", ()=>conditionallyOptimistic(tp?.dynamicImportInWorker, output.module)), defaults_F(environment, "module", ()=>conditionallyOptimistic(tp?.module, output.module)), defaults_F(environment, "document", ()=>{
|
9271
|
+
let v;
|
9272
|
+
return tp && ((v = tp.document) || void 0 === v);
|
9273
|
+
}), D(output, "filename", output.module ? "[name].mjs" : "[name].js"), defaults_F(output, "iife", ()=>!output.module), defaults_F(output, "chunkFilename", ()=>{
|
9530
9274
|
let filename = output.filename;
|
9531
9275
|
if ("function" != typeof filename) {
|
9532
9276
|
let hasName = filename.includes("[name]"), hasId = filename.includes("[id]"), hasChunkHash = filename.includes("[chunkhash]"), hasContentHash = filename.includes("[contenthash]");
|
@@ -9650,7 +9394,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9650
9394
|
] : [
|
9651
9395
|
"javascript",
|
9652
9396
|
"unknown"
|
9653
|
-
]), D(splitChunks, "hidePathInfo", production), D(splitChunks, "chunks", "async"), D(splitChunks, "usedExports", !0 === optimization.usedExports), D(splitChunks, "minChunks", 1), defaults_F(splitChunks, "minSize", ()=>production ? 20000 : 10000), defaults_F(splitChunks, "maxAsyncRequests", ()=>production ? 30 :
|
9397
|
+
]), D(splitChunks, "hidePathInfo", production), D(splitChunks, "chunks", "async"), D(splitChunks, "usedExports", !0 === optimization.usedExports), D(splitChunks, "minChunks", 1), defaults_F(splitChunks, "minSize", ()=>production ? 20000 : 10000), defaults_F(splitChunks, "maxAsyncRequests", ()=>production ? 30 : 1 / 0), defaults_F(splitChunks, "maxInitialRequests", ()=>production ? 30 : 1 / 0), D(splitChunks, "automaticNameDelimiter", "-");
|
9654
9398
|
let { cacheGroups } = splitChunks;
|
9655
9399
|
cacheGroups && (defaults_F(cacheGroups, "default", ()=>({
|
9656
9400
|
idHint: "",
|
@@ -10255,97 +9999,17 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10255
9999
|
this.suspended && (this.suspended = !1, this.#invalidate());
|
10256
10000
|
}
|
10257
10001
|
}
|
10258
|
-
let CORE_VERSION = "1.4.
|
10002
|
+
let CORE_VERSION = "1.4.7-alpha.1", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
10259
10003
|
|
10260
10004
|
Help:
|
10261
|
-
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
10262
|
-
|
10005
|
+
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
10006
|
+
The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
|
10007
|
+
` : `Unmatched version @rspack/core@${coreVersion} and @rspack/binding@${expectedCoreVersion}.
|
10263
10008
|
|
10264
10009
|
Help:
|
10265
10010
|
Please ensure the version of @rspack/binding and @rspack/core is the same.
|
10266
|
-
|
10267
|
-
|
10268
|
-
return {
|
10269
|
-
registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration, function() {
|
10270
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeAssetTagGeneration;
|
10271
|
-
}, function(queried) {
|
10272
|
-
return async function(data) {
|
10273
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10274
|
-
...data,
|
10275
|
-
plugin: {
|
10276
|
-
options: getOptions(uid)
|
10277
|
-
}
|
10278
|
-
});
|
10279
|
-
return res.compilationId = compilationId, res.uid = uid, res;
|
10280
|
-
};
|
10281
|
-
}),
|
10282
|
-
registerHtmlPluginAlterAssetTagsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTags, function() {
|
10283
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTags;
|
10284
|
-
}, function(queried) {
|
10285
|
-
return async function(data) {
|
10286
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10287
|
-
...data,
|
10288
|
-
plugin: {
|
10289
|
-
options: getOptions(uid)
|
10290
|
-
}
|
10291
|
-
});
|
10292
|
-
return res.compilationId = compilationId, res.uid = uid, res;
|
10293
|
-
};
|
10294
|
-
}),
|
10295
|
-
registerHtmlPluginAlterAssetTagGroupsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups, function() {
|
10296
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTagGroups;
|
10297
|
-
}, function(queried) {
|
10298
|
-
return async function(data) {
|
10299
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10300
|
-
...data,
|
10301
|
-
plugin: {
|
10302
|
-
options: getOptions(uid)
|
10303
|
-
}
|
10304
|
-
});
|
10305
|
-
return res.compilationId = compilationId, res.uid = uid, res;
|
10306
|
-
};
|
10307
|
-
}),
|
10308
|
-
registerHtmlPluginAfterTemplateExecutionTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterTemplateExecution, function() {
|
10309
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterTemplateExecution;
|
10310
|
-
}, function(queried) {
|
10311
|
-
return async function(data) {
|
10312
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10313
|
-
...data,
|
10314
|
-
plugin: {
|
10315
|
-
options: getOptions(uid)
|
10316
|
-
}
|
10317
|
-
});
|
10318
|
-
return res.compilationId = compilationId, res;
|
10319
|
-
};
|
10320
|
-
}),
|
10321
|
-
registerHtmlPluginBeforeEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeEmit, function() {
|
10322
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeEmit;
|
10323
|
-
}, function(queried) {
|
10324
|
-
return async function(data) {
|
10325
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10326
|
-
...data,
|
10327
|
-
plugin: {
|
10328
|
-
options: getOptions(uid)
|
10329
|
-
}
|
10330
|
-
});
|
10331
|
-
return res.compilationId = compilationId, res.uid = uid, res;
|
10332
|
-
};
|
10333
|
-
}),
|
10334
|
-
registerHtmlPluginAfterEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterEmit, function() {
|
10335
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterEmit;
|
10336
|
-
}, function(queried) {
|
10337
|
-
return async function(data) {
|
10338
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10339
|
-
...data,
|
10340
|
-
plugin: {
|
10341
|
-
options: getOptions(uid)
|
10342
|
-
}
|
10343
|
-
});
|
10344
|
-
return res.compilationId = compilationId, res.uid = uid, res;
|
10345
|
-
};
|
10346
|
-
})
|
10347
|
-
};
|
10348
|
-
}, RESERVED_RUNTIME_GLOBALS = new Map();
|
10011
|
+
The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
|
10012
|
+
`, RESERVED_RUNTIME_GLOBALS = new Map();
|
10349
10013
|
function __from_binding_runtime_globals(runtimeRequirements) {
|
10350
10014
|
let res = new Set();
|
10351
10015
|
for (let flag of runtimeRequirements.value)flag in RuntimeGlobals ? res.add(RuntimeGlobals[flag]) : res.add(flag);
|
@@ -10434,7 +10098,6 @@ Help:
|
|
10434
10098
|
asyncModule: "__webpack_require__.a"
|
10435
10099
|
};
|
10436
10100
|
for (let entry of Object.entries(RuntimeGlobals))RESERVED_RUNTIME_GLOBALS.set(entry[1], entry[0]);
|
10437
|
-
let isReservedRuntimeGlobal = (r)=>RESERVED_RUNTIME_GLOBALS.has(r);
|
10438
10101
|
class CodeGenerationResult {
|
10439
10102
|
#inner;
|
10440
10103
|
constructor(result){
|
@@ -10444,263 +10107,21 @@ Help:
|
|
10444
10107
|
return this.#inner.sources[sourceType];
|
10445
10108
|
}
|
10446
10109
|
}
|
10447
|
-
|
10448
|
-
|
10449
|
-
|
10450
|
-
|
10451
|
-
|
10452
|
-
|
10453
|
-
|
10454
|
-
|
10455
|
-
|
10456
|
-
|
10457
|
-
|
10458
|
-
|
10459
|
-
|
10460
|
-
|
10461
|
-
|
10462
|
-
let set = __from_binding_runtime_globals(runtimeRequirements), all = __from_binding_runtime_globals(allRuntimeRequirements), customRuntimeGlobals = new Set(), originalAdd = all.add.bind(all), add = function(r) {
|
10463
|
-
return all.has(r) ? all : (isReservedRuntimeGlobal(r) || customRuntimeGlobals.add(r), originalAdd(r));
|
10464
|
-
};
|
10465
|
-
for (let r of (all.add = add.bind(add), set))queried.for(r).call(chunk, all);
|
10466
|
-
for (let r of customRuntimeGlobals)queried.for(r).call(chunk, all);
|
10467
|
-
return {
|
10468
|
-
allRuntimeRequirements: __to_binding_runtime_globals(all)
|
10469
|
-
};
|
10470
|
-
};
|
10471
|
-
}),
|
10472
|
-
registerCompilationRuntimeModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationRuntimeModule, function() {
|
10473
|
-
return getCompiler().__internal__get_compilation().hooks.runtimeModule;
|
10474
|
-
}, function(queried) {
|
10475
|
-
return function({ module, chunk }) {
|
10476
|
-
let originSource = module.source?.source;
|
10477
|
-
queried.call(module, chunk);
|
10478
|
-
let newSource = module.source?.source;
|
10479
|
-
if (newSource && newSource !== originSource) return module;
|
10480
|
-
};
|
10481
|
-
}),
|
10482
|
-
registerCompilationBuildModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationBuildModule, function() {
|
10483
|
-
return getCompiler().__internal__get_compilation().hooks.buildModule;
|
10484
|
-
}, function(queried) {
|
10485
|
-
return function(module) {
|
10486
|
-
return queried.call(module);
|
10487
|
-
};
|
10488
|
-
}),
|
10489
|
-
registerCompilationStillValidModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationStillValidModule, function() {
|
10490
|
-
return getCompiler().__internal__get_compilation().hooks.stillValidModule;
|
10491
|
-
}, function(queried) {
|
10492
|
-
return function(module) {
|
10493
|
-
return queried.call(module);
|
10494
|
-
};
|
10495
|
-
}),
|
10496
|
-
registerCompilationSucceedModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationSucceedModule, function() {
|
10497
|
-
return getCompiler().__internal__get_compilation().hooks.succeedModule;
|
10498
|
-
}, function(queried) {
|
10499
|
-
return function(module) {
|
10500
|
-
return queried.call(module);
|
10501
|
-
};
|
10502
|
-
}),
|
10503
|
-
registerCompilationExecuteModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationExecuteModule, function() {
|
10504
|
-
return getCompiler().__internal__get_compilation().hooks.executeModule;
|
10505
|
-
}, function(queried) {
|
10506
|
-
return function({ entry, id, codegenResults, runtimeModules }) {
|
10507
|
-
try {
|
10508
|
-
let __nested_webpack_require_4786_4805__ = (id)=>{
|
10509
|
-
let cached = moduleCache[id];
|
10510
|
-
if (void 0 !== cached) {
|
10511
|
-
if (cached.error) throw cached.error;
|
10512
|
-
return cached.exports;
|
10513
|
-
}
|
10514
|
-
let execOptions = {
|
10515
|
-
id,
|
10516
|
-
module: {
|
10517
|
-
id,
|
10518
|
-
exports: {},
|
10519
|
-
loaded: !1,
|
10520
|
-
error: void 0
|
10521
|
-
},
|
10522
|
-
require: __nested_webpack_require_4786_4805__
|
10523
|
-
};
|
10524
|
-
for (let handler of interceptModuleExecution)handler(execOptions);
|
10525
|
-
let result = codegenResults.map[id]["build time"], moduleObject = execOptions.module;
|
10526
|
-
return id && (moduleCache[id] = moduleObject), tryRunOrWebpackError(()=>queried.call({
|
10527
|
-
codeGenerationResult: new CodeGenerationResult(result),
|
10528
|
-
moduleObject
|
10529
|
-
}, {
|
10530
|
-
__webpack_require__: __nested_webpack_require_4786_4805__
|
10531
|
-
}), "Compilation.hooks.executeModule"), moduleObject.loaded = !0, moduleObject.exports;
|
10532
|
-
}, moduleCache = __nested_webpack_require_4786_4805__[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {}, interceptModuleExecution = __nested_webpack_require_4786_4805__[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
|
10533
|
-
for (let runtimeModule of runtimeModules)__nested_webpack_require_4786_4805__(runtimeModule);
|
10534
|
-
let executeResult = __nested_webpack_require_4786_4805__(entry);
|
10535
|
-
getCompiler().__internal__get_module_execution_results_map().set(id, executeResult);
|
10536
|
-
} catch (e) {
|
10537
|
-
throw getCompiler().__internal__get_module_execution_results_map().set(id, e), e;
|
10538
|
-
}
|
10539
|
-
};
|
10540
|
-
}),
|
10541
|
-
registerCompilationFinishModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationFinishModules, function() {
|
10542
|
-
return getCompiler().__internal__get_compilation().hooks.finishModules;
|
10543
|
-
}, function(queried) {
|
10544
|
-
return async function() {
|
10545
|
-
return await queried.promise(getCompiler().__internal__get_compilation().modules);
|
10546
|
-
};
|
10547
|
-
}),
|
10548
|
-
registerCompilationOptimizeModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeModules, function() {
|
10549
|
-
return getCompiler().__internal__get_compilation().hooks.optimizeModules;
|
10550
|
-
}, function(queried) {
|
10551
|
-
return function() {
|
10552
|
-
return queried.call(getCompiler().__internal__get_compilation().modules.values());
|
10553
|
-
};
|
10554
|
-
}),
|
10555
|
-
registerCompilationAfterOptimizeModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterOptimizeModules, function() {
|
10556
|
-
return getCompiler().__internal__get_compilation().hooks.afterOptimizeModules;
|
10557
|
-
}, function(queried) {
|
10558
|
-
return function() {
|
10559
|
-
queried.call(getCompiler().__internal__get_compilation().modules.values());
|
10560
|
-
};
|
10561
|
-
}),
|
10562
|
-
registerCompilationOptimizeTreeTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeTree, function() {
|
10563
|
-
return getCompiler().__internal__get_compilation().hooks.optimizeTree;
|
10564
|
-
}, function(queried) {
|
10565
|
-
return async function() {
|
10566
|
-
return await queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
|
10567
|
-
};
|
10568
|
-
}),
|
10569
|
-
registerCompilationOptimizeChunkModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeChunkModules, function() {
|
10570
|
-
return getCompiler().__internal__get_compilation().hooks.optimizeChunkModules;
|
10571
|
-
}, function(queried) {
|
10572
|
-
return async function() {
|
10573
|
-
return await queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
|
10574
|
-
};
|
10575
|
-
}),
|
10576
|
-
registerCompilationChunkHashTaps: createTap(binding_.RegisterJsTapKind.CompilationChunkHash, function() {
|
10577
|
-
return getCompiler().__internal__get_compilation().hooks.chunkHash;
|
10578
|
-
}, function(queried) {
|
10579
|
-
return function(chunk) {
|
10580
|
-
let digestResult;
|
10581
|
-
if (!getCompiler().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
|
10582
|
-
let hash = createHash(getCompiler().options.output.hashFunction);
|
10583
|
-
return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler().options.output.hashDigest ? hash.digest(getCompiler().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
|
10584
|
-
};
|
10585
|
-
}),
|
10586
|
-
registerCompilationChunkAssetTaps: createTap(binding_.RegisterJsTapKind.CompilationChunkAsset, function() {
|
10587
|
-
return getCompiler().__internal__get_compilation().hooks.chunkAsset;
|
10588
|
-
}, function(queried) {
|
10589
|
-
return function({ chunk, filename }) {
|
10590
|
-
return queried.call(chunk, filename);
|
10591
|
-
};
|
10592
|
-
}),
|
10593
|
-
registerCompilationProcessAssetsTaps: createTap(binding_.RegisterJsTapKind.CompilationProcessAssets, function() {
|
10594
|
-
return getCompiler().__internal__get_compilation().hooks.processAssets;
|
10595
|
-
}, function(queried) {
|
10596
|
-
return async function() {
|
10597
|
-
return await queried.promise(getCompiler().__internal__get_compilation().assets);
|
10598
|
-
};
|
10599
|
-
}),
|
10600
|
-
registerCompilationAfterProcessAssetsTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterProcessAssets, function() {
|
10601
|
-
return getCompiler().__internal__get_compilation().hooks.afterProcessAssets;
|
10602
|
-
}, function(queried) {
|
10603
|
-
return function() {
|
10604
|
-
return queried.call(getCompiler().__internal__get_compilation().assets);
|
10605
|
-
};
|
10606
|
-
}),
|
10607
|
-
registerCompilationSealTaps: createTap(binding_.RegisterJsTapKind.CompilationSeal, function() {
|
10608
|
-
return getCompiler().__internal__get_compilation().hooks.seal;
|
10609
|
-
}, function(queried) {
|
10610
|
-
return function() {
|
10611
|
-
return queried.call();
|
10612
|
-
};
|
10613
|
-
}),
|
10614
|
-
registerCompilationAfterSealTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterSeal, function() {
|
10615
|
-
return getCompiler().__internal__get_compilation().hooks.afterSeal;
|
10616
|
-
}, function(queried) {
|
10617
|
-
return async function() {
|
10618
|
-
return await queried.promise();
|
10619
|
-
};
|
10620
|
-
})
|
10621
|
-
}), createCompilerHooksRegisters = (getCompiler, createTap, createMapTap)=>({
|
10622
|
-
registerCompilerThisCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerThisCompilation, function() {
|
10623
|
-
return getCompiler().hooks.thisCompilation;
|
10624
|
-
}, function(queried) {
|
10625
|
-
return function(native) {
|
10626
|
-
return getCompiler().__internal__create_compilation(native), queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
|
10627
|
-
};
|
10628
|
-
}),
|
10629
|
-
registerCompilerCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerCompilation, function() {
|
10630
|
-
return getCompiler().hooks.compilation;
|
10631
|
-
}, function(queried) {
|
10632
|
-
return function() {
|
10633
|
-
return queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
|
10634
|
-
};
|
10635
|
-
}),
|
10636
|
-
registerCompilerMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerMake, function() {
|
10637
|
-
return getCompiler().hooks.make;
|
10638
|
-
}, function(queried) {
|
10639
|
-
return async function() {
|
10640
|
-
return await queried.promise(getCompiler().__internal__get_compilation());
|
10641
|
-
};
|
10642
|
-
}),
|
10643
|
-
registerCompilerFinishMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerFinishMake, function() {
|
10644
|
-
return getCompiler().hooks.finishMake;
|
10645
|
-
}, function(queried) {
|
10646
|
-
return async function() {
|
10647
|
-
return await queried.promise(getCompiler().__internal__get_compilation());
|
10648
|
-
};
|
10649
|
-
}),
|
10650
|
-
registerCompilerShouldEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerShouldEmit, function() {
|
10651
|
-
return getCompiler().hooks.shouldEmit;
|
10652
|
-
}, function(queried) {
|
10653
|
-
return function() {
|
10654
|
-
return queried.call(getCompiler().__internal__get_compilation());
|
10655
|
-
};
|
10656
|
-
}),
|
10657
|
-
registerCompilerEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerEmit, function() {
|
10658
|
-
return getCompiler().hooks.emit;
|
10659
|
-
}, function(queried) {
|
10660
|
-
return async function() {
|
10661
|
-
return await queried.promise(getCompiler().__internal__get_compilation());
|
10662
|
-
};
|
10663
|
-
}),
|
10664
|
-
registerCompilerAfterEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerAfterEmit, function() {
|
10665
|
-
return getCompiler().hooks.afterEmit;
|
10666
|
-
}, function(queried) {
|
10667
|
-
return async function() {
|
10668
|
-
return await queried.promise(getCompiler().__internal__get_compilation());
|
10669
|
-
};
|
10670
|
-
}),
|
10671
|
-
registerCompilerAssetEmittedTaps: createTap(binding_.RegisterJsTapKind.CompilerAssetEmitted, function() {
|
10672
|
-
return getCompiler().hooks.assetEmitted;
|
10673
|
-
}, function(queried) {
|
10674
|
-
return async function({ filename, targetPath, outputPath }) {
|
10675
|
-
return queried.promise(filename, {
|
10676
|
-
compilation: getCompiler().__internal__get_compilation(),
|
10677
|
-
targetPath,
|
10678
|
-
outputPath,
|
10679
|
-
get source () {
|
10680
|
-
return getCompiler().__internal__get_compilation().getAsset(filename)?.source;
|
10681
|
-
},
|
10682
|
-
get content () {
|
10683
|
-
return this.source?.buffer();
|
10684
|
-
}
|
10685
|
-
});
|
10686
|
-
};
|
10687
|
-
})
|
10688
|
-
});
|
10689
|
-
class ContextModuleFactoryBeforeResolveData {
|
10690
|
-
#inner;
|
10691
|
-
static __from_binding(binding) {
|
10692
|
-
return new ContextModuleFactoryBeforeResolveData(binding);
|
10693
|
-
}
|
10694
|
-
static __to_binding(data) {
|
10695
|
-
return data.#inner;
|
10696
|
-
}
|
10697
|
-
constructor(binding){
|
10698
|
-
this.#inner = binding, Object.defineProperties(this, {
|
10699
|
-
context: {
|
10700
|
-
enumerable: !0,
|
10701
|
-
get: ()=>binding.context,
|
10702
|
-
set (val) {
|
10703
|
-
binding.context = val;
|
10110
|
+
class ContextModuleFactoryBeforeResolveData {
|
10111
|
+
#inner;
|
10112
|
+
static __from_binding(binding) {
|
10113
|
+
return new ContextModuleFactoryBeforeResolveData(binding);
|
10114
|
+
}
|
10115
|
+
static __to_binding(data) {
|
10116
|
+
return data.#inner;
|
10117
|
+
}
|
10118
|
+
constructor(binding){
|
10119
|
+
this.#inner = binding, Object.defineProperties(this, {
|
10120
|
+
context: {
|
10121
|
+
enumerable: !0,
|
10122
|
+
get: ()=>binding.context,
|
10123
|
+
set (val) {
|
10124
|
+
binding.context = val;
|
10704
10125
|
}
|
10705
10126
|
},
|
10706
10127
|
request: {
|
@@ -10799,136 +10220,7 @@ Help:
|
|
10799
10220
|
return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
|
10800
10221
|
}
|
10801
10222
|
});
|
10802
|
-
let
|
10803
|
-
registerContextModuleFactoryBeforeResolveTaps: createTap(binding_.RegisterJsTapKind.ContextModuleFactoryBeforeResolve, function() {
|
10804
|
-
return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.beforeResolve;
|
10805
|
-
}, function(queried) {
|
10806
|
-
return async function(bindingData) {
|
10807
|
-
let data = !!bindingData && ContextModuleFactoryBeforeResolveData.__from_binding(bindingData), result = await queried.promise(data);
|
10808
|
-
return !!result && ContextModuleFactoryBeforeResolveData.__to_binding(result);
|
10809
|
-
};
|
10810
|
-
}),
|
10811
|
-
registerContextModuleFactoryAfterResolveTaps: createTap(binding_.RegisterJsTapKind.ContextModuleFactoryAfterResolve, function() {
|
10812
|
-
return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.afterResolve;
|
10813
|
-
}, function(queried) {
|
10814
|
-
return async function(bindingData) {
|
10815
|
-
let data = !!bindingData && ContextModuleFactoryAfterResolveData.__from_binding(bindingData), result = await queried.promise(data);
|
10816
|
-
return !!result && ContextModuleFactoryAfterResolveData.__to_binding(result);
|
10817
|
-
};
|
10818
|
-
})
|
10819
|
-
}), createJavaScriptModulesHooksRegisters = (getCompiler, createTap, createMapTap)=>({
|
10820
|
-
registerJavascriptModulesChunkHashTaps: createTap(binding_.RegisterJsTapKind.JavascriptModulesChunkHash, function() {
|
10821
|
-
return JavascriptModulesPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).chunkHash;
|
10822
|
-
}, function(queried) {
|
10823
|
-
return function(chunk) {
|
10824
|
-
let digestResult;
|
10825
|
-
if (!getCompiler().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
|
10826
|
-
let hash = createHash(getCompiler().options.output.hashFunction);
|
10827
|
-
return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler().options.output.hashDigest ? hash.digest(getCompiler().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
|
10828
|
-
};
|
10829
|
-
})
|
10830
|
-
}), createNormalModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap)=>({
|
10831
|
-
registerNormalModuleFactoryBeforeResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryBeforeResolve, function() {
|
10832
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
|
10833
|
-
}, function(queried) {
|
10834
|
-
return async function(resolveData) {
|
10835
|
-
let normalizedResolveData = {
|
10836
|
-
contextInfo: {
|
10837
|
-
issuer: resolveData.issuer,
|
10838
|
-
issuerLayer: resolveData.issuerLayer ?? null
|
10839
|
-
},
|
10840
|
-
request: resolveData.request,
|
10841
|
-
context: resolveData.context,
|
10842
|
-
fileDependencies: [],
|
10843
|
-
missingDependencies: [],
|
10844
|
-
contextDependencies: []
|
10845
|
-
}, ret = await queried.promise(normalizedResolveData);
|
10846
|
-
return resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, [
|
10847
|
-
ret,
|
10848
|
-
resolveData
|
10849
|
-
];
|
10850
|
-
};
|
10851
|
-
}),
|
10852
|
-
registerNormalModuleFactoryFactorizeTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryFactorize, function() {
|
10853
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
|
10854
|
-
}, function(queried) {
|
10855
|
-
return async function(resolveData) {
|
10856
|
-
let normalizedResolveData = {
|
10857
|
-
contextInfo: {
|
10858
|
-
issuer: resolveData.issuer,
|
10859
|
-
issuerLayer: resolveData.issuerLayer ?? null
|
10860
|
-
},
|
10861
|
-
request: resolveData.request,
|
10862
|
-
context: resolveData.context,
|
10863
|
-
fileDependencies: [],
|
10864
|
-
missingDependencies: [],
|
10865
|
-
contextDependencies: []
|
10866
|
-
};
|
10867
|
-
return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
|
10868
|
-
};
|
10869
|
-
}),
|
10870
|
-
registerNormalModuleFactoryResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryResolve, function() {
|
10871
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
|
10872
|
-
}, function(queried) {
|
10873
|
-
return async function(resolveData) {
|
10874
|
-
let normalizedResolveData = {
|
10875
|
-
contextInfo: {
|
10876
|
-
issuer: resolveData.issuer,
|
10877
|
-
issuerLayer: resolveData.issuerLayer ?? null
|
10878
|
-
},
|
10879
|
-
request: resolveData.request,
|
10880
|
-
context: resolveData.context,
|
10881
|
-
fileDependencies: [],
|
10882
|
-
missingDependencies: [],
|
10883
|
-
contextDependencies: []
|
10884
|
-
};
|
10885
|
-
return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
|
10886
|
-
};
|
10887
|
-
}),
|
10888
|
-
registerNormalModuleFactoryResolveForSchemeTaps: createMapTap(binding_.RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
|
10889
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolveForScheme;
|
10890
|
-
}, function(queried) {
|
10891
|
-
return async function(args) {
|
10892
|
-
return [
|
10893
|
-
await queried.for(args.scheme).promise(args.resourceData),
|
10894
|
-
args.resourceData
|
10895
|
-
];
|
10896
|
-
};
|
10897
|
-
}),
|
10898
|
-
registerNormalModuleFactoryAfterResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryAfterResolve, function() {
|
10899
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
|
10900
|
-
}, function(queried) {
|
10901
|
-
return async function(arg) {
|
10902
|
-
let data = {
|
10903
|
-
contextInfo: {
|
10904
|
-
issuer: arg.issuer,
|
10905
|
-
issuerLayer: arg.issuerLayer ?? null
|
10906
|
-
},
|
10907
|
-
request: arg.request,
|
10908
|
-
context: arg.context,
|
10909
|
-
fileDependencies: arg.fileDependencies,
|
10910
|
-
missingDependencies: arg.missingDependencies,
|
10911
|
-
contextDependencies: arg.contextDependencies,
|
10912
|
-
createData: arg.createData
|
10913
|
-
};
|
10914
|
-
return [
|
10915
|
-
await queried.promise(data),
|
10916
|
-
data.createData
|
10917
|
-
];
|
10918
|
-
};
|
10919
|
-
}),
|
10920
|
-
registerNormalModuleFactoryCreateModuleTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryCreateModule, function() {
|
10921
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.createModule;
|
10922
|
-
}, function(queried) {
|
10923
|
-
return async function(args) {
|
10924
|
-
let data = {
|
10925
|
-
...args,
|
10926
|
-
settings: {}
|
10927
|
-
};
|
10928
|
-
await queried.promise(data, {});
|
10929
|
-
};
|
10930
|
-
})
|
10931
|
-
}), traceHookPlugin_PLUGIN_NAME = "TraceHookPlugin", PLUGIN_PROCESS_NAME = "Plugin Analysis", makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
|
10223
|
+
let traceHookPlugin_PLUGIN_NAME = "TraceHookPlugin", PLUGIN_PROCESS_NAME = "Plugin Analysis", makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
|
10932
10224
|
register: (tapInfo)=>{
|
10933
10225
|
let { name, type, fn: internalFn } = tapInfo, newFn = name === traceHookPlugin_PLUGIN_NAME ? internalFn : makeNewTraceTapFn(compilerName, hookName, tracer, {
|
10934
10226
|
name,
|
@@ -11372,10 +10664,91 @@ Help:
|
|
11372
10664
|
return this.#compilationParams = params, params;
|
11373
10665
|
}
|
11374
10666
|
#getInstance(callback) {
|
11375
|
-
let error =
|
10667
|
+
let error = CORE_VERSION === binding_.EXPECTED_RSPACK_CORE_VERSION || CORE_VERSION.includes("canary") ? null : Error(bindingVersionCheck_errorMessage(CORE_VERSION, binding_.EXPECTED_RSPACK_CORE_VERSION));
|
11376
10668
|
if (error) return callback(error);
|
11377
10669
|
if (this.#instance) return callback(null, this.#instance);
|
11378
|
-
let options = this.options, rawOptions =
|
10670
|
+
let options = this.options, rawOptions = ((options, compiler)=>{
|
10671
|
+
var output, module, options1, parser, generator, stats;
|
10672
|
+
let mode = options.mode, experiments = options.experiments;
|
10673
|
+
return {
|
10674
|
+
name: options.name,
|
10675
|
+
mode,
|
10676
|
+
context: options.context,
|
10677
|
+
output: {
|
10678
|
+
...output = options.output,
|
10679
|
+
environment: function(environment = {}) {
|
10680
|
+
return {
|
10681
|
+
const: !!environment.const,
|
10682
|
+
arrowFunction: !!environment.arrowFunction,
|
10683
|
+
nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
|
10684
|
+
asyncFunction: !!environment.asyncFunction,
|
10685
|
+
bigIntLiteral: !!environment.bigIntLiteral,
|
10686
|
+
destructuring: !!environment.destructuring,
|
10687
|
+
document: !!environment.document,
|
10688
|
+
dynamicImport: !!environment.dynamicImport,
|
10689
|
+
forOf: !!environment.forOf,
|
10690
|
+
globalThis: !!environment.globalThis,
|
10691
|
+
module: !!environment.module,
|
10692
|
+
optionalChaining: !!environment.optionalChaining,
|
10693
|
+
templateLiteral: !!environment.templateLiteral
|
10694
|
+
};
|
10695
|
+
}(output.environment)
|
10696
|
+
},
|
10697
|
+
resolve: getRawResolve(options.resolve),
|
10698
|
+
resolveLoader: getRawResolve(options.resolveLoader),
|
10699
|
+
module: (module = options.module, options1 = {
|
10700
|
+
compiler,
|
10701
|
+
mode,
|
10702
|
+
context: options.context,
|
10703
|
+
experiments
|
10704
|
+
}, external_node_assert_default()(!isNil(module.defaultRules), "module.defaultRules should not be nil after defaults"), {
|
10705
|
+
rules: [
|
10706
|
+
{
|
10707
|
+
rules: module.defaultRules
|
10708
|
+
},
|
10709
|
+
{
|
10710
|
+
rules: module.rules
|
10711
|
+
}
|
10712
|
+
].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options1, "javascript/auto")),
|
10713
|
+
parser: Object.fromEntries(Object.entries(parser = module.parser).map(([k, v])=>[
|
10714
|
+
k,
|
10715
|
+
getRawParserOptions(v, k)
|
10716
|
+
]).filter(([k, v])=>void 0 !== v)),
|
10717
|
+
generator: Object.fromEntries(Object.entries(generator = module.generator).map(([k, v])=>[
|
10718
|
+
k,
|
10719
|
+
getRawGeneratorOptions(v, k)
|
10720
|
+
]).filter(([k, v])=>void 0 !== v)),
|
10721
|
+
noParse: module.noParse
|
10722
|
+
}),
|
10723
|
+
optimization: options.optimization,
|
10724
|
+
stats: {
|
10725
|
+
colors: function(options) {
|
10726
|
+
if ("boolean" == typeof options || "string" == typeof options) return presetToOptions(options);
|
10727
|
+
if (!options) return {};
|
10728
|
+
let obj = {
|
10729
|
+
...presetToOptions(options.preset),
|
10730
|
+
...options
|
10731
|
+
};
|
10732
|
+
return delete obj.preset, obj;
|
10733
|
+
}(stats = options.stats).colors ?? !1
|
10734
|
+
},
|
10735
|
+
cache: {
|
10736
|
+
type: options.cache ? "memory" : "disable"
|
10737
|
+
},
|
10738
|
+
experiments,
|
10739
|
+
node: function(node) {
|
10740
|
+
if (!1 !== node) return external_node_assert_default()(!isNil(node.__dirname) && !isNil(node.global) && !isNil(node.__filename)), {
|
10741
|
+
dirname: String(node.__dirname),
|
10742
|
+
filename: String(node.__filename),
|
10743
|
+
global: String(node.global)
|
10744
|
+
};
|
10745
|
+
}(options.node),
|
10746
|
+
profile: options.profile,
|
10747
|
+
amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
|
10748
|
+
bail: options.bail,
|
10749
|
+
__references: {}
|
10750
|
+
};
|
10751
|
+
})(options, this);
|
11379
10752
|
rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries());
|
11380
10753
|
let instanceBinding = __webpack_require__("@rspack/binding");
|
11381
10754
|
this.#registers = this.#createHooksRegisters();
|
@@ -11383,16 +10756,537 @@ Help:
|
|
11383
10756
|
this.#instance = new instanceBinding.JsCompiler(this.compilerPath, rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory)), callback(null, this.#instance);
|
11384
10757
|
}
|
11385
10758
|
#createHooksRegisters() {
|
11386
|
-
let ref = new WeakRef(this),
|
10759
|
+
let getCompiler, createTap, getCompiler1, createTap1, createMapTap, getCompiler2, createTap2, createMapTap1, getCompiler3, createTap3, getCompiler4, getCompiler5, createTap4, getCompiler6, createTap5, ref = new WeakRef(this), getCompiler7 = ()=>ref.deref(), createTap6 = this.#createHookRegisterTaps.bind(this), createMapTap2 = this.#createHookMapRegisterTaps.bind(this);
|
11387
10760
|
return {
|
11388
|
-
...
|
11389
|
-
|
11390
|
-
|
11391
|
-
|
11392
|
-
|
11393
|
-
|
11394
|
-
|
11395
|
-
|
10761
|
+
...(getCompiler = getCompiler7, {
|
10762
|
+
registerCompilerThisCompilationTaps: (createTap = createTap6)(binding_.RegisterJsTapKind.CompilerThisCompilation, function() {
|
10763
|
+
return getCompiler().hooks.thisCompilation;
|
10764
|
+
}, function(queried) {
|
10765
|
+
return function(native) {
|
10766
|
+
return getCompiler().__internal__create_compilation(native), queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
|
10767
|
+
};
|
10768
|
+
}),
|
10769
|
+
registerCompilerCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerCompilation, function() {
|
10770
|
+
return getCompiler().hooks.compilation;
|
10771
|
+
}, function(queried) {
|
10772
|
+
return function() {
|
10773
|
+
return queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
|
10774
|
+
};
|
10775
|
+
}),
|
10776
|
+
registerCompilerMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerMake, function() {
|
10777
|
+
return getCompiler().hooks.make;
|
10778
|
+
}, function(queried) {
|
10779
|
+
return async function() {
|
10780
|
+
return await queried.promise(getCompiler().__internal__get_compilation());
|
10781
|
+
};
|
10782
|
+
}),
|
10783
|
+
registerCompilerFinishMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerFinishMake, function() {
|
10784
|
+
return getCompiler().hooks.finishMake;
|
10785
|
+
}, function(queried) {
|
10786
|
+
return async function() {
|
10787
|
+
return await queried.promise(getCompiler().__internal__get_compilation());
|
10788
|
+
};
|
10789
|
+
}),
|
10790
|
+
registerCompilerShouldEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerShouldEmit, function() {
|
10791
|
+
return getCompiler().hooks.shouldEmit;
|
10792
|
+
}, function(queried) {
|
10793
|
+
return function() {
|
10794
|
+
return queried.call(getCompiler().__internal__get_compilation());
|
10795
|
+
};
|
10796
|
+
}),
|
10797
|
+
registerCompilerEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerEmit, function() {
|
10798
|
+
return getCompiler().hooks.emit;
|
10799
|
+
}, function(queried) {
|
10800
|
+
return async function() {
|
10801
|
+
return await queried.promise(getCompiler().__internal__get_compilation());
|
10802
|
+
};
|
10803
|
+
}),
|
10804
|
+
registerCompilerAfterEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerAfterEmit, function() {
|
10805
|
+
return getCompiler().hooks.afterEmit;
|
10806
|
+
}, function(queried) {
|
10807
|
+
return async function() {
|
10808
|
+
return await queried.promise(getCompiler().__internal__get_compilation());
|
10809
|
+
};
|
10810
|
+
}),
|
10811
|
+
registerCompilerAssetEmittedTaps: createTap(binding_.RegisterJsTapKind.CompilerAssetEmitted, function() {
|
10812
|
+
return getCompiler().hooks.assetEmitted;
|
10813
|
+
}, function(queried) {
|
10814
|
+
return async function({ filename, targetPath, outputPath }) {
|
10815
|
+
return queried.promise(filename, {
|
10816
|
+
compilation: getCompiler().__internal__get_compilation(),
|
10817
|
+
targetPath,
|
10818
|
+
outputPath,
|
10819
|
+
get source () {
|
10820
|
+
return getCompiler().__internal__get_compilation().getAsset(filename)?.source;
|
10821
|
+
},
|
10822
|
+
get content () {
|
10823
|
+
return this.source?.buffer();
|
10824
|
+
}
|
10825
|
+
});
|
10826
|
+
};
|
10827
|
+
})
|
10828
|
+
}),
|
10829
|
+
...(getCompiler1 = getCompiler7, createTap1 = createTap6, createMapTap = createMapTap2, {
|
10830
|
+
registerCompilationAdditionalTreeRuntimeRequirementsTaps: createTap1(binding_.RegisterJsTapKind.CompilationAdditionalTreeRuntimeRequirements, function() {
|
10831
|
+
return getCompiler1().__internal__get_compilation().hooks.additionalTreeRuntimeRequirements;
|
10832
|
+
}, function(queried) {
|
10833
|
+
return function({ chunk, runtimeRequirements }) {
|
10834
|
+
let set = __from_binding_runtime_globals(runtimeRequirements);
|
10835
|
+
return queried.call(chunk, set), {
|
10836
|
+
runtimeRequirements: __to_binding_runtime_globals(set)
|
10837
|
+
};
|
10838
|
+
};
|
10839
|
+
}),
|
10840
|
+
registerCompilationRuntimeRequirementInTreeTaps: createMapTap(binding_.RegisterJsTapKind.CompilationRuntimeRequirementInTree, function() {
|
10841
|
+
return getCompiler1().__internal__get_compilation().hooks.runtimeRequirementInTree;
|
10842
|
+
}, function(queried) {
|
10843
|
+
return function({ chunk, allRuntimeRequirements, runtimeRequirements }) {
|
10844
|
+
let set = __from_binding_runtime_globals(runtimeRequirements), all = __from_binding_runtime_globals(allRuntimeRequirements), customRuntimeGlobals = new Set(), originalAdd = all.add.bind(all), add = function(r) {
|
10845
|
+
let r1;
|
10846
|
+
return all.has(r) ? all : (r1 = r, RESERVED_RUNTIME_GLOBALS.has(r1) || customRuntimeGlobals.add(r), originalAdd(r));
|
10847
|
+
};
|
10848
|
+
for (let r of (all.add = add.bind(add), set))queried.for(r).call(chunk, all);
|
10849
|
+
for (let r of customRuntimeGlobals)queried.for(r).call(chunk, all);
|
10850
|
+
return {
|
10851
|
+
allRuntimeRequirements: __to_binding_runtime_globals(all)
|
10852
|
+
};
|
10853
|
+
};
|
10854
|
+
}),
|
10855
|
+
registerCompilationRuntimeModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationRuntimeModule, function() {
|
10856
|
+
return getCompiler1().__internal__get_compilation().hooks.runtimeModule;
|
10857
|
+
}, function(queried) {
|
10858
|
+
return function({ module, chunk }) {
|
10859
|
+
let originSource = module.source?.source;
|
10860
|
+
queried.call(module, chunk);
|
10861
|
+
let newSource = module.source?.source;
|
10862
|
+
if (newSource && newSource !== originSource) return module;
|
10863
|
+
};
|
10864
|
+
}),
|
10865
|
+
registerCompilationBuildModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationBuildModule, function() {
|
10866
|
+
return getCompiler1().__internal__get_compilation().hooks.buildModule;
|
10867
|
+
}, function(queried) {
|
10868
|
+
return function(module) {
|
10869
|
+
return queried.call(module);
|
10870
|
+
};
|
10871
|
+
}),
|
10872
|
+
registerCompilationStillValidModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationStillValidModule, function() {
|
10873
|
+
return getCompiler1().__internal__get_compilation().hooks.stillValidModule;
|
10874
|
+
}, function(queried) {
|
10875
|
+
return function(module) {
|
10876
|
+
return queried.call(module);
|
10877
|
+
};
|
10878
|
+
}),
|
10879
|
+
registerCompilationSucceedModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationSucceedModule, function() {
|
10880
|
+
return getCompiler1().__internal__get_compilation().hooks.succeedModule;
|
10881
|
+
}, function(queried) {
|
10882
|
+
return function(module) {
|
10883
|
+
return queried.call(module);
|
10884
|
+
};
|
10885
|
+
}),
|
10886
|
+
registerCompilationExecuteModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationExecuteModule, function() {
|
10887
|
+
return getCompiler1().__internal__get_compilation().hooks.executeModule;
|
10888
|
+
}, function(queried) {
|
10889
|
+
return function({ entry, id, codegenResults, runtimeModules }) {
|
10890
|
+
try {
|
10891
|
+
let __nested_webpack_require_4786_4805__ = (id)=>{
|
10892
|
+
let cached = moduleCache[id];
|
10893
|
+
if (void 0 !== cached) {
|
10894
|
+
if (cached.error) throw cached.error;
|
10895
|
+
return cached.exports;
|
10896
|
+
}
|
10897
|
+
let execOptions = {
|
10898
|
+
id,
|
10899
|
+
module: {
|
10900
|
+
id,
|
10901
|
+
exports: {},
|
10902
|
+
loaded: !1,
|
10903
|
+
error: void 0
|
10904
|
+
},
|
10905
|
+
require: __nested_webpack_require_4786_4805__
|
10906
|
+
};
|
10907
|
+
for (let handler of interceptModuleExecution)handler(execOptions);
|
10908
|
+
let result = codegenResults.map[id]["build time"], moduleObject = execOptions.module;
|
10909
|
+
return id && (moduleCache[id] = moduleObject), ((fn, hook)=>{
|
10910
|
+
try {
|
10911
|
+
fn();
|
10912
|
+
} catch (err) {
|
10913
|
+
if (err instanceof WebpackError) throw err;
|
10914
|
+
throw new HookWebpackError(err, hook);
|
10915
|
+
}
|
10916
|
+
})(()=>queried.call({
|
10917
|
+
codeGenerationResult: new CodeGenerationResult(result),
|
10918
|
+
moduleObject
|
10919
|
+
}, {
|
10920
|
+
__webpack_require__: __nested_webpack_require_4786_4805__
|
10921
|
+
}), "Compilation.hooks.executeModule"), moduleObject.loaded = !0, moduleObject.exports;
|
10922
|
+
}, moduleCache = __nested_webpack_require_4786_4805__[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {}, interceptModuleExecution = __nested_webpack_require_4786_4805__[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
|
10923
|
+
for (let runtimeModule of runtimeModules)__nested_webpack_require_4786_4805__(runtimeModule);
|
10924
|
+
let executeResult = __nested_webpack_require_4786_4805__(entry);
|
10925
|
+
getCompiler1().__internal__get_module_execution_results_map().set(id, executeResult);
|
10926
|
+
} catch (e) {
|
10927
|
+
throw getCompiler1().__internal__get_module_execution_results_map().set(id, e), e;
|
10928
|
+
}
|
10929
|
+
};
|
10930
|
+
}),
|
10931
|
+
registerCompilationFinishModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationFinishModules, function() {
|
10932
|
+
return getCompiler1().__internal__get_compilation().hooks.finishModules;
|
10933
|
+
}, function(queried) {
|
10934
|
+
return async function() {
|
10935
|
+
return await queried.promise(getCompiler1().__internal__get_compilation().modules);
|
10936
|
+
};
|
10937
|
+
}),
|
10938
|
+
registerCompilationOptimizeModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeModules, function() {
|
10939
|
+
return getCompiler1().__internal__get_compilation().hooks.optimizeModules;
|
10940
|
+
}, function(queried) {
|
10941
|
+
return function() {
|
10942
|
+
return queried.call(getCompiler1().__internal__get_compilation().modules.values());
|
10943
|
+
};
|
10944
|
+
}),
|
10945
|
+
registerCompilationAfterOptimizeModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterOptimizeModules, function() {
|
10946
|
+
return getCompiler1().__internal__get_compilation().hooks.afterOptimizeModules;
|
10947
|
+
}, function(queried) {
|
10948
|
+
return function() {
|
10949
|
+
queried.call(getCompiler1().__internal__get_compilation().modules.values());
|
10950
|
+
};
|
10951
|
+
}),
|
10952
|
+
registerCompilationOptimizeTreeTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeTree, function() {
|
10953
|
+
return getCompiler1().__internal__get_compilation().hooks.optimizeTree;
|
10954
|
+
}, function(queried) {
|
10955
|
+
return async function() {
|
10956
|
+
return await queried.promise(getCompiler1().__internal__get_compilation().chunks, getCompiler1().__internal__get_compilation().modules);
|
10957
|
+
};
|
10958
|
+
}),
|
10959
|
+
registerCompilationOptimizeChunkModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeChunkModules, function() {
|
10960
|
+
return getCompiler1().__internal__get_compilation().hooks.optimizeChunkModules;
|
10961
|
+
}, function(queried) {
|
10962
|
+
return async function() {
|
10963
|
+
return await queried.promise(getCompiler1().__internal__get_compilation().chunks, getCompiler1().__internal__get_compilation().modules);
|
10964
|
+
};
|
10965
|
+
}),
|
10966
|
+
registerCompilationChunkHashTaps: createTap1(binding_.RegisterJsTapKind.CompilationChunkHash, function() {
|
10967
|
+
return getCompiler1().__internal__get_compilation().hooks.chunkHash;
|
10968
|
+
}, function(queried) {
|
10969
|
+
return function(chunk) {
|
10970
|
+
let digestResult;
|
10971
|
+
if (!getCompiler1().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
|
10972
|
+
let hash = createHash(getCompiler1().options.output.hashFunction);
|
10973
|
+
return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler1().options.output.hashDigest ? hash.digest(getCompiler1().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
|
10974
|
+
};
|
10975
|
+
}),
|
10976
|
+
registerCompilationChunkAssetTaps: createTap1(binding_.RegisterJsTapKind.CompilationChunkAsset, function() {
|
10977
|
+
return getCompiler1().__internal__get_compilation().hooks.chunkAsset;
|
10978
|
+
}, function(queried) {
|
10979
|
+
return function({ chunk, filename }) {
|
10980
|
+
return queried.call(chunk, filename);
|
10981
|
+
};
|
10982
|
+
}),
|
10983
|
+
registerCompilationProcessAssetsTaps: createTap1(binding_.RegisterJsTapKind.CompilationProcessAssets, function() {
|
10984
|
+
return getCompiler1().__internal__get_compilation().hooks.processAssets;
|
10985
|
+
}, function(queried) {
|
10986
|
+
return async function() {
|
10987
|
+
return await queried.promise(getCompiler1().__internal__get_compilation().assets);
|
10988
|
+
};
|
10989
|
+
}),
|
10990
|
+
registerCompilationAfterProcessAssetsTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterProcessAssets, function() {
|
10991
|
+
return getCompiler1().__internal__get_compilation().hooks.afterProcessAssets;
|
10992
|
+
}, function(queried) {
|
10993
|
+
return function() {
|
10994
|
+
return queried.call(getCompiler1().__internal__get_compilation().assets);
|
10995
|
+
};
|
10996
|
+
}),
|
10997
|
+
registerCompilationSealTaps: createTap1(binding_.RegisterJsTapKind.CompilationSeal, function() {
|
10998
|
+
return getCompiler1().__internal__get_compilation().hooks.seal;
|
10999
|
+
}, function(queried) {
|
11000
|
+
return function() {
|
11001
|
+
return queried.call();
|
11002
|
+
};
|
11003
|
+
}),
|
11004
|
+
registerCompilationAfterSealTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterSeal, function() {
|
11005
|
+
return getCompiler1().__internal__get_compilation().hooks.afterSeal;
|
11006
|
+
}, function(queried) {
|
11007
|
+
return async function() {
|
11008
|
+
return await queried.promise();
|
11009
|
+
};
|
11010
|
+
})
|
11011
|
+
}),
|
11012
|
+
...(getCompiler2 = getCompiler7, createTap2 = createTap6, createMapTap1 = createMapTap2, {
|
11013
|
+
registerNormalModuleFactoryBeforeResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryBeforeResolve, function() {
|
11014
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
|
11015
|
+
}, function(queried) {
|
11016
|
+
return async function(resolveData) {
|
11017
|
+
let normalizedResolveData = {
|
11018
|
+
contextInfo: {
|
11019
|
+
issuer: resolveData.issuer,
|
11020
|
+
issuerLayer: resolveData.issuerLayer ?? null
|
11021
|
+
},
|
11022
|
+
request: resolveData.request,
|
11023
|
+
context: resolveData.context,
|
11024
|
+
fileDependencies: [],
|
11025
|
+
missingDependencies: [],
|
11026
|
+
contextDependencies: []
|
11027
|
+
}, ret = await queried.promise(normalizedResolveData);
|
11028
|
+
return resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, [
|
11029
|
+
ret,
|
11030
|
+
resolveData
|
11031
|
+
];
|
11032
|
+
};
|
11033
|
+
}),
|
11034
|
+
registerNormalModuleFactoryFactorizeTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryFactorize, function() {
|
11035
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
|
11036
|
+
}, function(queried) {
|
11037
|
+
return async function(resolveData) {
|
11038
|
+
let normalizedResolveData = {
|
11039
|
+
contextInfo: {
|
11040
|
+
issuer: resolveData.issuer,
|
11041
|
+
issuerLayer: resolveData.issuerLayer ?? null
|
11042
|
+
},
|
11043
|
+
request: resolveData.request,
|
11044
|
+
context: resolveData.context,
|
11045
|
+
fileDependencies: [],
|
11046
|
+
missingDependencies: [],
|
11047
|
+
contextDependencies: []
|
11048
|
+
};
|
11049
|
+
return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
|
11050
|
+
};
|
11051
|
+
}),
|
11052
|
+
registerNormalModuleFactoryResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryResolve, function() {
|
11053
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
|
11054
|
+
}, function(queried) {
|
11055
|
+
return async function(resolveData) {
|
11056
|
+
let normalizedResolveData = {
|
11057
|
+
contextInfo: {
|
11058
|
+
issuer: resolveData.issuer,
|
11059
|
+
issuerLayer: resolveData.issuerLayer ?? null
|
11060
|
+
},
|
11061
|
+
request: resolveData.request,
|
11062
|
+
context: resolveData.context,
|
11063
|
+
fileDependencies: [],
|
11064
|
+
missingDependencies: [],
|
11065
|
+
contextDependencies: []
|
11066
|
+
};
|
11067
|
+
return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
|
11068
|
+
};
|
11069
|
+
}),
|
11070
|
+
registerNormalModuleFactoryResolveForSchemeTaps: createMapTap1(binding_.RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
|
11071
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.resolveForScheme;
|
11072
|
+
}, function(queried) {
|
11073
|
+
return async function(args) {
|
11074
|
+
return [
|
11075
|
+
await queried.for(args.scheme).promise(args.resourceData),
|
11076
|
+
args.resourceData
|
11077
|
+
];
|
11078
|
+
};
|
11079
|
+
}),
|
11080
|
+
registerNormalModuleFactoryAfterResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryAfterResolve, function() {
|
11081
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
|
11082
|
+
}, function(queried) {
|
11083
|
+
return async function(arg) {
|
11084
|
+
let data = {
|
11085
|
+
contextInfo: {
|
11086
|
+
issuer: arg.issuer,
|
11087
|
+
issuerLayer: arg.issuerLayer ?? null
|
11088
|
+
},
|
11089
|
+
request: arg.request,
|
11090
|
+
context: arg.context,
|
11091
|
+
fileDependencies: arg.fileDependencies,
|
11092
|
+
missingDependencies: arg.missingDependencies,
|
11093
|
+
contextDependencies: arg.contextDependencies,
|
11094
|
+
createData: arg.createData
|
11095
|
+
};
|
11096
|
+
return [
|
11097
|
+
await queried.promise(data),
|
11098
|
+
data.createData
|
11099
|
+
];
|
11100
|
+
};
|
11101
|
+
}),
|
11102
|
+
registerNormalModuleFactoryCreateModuleTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryCreateModule, function() {
|
11103
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.createModule;
|
11104
|
+
}, function(queried) {
|
11105
|
+
return async function(args) {
|
11106
|
+
let data = {
|
11107
|
+
...args,
|
11108
|
+
settings: {}
|
11109
|
+
};
|
11110
|
+
await queried.promise(data, {});
|
11111
|
+
};
|
11112
|
+
})
|
11113
|
+
}),
|
11114
|
+
...(getCompiler3 = getCompiler7, {
|
11115
|
+
registerContextModuleFactoryBeforeResolveTaps: (createTap3 = createTap6)(binding_.RegisterJsTapKind.ContextModuleFactoryBeforeResolve, function() {
|
11116
|
+
return getCompiler3().__internal__get_compilation_params().contextModuleFactory.hooks.beforeResolve;
|
11117
|
+
}, function(queried) {
|
11118
|
+
return async function(bindingData) {
|
11119
|
+
let data = !!bindingData && ContextModuleFactoryBeforeResolveData.__from_binding(bindingData), result = await queried.promise(data);
|
11120
|
+
return !!result && ContextModuleFactoryBeforeResolveData.__to_binding(result);
|
11121
|
+
};
|
11122
|
+
}),
|
11123
|
+
registerContextModuleFactoryAfterResolveTaps: createTap3(binding_.RegisterJsTapKind.ContextModuleFactoryAfterResolve, function() {
|
11124
|
+
return getCompiler3().__internal__get_compilation_params().contextModuleFactory.hooks.afterResolve;
|
11125
|
+
}, function(queried) {
|
11126
|
+
return async function(bindingData) {
|
11127
|
+
let data = !!bindingData && ContextModuleFactoryAfterResolveData.__from_binding(bindingData), result = await queried.promise(data);
|
11128
|
+
return !!result && ContextModuleFactoryAfterResolveData.__to_binding(result);
|
11129
|
+
};
|
11130
|
+
})
|
11131
|
+
}),
|
11132
|
+
...(getCompiler4 = getCompiler7, {
|
11133
|
+
registerJavascriptModulesChunkHashTaps: createTap6(binding_.RegisterJsTapKind.JavascriptModulesChunkHash, function() {
|
11134
|
+
return JavascriptModulesPlugin.getCompilationHooks(getCompiler4().__internal__get_compilation()).chunkHash;
|
11135
|
+
}, function(queried) {
|
11136
|
+
return function(chunk) {
|
11137
|
+
let digestResult;
|
11138
|
+
if (!getCompiler4().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
|
11139
|
+
let hash = createHash(getCompiler4().options.output.hashFunction);
|
11140
|
+
return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler4().options.output.hashDigest ? hash.digest(getCompiler4().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
|
11141
|
+
};
|
11142
|
+
})
|
11143
|
+
}),
|
11144
|
+
...((getCompiler, createTap, createMapTap)=>{
|
11145
|
+
let getOptions = (uid)=>((compilation, uid)=>{
|
11146
|
+
if (!(compilation instanceof Compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
|
11147
|
+
return compilationOptionsMap.get(compilation)?.[uid];
|
11148
|
+
})(getCompiler().__internal__get_compilation(), uid);
|
11149
|
+
return {
|
11150
|
+
registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration, function() {
|
11151
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeAssetTagGeneration;
|
11152
|
+
}, function(queried) {
|
11153
|
+
return async function(data) {
|
11154
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11155
|
+
...data,
|
11156
|
+
plugin: {
|
11157
|
+
options: getOptions(uid)
|
11158
|
+
}
|
11159
|
+
});
|
11160
|
+
return res.compilationId = compilationId, res.uid = uid, res;
|
11161
|
+
};
|
11162
|
+
}),
|
11163
|
+
registerHtmlPluginAlterAssetTagsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTags, function() {
|
11164
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTags;
|
11165
|
+
}, function(queried) {
|
11166
|
+
return async function(data) {
|
11167
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11168
|
+
...data,
|
11169
|
+
plugin: {
|
11170
|
+
options: getOptions(uid)
|
11171
|
+
}
|
11172
|
+
});
|
11173
|
+
return res.compilationId = compilationId, res.uid = uid, res;
|
11174
|
+
};
|
11175
|
+
}),
|
11176
|
+
registerHtmlPluginAlterAssetTagGroupsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups, function() {
|
11177
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTagGroups;
|
11178
|
+
}, function(queried) {
|
11179
|
+
return async function(data) {
|
11180
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11181
|
+
...data,
|
11182
|
+
plugin: {
|
11183
|
+
options: getOptions(uid)
|
11184
|
+
}
|
11185
|
+
});
|
11186
|
+
return res.compilationId = compilationId, res.uid = uid, res;
|
11187
|
+
};
|
11188
|
+
}),
|
11189
|
+
registerHtmlPluginAfterTemplateExecutionTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterTemplateExecution, function() {
|
11190
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterTemplateExecution;
|
11191
|
+
}, function(queried) {
|
11192
|
+
return async function(data) {
|
11193
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11194
|
+
...data,
|
11195
|
+
plugin: {
|
11196
|
+
options: getOptions(uid)
|
11197
|
+
}
|
11198
|
+
});
|
11199
|
+
return res.compilationId = compilationId, res;
|
11200
|
+
};
|
11201
|
+
}),
|
11202
|
+
registerHtmlPluginBeforeEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeEmit, function() {
|
11203
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeEmit;
|
11204
|
+
}, function(queried) {
|
11205
|
+
return async function(data) {
|
11206
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11207
|
+
...data,
|
11208
|
+
plugin: {
|
11209
|
+
options: getOptions(uid)
|
11210
|
+
}
|
11211
|
+
});
|
11212
|
+
return res.compilationId = compilationId, res.uid = uid, res;
|
11213
|
+
};
|
11214
|
+
}),
|
11215
|
+
registerHtmlPluginAfterEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterEmit, function() {
|
11216
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterEmit;
|
11217
|
+
}, function(queried) {
|
11218
|
+
return async function(data) {
|
11219
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11220
|
+
...data,
|
11221
|
+
plugin: {
|
11222
|
+
options: getOptions(uid)
|
11223
|
+
}
|
11224
|
+
});
|
11225
|
+
return res.compilationId = compilationId, res.uid = uid, res;
|
11226
|
+
};
|
11227
|
+
})
|
11228
|
+
};
|
11229
|
+
})(getCompiler7, createTap6, 0),
|
11230
|
+
...(getCompiler5 = getCompiler7, {
|
11231
|
+
registerRuntimePluginCreateScriptTaps: (createTap4 = createTap6)(binding_.RegisterJsTapKind.RuntimePluginCreateScript, function() {
|
11232
|
+
return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).createScript;
|
11233
|
+
}, function(queried) {
|
11234
|
+
return function(data) {
|
11235
|
+
return queried.call(data.code, data.chunk);
|
11236
|
+
};
|
11237
|
+
}),
|
11238
|
+
registerRuntimePluginLinkPreloadTaps: createTap4(binding_.RegisterJsTapKind.RuntimePluginLinkPreload, function() {
|
11239
|
+
return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).linkPreload;
|
11240
|
+
}, function(queried) {
|
11241
|
+
return function(data) {
|
11242
|
+
return queried.call(data.code, data.chunk);
|
11243
|
+
};
|
11244
|
+
}),
|
11245
|
+
registerRuntimePluginLinkPrefetchTaps: createTap4(binding_.RegisterJsTapKind.RuntimePluginLinkPrefetch, function() {
|
11246
|
+
return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).linkPrefetch;
|
11247
|
+
}, function(queried) {
|
11248
|
+
return function(data) {
|
11249
|
+
return queried.call(data.code, data.chunk);
|
11250
|
+
};
|
11251
|
+
})
|
11252
|
+
}),
|
11253
|
+
...(getCompiler6 = getCompiler7, {
|
11254
|
+
registerRsdoctorPluginModuleGraphTaps: (createTap5 = createTap6)(binding_.RegisterJsTapKind.RsdoctorPluginModuleGraph, function() {
|
11255
|
+
return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleGraph;
|
11256
|
+
}, function(queried) {
|
11257
|
+
return async function(data) {
|
11258
|
+
return await queried.promise(data);
|
11259
|
+
};
|
11260
|
+
}),
|
11261
|
+
registerRsdoctorPluginChunkGraphTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginChunkGraph, function() {
|
11262
|
+
return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).chunkGraph;
|
11263
|
+
}, function(queried) {
|
11264
|
+
return async function(data) {
|
11265
|
+
return await queried.promise(data);
|
11266
|
+
};
|
11267
|
+
}),
|
11268
|
+
registerRsdoctorPluginModuleIdsTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginModuleIds, function() {
|
11269
|
+
return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleIds;
|
11270
|
+
}, function(queried) {
|
11271
|
+
return async function(data) {
|
11272
|
+
return await queried.promise(data);
|
11273
|
+
};
|
11274
|
+
}),
|
11275
|
+
registerRsdoctorPluginModuleSourcesTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginModuleSources, function() {
|
11276
|
+
return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleSources;
|
11277
|
+
}, function(queried) {
|
11278
|
+
return async function(data) {
|
11279
|
+
return await queried.promise(data);
|
11280
|
+
};
|
11281
|
+
}),
|
11282
|
+
registerRsdoctorPluginAssetsTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginAssets, function() {
|
11283
|
+
return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).assets;
|
11284
|
+
}, function(queried) {
|
11285
|
+
return async function(data) {
|
11286
|
+
return await queried.promise(data);
|
11287
|
+
};
|
11288
|
+
})
|
11289
|
+
})
|
11396
11290
|
};
|
11397
11291
|
}
|
11398
11292
|
#updateNonSkippableRegisters() {
|
@@ -11518,7 +11412,7 @@ Help:
|
|
11518
11412
|
obj.children = this.stats.map((stat, idx)=>{
|
11519
11413
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
11520
11414
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
11521
|
-
}), childOptions.version && (obj.rspackVersion = "1.4.
|
11415
|
+
}), childOptions.version && (obj.rspackVersion = "1.4.7-alpha.1", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
11522
11416
|
let mapError = (j, obj)=>({
|
11523
11417
|
...obj,
|
11524
11418
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
@@ -11552,24 +11446,22 @@ Help:
|
|
11552
11446
|
func = asyncLib_noop, fn(err);
|
11553
11447
|
};
|
11554
11448
|
}
|
11555
|
-
let
|
11556
|
-
|
11557
|
-
|
11558
|
-
|
11559
|
-
|
11560
|
-
|
11561
|
-
|
11449
|
+
let asyncLib_each = function(collection, iterator, originalCallback) {
|
11450
|
+
let callback = once(originalCallback), size = 0, completed = 0;
|
11451
|
+
if (Array.isArray(collection)) {
|
11452
|
+
size = collection.length;
|
11453
|
+
var array = collection, iterator1 = iterator, callback1 = (err)=>{
|
11454
|
+
err ? (callback = once(callback))(err) : ++completed === size && callback(null);
|
11455
|
+
};
|
11456
|
+
let index = -1;
|
11457
|
+
for(; ++index < array.length;)iterator1(array[index], function(func) {
|
11458
|
+
return (err)=>{
|
11459
|
+
let fn = func;
|
11460
|
+
func = throwError, fn(err);
|
11562
11461
|
};
|
11563
|
-
|
11564
|
-
for(; ++index < array.length;)iterator1(array[index], function(func) {
|
11565
|
-
return (err)=>{
|
11566
|
-
let fn = func;
|
11567
|
-
func = throwError, fn(err);
|
11568
|
-
};
|
11569
|
-
}(callback1));
|
11570
|
-
}
|
11571
|
-
size || callback(null);
|
11462
|
+
}(callback1));
|
11572
11463
|
}
|
11464
|
+
size || callback(null);
|
11573
11465
|
}, MultiWatching = class {
|
11574
11466
|
watchings;
|
11575
11467
|
compiler;
|
@@ -11577,15 +11469,15 @@ Help:
|
|
11577
11469
|
this.watchings = watchings, this.compiler = compiler;
|
11578
11470
|
}
|
11579
11471
|
invalidate(callback) {
|
11580
|
-
if (callback)
|
11472
|
+
if (callback) asyncLib_each(this.watchings, (watching, callback)=>watching.invalidate(callback), callback);
|
11581
11473
|
else for (let watching of this.watchings)watching.invalidate();
|
11582
11474
|
}
|
11583
11475
|
invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback) {
|
11584
|
-
if (callback)
|
11476
|
+
if (callback) asyncLib_each(this.watchings, (watching, callback)=>watching.invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback), callback);
|
11585
11477
|
else for (let watching of this.watchings)watching.invalidateWithChangesAndRemovals(changedFiles, removedFiles);
|
11586
11478
|
}
|
11587
11479
|
close(callback) {
|
11588
|
-
|
11480
|
+
asyncLib_each(this.watchings, (watching, finishedCallback)=>{
|
11589
11481
|
watching.close(finishedCallback);
|
11590
11482
|
}, (err)=>{
|
11591
11483
|
this.compiler.hooks.watchClose.call(), "function" == typeof callback && (this.compiler.running = !1, callback(err));
|
@@ -11658,7 +11550,7 @@ Help:
|
|
11658
11550
|
shutdown: new lite_tapable_namespaceObject.MultiHook(normalizedCompilers.map((c)=>c.hooks.shutdown)),
|
11659
11551
|
infrastructureLog: new lite_tapable_namespaceObject.MultiHook(normalizedCompilers.map((c)=>c.hooks.infrastructureLog))
|
11660
11552
|
}, this.compilers = normalizedCompilers, this._options = {
|
11661
|
-
parallelism: options?.parallelism ||
|
11553
|
+
parallelism: options?.parallelism || 1 / 0
|
11662
11554
|
}, this.dependencies = new WeakMap(), this.running = !1;
|
11663
11555
|
let compilerStats = this.compilers.map(()=>null), doneCompilers = 0;
|
11664
11556
|
for(let index = 0; index < this.compilers.length; index++){
|
@@ -11759,7 +11651,7 @@ Help:
|
|
11759
11651
|
for (let node of nodes)0 === node.parents.length && (node.state = "queued", queue.enqueue(node));
|
11760
11652
|
let errored = !1, running = 0, parallelism = this._options.parallelism, nodeDone = (node, err, stats)=>{
|
11761
11653
|
if (!errored) {
|
11762
|
-
if (err) return errored = !0,
|
11654
|
+
if (err) return errored = !0, asyncLib_each(nodes, (node, callback)=>{
|
11763
11655
|
node.compiler.watching ? node.compiler.watching.close(callback) : callback();
|
11764
11656
|
}, ()=>callback(err));
|
11765
11657
|
if (node.result = stats, running--, "running" === node.state) for (let child of (node.state = "done", node.children))"blocked" === child.state && queue.enqueue(child);
|
@@ -11770,11 +11662,12 @@ Help:
|
|
11770
11662
|
for (let child of ("done" === node.state ? node.state = "blocked" : "running" === node.state && (node.state = "running-outdated"), node.children))nodeInvalidFromParent(child);
|
11771
11663
|
}, nodeInvalid = (node)=>{
|
11772
11664
|
for (let child of ("done" === node.state ? node.state = "pending" : "running" === node.state && (node.state = "running-outdated"), node.children))nodeInvalidFromParent(child);
|
11773
|
-
}, nodeChange = (node)=>{
|
11774
|
-
nodeInvalid(node), "pending" === node.state && (node.state = "blocked"), "blocked" === node.state && (queue.enqueue(node), processQueue());
|
11775
11665
|
}, setupResults = [];
|
11776
11666
|
nodes.forEach((node, i)=>{
|
11777
|
-
setupResults.push(node.setupResult = setup(node.compiler, i, nodeDone.bind(null, node), ()=>"starting" !== node.state && "running" !== node.state, ()=>
|
11667
|
+
setupResults.push(node.setupResult = setup(node.compiler, i, nodeDone.bind(null, node), ()=>"starting" !== node.state && "running" !== node.state, ()=>{
|
11668
|
+
var node1;
|
11669
|
+
nodeInvalid(node1 = node), "pending" === node1.state && (node1.state = "blocked"), "blocked" === node1.state && (queue.enqueue(node1), processQueue());
|
11670
|
+
}, ()=>nodeInvalid(node)));
|
11778
11671
|
});
|
11779
11672
|
let processing = !0, processQueue = ()=>{
|
11780
11673
|
processing || (processing = !0, process.nextTick(processQueueWorker));
|
@@ -11817,7 +11710,7 @@ Help:
|
|
11817
11710
|
for (let compiler of this.compilers)compiler.inputFileSystem?.purge?.();
|
11818
11711
|
}
|
11819
11712
|
close(callback) {
|
11820
|
-
|
11713
|
+
asyncLib_each(this.compilers, (compiler, cb)=>{
|
11821
11714
|
compiler.close(cb);
|
11822
11715
|
}, callback);
|
11823
11716
|
}
|
@@ -11884,17 +11777,6 @@ Help:
|
|
11884
11777
|
let count = 0;
|
11885
11778
|
for (let child of children)child.children || child.filteredChildren ? (child.children && (count += getTotalItems(child.children)), child.filteredChildren && (count += child.filteredChildren)) : count++;
|
11886
11779
|
return count;
|
11887
|
-
}, collapse = (children)=>{
|
11888
|
-
let newChildren = [];
|
11889
|
-
for (let child of children)if (child.children) {
|
11890
|
-
let filteredChildren = child.filteredChildren || 0;
|
11891
|
-
filteredChildren += getTotalItems(child.children), newChildren.push({
|
11892
|
-
...child,
|
11893
|
-
children: void 0,
|
11894
|
-
filteredChildren
|
11895
|
-
});
|
11896
|
-
} else newChildren.push(child);
|
11897
|
-
return newChildren;
|
11898
11780
|
}, getTotalSize = (children)=>{
|
11899
11781
|
let size = 0;
|
11900
11782
|
for (let child of children)size += getItemSize(child);
|
@@ -11938,7 +11820,18 @@ Help:
|
|
11938
11820
|
}
|
11939
11821
|
}
|
11940
11822
|
children = groups.concat(items);
|
11941
|
-
} else limit === max ? (children =
|
11823
|
+
} else limit === max ? (children = ((children)=>{
|
11824
|
+
let newChildren = [];
|
11825
|
+
for (let child of children)if (child.children) {
|
11826
|
+
let filteredChildren = child.filteredChildren || 0;
|
11827
|
+
filteredChildren += getTotalItems(child.children), newChildren.push({
|
11828
|
+
...child,
|
11829
|
+
children: void 0,
|
11830
|
+
filteredChildren
|
11831
|
+
});
|
11832
|
+
} else newChildren.push(child);
|
11833
|
+
return newChildren;
|
11834
|
+
})(groups), filteredChildren = items.length) : filteredChildren = getTotalItems(itemsAndGroups);
|
11942
11835
|
}
|
11943
11836
|
return {
|
11944
11837
|
children,
|
@@ -11948,10 +11841,11 @@ Help:
|
|
11948
11841
|
let count = getItems(compilation, "").length;
|
11949
11842
|
for (let child of compilation.children)count += countWithChildren(child, (c, type)=>getItems(c, `.children[].compilation${type}`));
|
11950
11843
|
return count;
|
11951
|
-
},
|
11844
|
+
}, sortByField = (field)=>{
|
11845
|
+
var field1;
|
11952
11846
|
if (!field) return (_a, _b)=>0;
|
11953
|
-
let fieldKey =
|
11954
|
-
if (!
|
11847
|
+
let fieldKey = "!" === (field1 = field)[0] ? field1.slice(1) : field1, sortFn = compareSelect((m)=>m[fieldKey], compareIds);
|
11848
|
+
if ("!" === field[0]) {
|
11955
11849
|
let oldSortFn = sortFn;
|
11956
11850
|
sortFn = (a, b)=>oldSortFn(b, a);
|
11957
11851
|
}
|
@@ -12418,7 +12312,7 @@ Help:
|
|
12418
12312
|
object.hash = context.getStatsCompilation(compilation).hash;
|
12419
12313
|
},
|
12420
12314
|
version: (object)=>{
|
12421
|
-
object.version = "5.75.0", object.rspackVersion = "1.4.
|
12315
|
+
object.version = "5.75.0", object.rspackVersion = "1.4.7-alpha.1";
|
12422
12316
|
},
|
12423
12317
|
env: (object, _compilation, _context, { _env })=>{
|
12424
12318
|
object.env = _env;
|
@@ -12458,7 +12352,7 @@ Help:
|
|
12458
12352
|
object.assetsByChunkName = assetsByChunkName.reduce((acc, cur)=>(acc[cur.name] = cur.files, acc), {});
|
12459
12353
|
let limited = spaceLimited(factory.create(`${type}.assets`, Array.from(assets), {
|
12460
12354
|
...context
|
12461
|
-
}), options.assetsSpace ??
|
12355
|
+
}), options.assetsSpace ?? 1 / 0);
|
12462
12356
|
object.assets = limited.children, object.filteredAssets = limited.filteredChildren;
|
12463
12357
|
},
|
12464
12358
|
chunks: (object, compilation, context, options, factory)=>{
|
@@ -12750,12 +12644,12 @@ Help:
|
|
12750
12644
|
orphanModules: !0,
|
12751
12645
|
runtimeModules: !0,
|
12752
12646
|
excludeModules: !1,
|
12753
|
-
errorsSpace:
|
12754
|
-
warningsSpace:
|
12755
|
-
modulesSpace:
|
12756
|
-
chunkModulesSpace:
|
12757
|
-
assetsSpace:
|
12758
|
-
reasonsSpace:
|
12647
|
+
errorsSpace: 1 / 0,
|
12648
|
+
warningsSpace: 1 / 0,
|
12649
|
+
modulesSpace: 1 / 0,
|
12650
|
+
chunkModulesSpace: 1 / 0,
|
12651
|
+
assetsSpace: 1 / 0,
|
12652
|
+
reasonsSpace: 1 / 0,
|
12759
12653
|
children: !0
|
12760
12654
|
},
|
12761
12655
|
detailed: {
|
@@ -12804,7 +12698,7 @@ Help:
|
|
12804
12698
|
all: !1,
|
12805
12699
|
errors: !0,
|
12806
12700
|
errorsCount: !0,
|
12807
|
-
errorsSpace:
|
12701
|
+
errorsSpace: 1 / 0,
|
12808
12702
|
moduleTrace: !0,
|
12809
12703
|
logging: "error"
|
12810
12704
|
},
|
@@ -12812,10 +12706,10 @@ Help:
|
|
12812
12706
|
all: !1,
|
12813
12707
|
errors: !0,
|
12814
12708
|
errorsCount: !0,
|
12815
|
-
errorsSpace:
|
12709
|
+
errorsSpace: 1 / 0,
|
12816
12710
|
warnings: !0,
|
12817
12711
|
warningsCount: !0,
|
12818
|
-
warningsSpace:
|
12712
|
+
warningsSpace: 1 / 0,
|
12819
12713
|
logging: "warn"
|
12820
12714
|
},
|
12821
12715
|
summary: {
|
@@ -12839,7 +12733,7 @@ Help:
|
|
12839
12733
|
chunkGroups: OFF_FOR_TO_STRING,
|
12840
12734
|
chunkGroupAuxiliary: OFF_FOR_TO_STRING,
|
12841
12735
|
chunkGroupChildren: OFF_FOR_TO_STRING,
|
12842
|
-
chunkGroupMaxAssets: (o, { forToString })=>forToString ? 5 :
|
12736
|
+
chunkGroupMaxAssets: (o, { forToString })=>forToString ? 5 : 1 / 0,
|
12843
12737
|
chunks: OFF_FOR_TO_STRING,
|
12844
12738
|
chunkRelations: OFF_FOR_TO_STRING,
|
12845
12739
|
chunkModules: ({ all, modules })=>!1 !== all && (!0 === all || !modules),
|
@@ -12854,16 +12748,16 @@ Help:
|
|
12854
12748
|
groupModulesByAttributes: ON_FOR_TO_STRING,
|
12855
12749
|
groupModulesByPath: ON_FOR_TO_STRING,
|
12856
12750
|
groupModulesByExtension: ON_FOR_TO_STRING,
|
12857
|
-
modulesSpace: (o, { forToString })=>forToString ? 15 :
|
12858
|
-
chunkModulesSpace: (o, { forToString })=>forToString ? 10 :
|
12859
|
-
nestedModulesSpace: (o, { forToString })=>forToString ? 10 :
|
12751
|
+
modulesSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
|
12752
|
+
chunkModulesSpace: (o, { forToString })=>forToString ? 10 : 1 / 0,
|
12753
|
+
nestedModulesSpace: (o, { forToString })=>forToString ? 10 : 1 / 0,
|
12860
12754
|
relatedAssets: OFF_FOR_TO_STRING,
|
12861
12755
|
groupAssetsByEmitStatus: ON_FOR_TO_STRING,
|
12862
12756
|
groupAssetsByInfo: ON_FOR_TO_STRING,
|
12863
12757
|
groupAssetsByPath: ON_FOR_TO_STRING,
|
12864
12758
|
groupAssetsByExtension: ON_FOR_TO_STRING,
|
12865
12759
|
groupAssetsByChunk: ON_FOR_TO_STRING,
|
12866
|
-
assetsSpace: (o, { forToString })=>forToString ? 15 :
|
12760
|
+
assetsSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
|
12867
12761
|
orphanModules: OFF_FOR_TO_STRING,
|
12868
12762
|
runtimeModules: ({ all, runtime }, { forToString })=>void 0 !== runtime ? runtime : forToString ? !0 === all : !1 !== all,
|
12869
12763
|
cachedModules: ({ all, cached }, { forToString })=>void 0 !== cached ? cached : forToString ? !0 === all : !1 !== all,
|
@@ -12871,7 +12765,7 @@ Help:
|
|
12871
12765
|
depth: OFF_FOR_TO_STRING,
|
12872
12766
|
cachedAssets: OFF_FOR_TO_STRING,
|
12873
12767
|
reasons: OFF_FOR_TO_STRING,
|
12874
|
-
reasonsSpace: (o, { forToString })=>forToString ? 15 :
|
12768
|
+
reasonsSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
|
12875
12769
|
groupReasonsByOrigin: ON_FOR_TO_STRING,
|
12876
12770
|
usedExports: OFF_FOR_TO_STRING,
|
12877
12771
|
providedExports: OFF_FOR_TO_STRING,
|
@@ -12952,13 +12846,7 @@ Help:
|
|
12952
12846
|
if (!dataUrl) return resource;
|
12953
12847
|
let len = dataUrl[0].length + 16;
|
12954
12848
|
return resource.length < len ? resource : `${resource.slice(0, Math.min(resource.length - 2, len))}..`;
|
12955
|
-
},
|
12956
|
-
let matchResourceMatch = /^([^!]+)!=!/.exec(name), n = matchResourceMatch ? matchResourceMatch[0] + getResourceName(name.slice(matchResourceMatch[0].length)) : name, [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(n) || [];
|
12957
|
-
return [
|
12958
|
-
prefix,
|
12959
|
-
getResourceName(resource)
|
12960
|
-
];
|
12961
|
-
}, mapLines = (str, fn)=>str.split("\n").map(fn).join("\n"), twoDigit = (n)=>n >= 10 ? `${n}` : `0${n}`, isValidId = (id)=>"number" == typeof id || id, moreCount = (list, count)=>list && list.length > 0 ? `+ ${count}` : `${count}`, SIMPLE_PRINTERS = {
|
12849
|
+
}, mapLines = (str, fn)=>str.split("\n").map(fn).join("\n"), twoDigit = (n)=>n >= 10 ? `${n}` : `0${n}`, moreCount = (list, count)=>list && list.length > 0 ? `+ ${count}` : `${count}`, SIMPLE_PRINTERS = {
|
12962
12850
|
"compilation.summary!": (_, { type, bold, green, red, yellow, formatDateTime, formatTime, compilation: { name, hash, rspackVersion, time, builtAt, errorsCount, warningsCount } })=>{
|
12963
12851
|
let statusMessage, root = "compilation.summary!" === type, warningsMessage = warningsCount && warningsCount > 0 ? yellow(`${warningsCount} ${DefaultStatsPrinterPlugin_plural(warningsCount, "warning", "warnings")}`) : "", errorsMessage = errorsCount && errorsCount > 0 ? red(`${errorsCount} ${DefaultStatsPrinterPlugin_plural(errorsCount, "error", "errors")}`) : "", timeMessage = root && time ? ` in ${formatTime(time)}` : "", hashMessage = hash ? ` (${hash})` : "", builtAtMessage = root && builtAt ? `${formatDateTime(builtAt)}: ` : "", versionMessage = root && rspackVersion ? `Rspack ${rspackVersion}` : "", nameMessage = root && name ? bold(name) : name ? `Child ${bold(name)}` : root ? "" : "Child", subjectMessage = nameMessage && versionMessage ? `${nameMessage} (${versionMessage})` : versionMessage || nameMessage || "Rspack";
|
12964
12852
|
if (statusMessage = errorsMessage && warningsMessage ? `compiled with ${errorsMessage} and ${warningsMessage}` : errorsMessage ? `compiled with ${errorsMessage}` : warningsMessage ? `compiled with ${warningsMessage}` : 0 === errorsCount && 0 === warningsCount ? `compiled ${green("successfully")}` : "compiled", builtAtMessage || versionMessage || errorsMessage || warningsMessage || 0 === errorsCount && 0 === warningsCount || timeMessage || hashMessage) return `${builtAtMessage}${subjectMessage} ${statusMessage}${timeMessage}${hashMessage}`;
|
@@ -13019,9 +12907,18 @@ Help:
|
|
13019
12907
|
assetChunkName: (name)=>name,
|
13020
12908
|
assetChunkIdHint: (name)=>name,
|
13021
12909
|
"module.type": (type)=>"module" !== type ? type : void 0,
|
13022
|
-
"module.id": (id, { formatModuleId })=>
|
12910
|
+
"module.id": (id, { formatModuleId })=>{
|
12911
|
+
let id1;
|
12912
|
+
return "number" == typeof (id1 = id) || id1 ? formatModuleId(id) : void 0;
|
12913
|
+
},
|
13023
12914
|
"module.name": (name, { bold })=>{
|
13024
|
-
let [prefix, resource] =
|
12915
|
+
let [prefix, resource] = ((name)=>{
|
12916
|
+
let matchResourceMatch = /^([^!]+)!=!/.exec(name), n = matchResourceMatch ? matchResourceMatch[0] + getResourceName(name.slice(matchResourceMatch[0].length)) : name, [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(n) || [];
|
12917
|
+
return [
|
12918
|
+
prefix,
|
12919
|
+
getResourceName(resource)
|
12920
|
+
];
|
12921
|
+
})(name);
|
13025
12922
|
return `${prefix || ""}${bold(resource || "")}`;
|
13026
12923
|
},
|
13027
12924
|
"module.identifier": (identifier)=>void 0,
|
@@ -13066,7 +12963,10 @@ Help:
|
|
13066
12963
|
"moduleIssuer.profile.total": (value, { formatTime })=>formatTime(value),
|
13067
12964
|
"moduleReason.type": (type)=>type,
|
13068
12965
|
"moduleReason.userRequest": (userRequest, { cyan })=>cyan(getResourceName(userRequest)),
|
13069
|
-
"moduleReason.moduleId": (moduleId, { formatModuleId })=>
|
12966
|
+
"moduleReason.moduleId": (moduleId, { formatModuleId })=>{
|
12967
|
+
let id;
|
12968
|
+
return "number" == typeof (id = moduleId) || id ? formatModuleId(moduleId) : void 0;
|
12969
|
+
},
|
13070
12970
|
"moduleReason.module": (module, { magenta })=>magenta(module),
|
13071
12971
|
"moduleReason.loc": (loc)=>loc,
|
13072
12972
|
"moduleReason.explanation": (explanation, { cyan })=>cyan(explanation),
|
@@ -13118,7 +13018,10 @@ Help:
|
|
13118
13018
|
return items.sort((a, b)=>compareIds(a.type, b.type)), Array.isArray(childrenByOrder) ? void 0 : printer.print(context.type, items, context);
|
13119
13019
|
},
|
13120
13020
|
"chunk.childrenByOrder[].type": (type)=>`${type}:`,
|
13121
|
-
"chunk.childrenByOrder[].children[]": (id, { formatChunkId })=>
|
13021
|
+
"chunk.childrenByOrder[].children[]": (id, { formatChunkId })=>{
|
13022
|
+
let id1;
|
13023
|
+
return "number" == typeof (id1 = id) || id1 ? formatChunkId(id) : void 0;
|
13024
|
+
},
|
13122
13025
|
"chunk.entry": (entry, { formatFlag, yellow })=>entry ? yellow(formatFlag("entry")) : void 0,
|
13123
13026
|
"chunk.initial": (initial, { formatFlag, yellow })=>initial ? yellow(formatFlag("initial")) : void 0,
|
13124
13027
|
"chunk.rendered": (rendered, { formatFlag, green })=>rendered ? green(formatFlag("rendered")) : void 0,
|
@@ -13127,7 +13030,10 @@ Help:
|
|
13127
13030
|
"chunk.filteredModules": (filteredModules, { chunk: { modules } })=>filteredModules > 0 ? `${moreCount(modules, filteredModules)} chunk ${DefaultStatsPrinterPlugin_plural(filteredModules, "module", "modules")}` : void 0,
|
13128
13031
|
"chunk.separator!": ()=>"\n",
|
13129
13032
|
"chunkOrigin.request": (request)=>request,
|
13130
|
-
"chunkOrigin.moduleId": (moduleId, { formatModuleId })=>
|
13033
|
+
"chunkOrigin.moduleId": (moduleId, { formatModuleId })=>{
|
13034
|
+
let id;
|
13035
|
+
return "number" == typeof (id = moduleId) || id ? formatModuleId(moduleId) : void 0;
|
13036
|
+
},
|
13131
13037
|
"chunkOrigin.moduleName": (moduleName, { bold })=>bold(moduleName),
|
13132
13038
|
"chunkOrigin.loc": (loc)=>loc,
|
13133
13039
|
"error.file": (file, { bold })=>bold(file),
|
@@ -14004,7 +13910,7 @@ Help:
|
|
14004
13910
|
});
|
14005
13911
|
}
|
14006
13912
|
}
|
14007
|
-
var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.
|
13913
|
+
var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"), CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
|
14008
13914
|
let filterToFunction = (item)=>{
|
14009
13915
|
if ("string" == typeof item) {
|
14010
13916
|
let regExp = RegExp(`[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)`);
|
@@ -14020,82 +13926,6 @@ Help:
|
|
14020
13926
|
log: 2,
|
14021
13927
|
true: 2,
|
14022
13928
|
verbose: 1
|
14023
|
-
}, createConsoleLogger = ({ level = "info", debug = !1, console: console1 })=>{
|
14024
|
-
let debugFilters = "boolean" == typeof debug ? [
|
14025
|
-
()=>debug
|
14026
|
-
] : [].concat(debug).map(filterToFunction), loglevel = LogLevel[`${level}`] || 0;
|
14027
|
-
return (name, type, args)=>{
|
14028
|
-
let labeledArgs = ()=>Array.isArray(args) ? args.length > 0 && "string" == typeof args[0] ? [
|
14029
|
-
`[${name}] ${args[0]}`,
|
14030
|
-
...args.slice(1)
|
14031
|
-
] : [
|
14032
|
-
`[${name}]`,
|
14033
|
-
...args
|
14034
|
-
] : [], debug = debugFilters.some((f)=>f(name));
|
14035
|
-
switch(type){
|
14036
|
-
case LogType.debug:
|
14037
|
-
if (!debug) return;
|
14038
|
-
"function" == typeof console1.debug ? console1.debug(...labeledArgs()) : console1.log(...labeledArgs());
|
14039
|
-
break;
|
14040
|
-
case LogType.log:
|
14041
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14042
|
-
console1.log(...labeledArgs());
|
14043
|
-
break;
|
14044
|
-
case LogType.info:
|
14045
|
-
if (!debug && loglevel > LogLevel.info) return;
|
14046
|
-
console1.info(...labeledArgs());
|
14047
|
-
break;
|
14048
|
-
case LogType.warn:
|
14049
|
-
if (!debug && loglevel > LogLevel.warn) return;
|
14050
|
-
console1.warn(...labeledArgs());
|
14051
|
-
break;
|
14052
|
-
case LogType.error:
|
14053
|
-
if (!debug && loglevel > LogLevel.error) return;
|
14054
|
-
console1.error(...labeledArgs());
|
14055
|
-
break;
|
14056
|
-
case LogType.trace:
|
14057
|
-
if (!debug) return;
|
14058
|
-
console1.trace();
|
14059
|
-
break;
|
14060
|
-
case LogType.groupCollapsed:
|
14061
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14062
|
-
if (!debug && loglevel > LogLevel.verbose) {
|
14063
|
-
"function" == typeof console1.groupCollapsed ? console1.groupCollapsed(...labeledArgs()) : console1.log(...labeledArgs());
|
14064
|
-
break;
|
14065
|
-
}
|
14066
|
-
case LogType.group:
|
14067
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14068
|
-
"function" == typeof console1.group ? console1.group(...labeledArgs()) : console1.log(...labeledArgs());
|
14069
|
-
break;
|
14070
|
-
case LogType.groupEnd:
|
14071
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14072
|
-
"function" == typeof console1.groupEnd && console1.groupEnd();
|
14073
|
-
break;
|
14074
|
-
case LogType.time:
|
14075
|
-
{
|
14076
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14077
|
-
let ms = 1000 * args[1] + args[2] / 1000000, msg = `[${name}] ${args[0]}: ${ms} ms`;
|
14078
|
-
"function" == typeof console1.logTime ? console1.logTime(msg) : console1.log(msg);
|
14079
|
-
break;
|
14080
|
-
}
|
14081
|
-
case LogType.profile:
|
14082
|
-
"function" == typeof console1.profile && console1.profile(...labeledArgs());
|
14083
|
-
break;
|
14084
|
-
case LogType.profileEnd:
|
14085
|
-
"function" == typeof console1.profileEnd && console1.profileEnd(...labeledArgs());
|
14086
|
-
break;
|
14087
|
-
case LogType.clear:
|
14088
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14089
|
-
"function" == typeof console1.clear && console1.clear();
|
14090
|
-
break;
|
14091
|
-
case LogType.status:
|
14092
|
-
if (!debug && loglevel > LogLevel.info) return;
|
14093
|
-
"function" == typeof console1.status ? 0 === args.length ? console1.status() : console1.status(...labeledArgs()) : 0 !== args.length && console1.info(...labeledArgs());
|
14094
|
-
break;
|
14095
|
-
default:
|
14096
|
-
throw Error(`Unexpected LogType ${type}`);
|
14097
|
-
}
|
14098
|
-
};
|
14099
13929
|
};
|
14100
13930
|
class NodeWatchFileSystem {
|
14101
13931
|
inputFileSystem;
|
@@ -14212,15 +14042,87 @@ Help:
|
|
14212
14042
|
}
|
14213
14043
|
apply(compiler) {
|
14214
14044
|
let { infrastructureLogging } = this.options;
|
14215
|
-
compiler.infrastructureLogger =
|
14045
|
+
compiler.infrastructureLogger = (({ level = "info", debug = !1, console: console1 })=>{
|
14046
|
+
let debugFilters = "boolean" == typeof debug ? [
|
14047
|
+
()=>debug
|
14048
|
+
] : [].concat(debug).map(filterToFunction), loglevel = LogLevel[`${level}`] || 0;
|
14049
|
+
return (name, type, args)=>{
|
14050
|
+
let labeledArgs = ()=>Array.isArray(args) ? args.length > 0 && "string" == typeof args[0] ? [
|
14051
|
+
`[${name}] ${args[0]}`,
|
14052
|
+
...args.slice(1)
|
14053
|
+
] : [
|
14054
|
+
`[${name}]`,
|
14055
|
+
...args
|
14056
|
+
] : [], debug = debugFilters.some((f)=>f(name));
|
14057
|
+
switch(type){
|
14058
|
+
case LogType.debug:
|
14059
|
+
if (!debug) return;
|
14060
|
+
"function" == typeof console1.debug ? console1.debug(...labeledArgs()) : console1.log(...labeledArgs());
|
14061
|
+
break;
|
14062
|
+
case LogType.log:
|
14063
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14064
|
+
console1.log(...labeledArgs());
|
14065
|
+
break;
|
14066
|
+
case LogType.info:
|
14067
|
+
if (!debug && loglevel > LogLevel.info) return;
|
14068
|
+
console1.info(...labeledArgs());
|
14069
|
+
break;
|
14070
|
+
case LogType.warn:
|
14071
|
+
if (!debug && loglevel > LogLevel.warn) return;
|
14072
|
+
console1.warn(...labeledArgs());
|
14073
|
+
break;
|
14074
|
+
case LogType.error:
|
14075
|
+
if (!debug && loglevel > LogLevel.error) return;
|
14076
|
+
console1.error(...labeledArgs());
|
14077
|
+
break;
|
14078
|
+
case LogType.trace:
|
14079
|
+
if (!debug) return;
|
14080
|
+
console1.trace();
|
14081
|
+
break;
|
14082
|
+
case LogType.groupCollapsed:
|
14083
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14084
|
+
if (!debug && loglevel > LogLevel.verbose) {
|
14085
|
+
"function" == typeof console1.groupCollapsed ? console1.groupCollapsed(...labeledArgs()) : console1.log(...labeledArgs());
|
14086
|
+
break;
|
14087
|
+
}
|
14088
|
+
case LogType.group:
|
14089
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14090
|
+
"function" == typeof console1.group ? console1.group(...labeledArgs()) : console1.log(...labeledArgs());
|
14091
|
+
break;
|
14092
|
+
case LogType.groupEnd:
|
14093
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14094
|
+
"function" == typeof console1.groupEnd && console1.groupEnd();
|
14095
|
+
break;
|
14096
|
+
case LogType.time:
|
14097
|
+
{
|
14098
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14099
|
+
let ms = 1000 * args[1] + args[2] / 1000000, msg = `[${name}] ${args[0]}: ${ms} ms`;
|
14100
|
+
"function" == typeof console1.logTime ? console1.logTime(msg) : console1.log(msg);
|
14101
|
+
break;
|
14102
|
+
}
|
14103
|
+
case LogType.profile:
|
14104
|
+
"function" == typeof console1.profile && console1.profile(...labeledArgs());
|
14105
|
+
break;
|
14106
|
+
case LogType.profileEnd:
|
14107
|
+
"function" == typeof console1.profileEnd && console1.profileEnd(...labeledArgs());
|
14108
|
+
break;
|
14109
|
+
case LogType.clear:
|
14110
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14111
|
+
"function" == typeof console1.clear && console1.clear();
|
14112
|
+
break;
|
14113
|
+
case LogType.status:
|
14114
|
+
if (!debug && loglevel > LogLevel.info) return;
|
14115
|
+
"function" == typeof console1.status ? 0 === args.length ? console1.status() : console1.status(...labeledArgs()) : 0 !== args.length && console1.info(...labeledArgs());
|
14116
|
+
break;
|
14117
|
+
default:
|
14118
|
+
throw Error(`Unexpected LogType ${type}`);
|
14119
|
+
}
|
14120
|
+
};
|
14121
|
+
})({
|
14216
14122
|
level: infrastructureLogging.level || "info",
|
14217
14123
|
debug: infrastructureLogging.debug || !1,
|
14218
14124
|
console: infrastructureLogging.console || function({ colors, appendOnly, stream }) {
|
14219
|
-
let currentStatusMessage, hasStatusMessage = !1, currentIndent = "", currentCollapsed = 0,
|
14220
|
-
if ("" === str) return str;
|
14221
|
-
let prefixWithIndent = currentIndent + prefix;
|
14222
|
-
return colors ? prefixWithIndent + colorPrefix + str.replace(/\n/g, `${colorSuffix}\n${prefix}${colorPrefix}`) + colorSuffix : prefixWithIndent + str.replace(/\n/g, `\n${prefix}`);
|
14223
|
-
}, clearStatusMessage = ()=>{
|
14125
|
+
let currentStatusMessage, hasStatusMessage = !1, currentIndent = "", currentCollapsed = 0, clearStatusMessage = ()=>{
|
14224
14126
|
hasStatusMessage && (stream.write("\x1b[2K\r"), hasStatusMessage = !1);
|
14225
14127
|
}, writeStatusMessage = ()=>{
|
14226
14128
|
if (!currentStatusMessage) return;
|
@@ -14229,7 +14131,11 @@ Help:
|
|
14229
14131
|
}, writeColored = (prefix, colorPrefix, colorSuffix)=>(...args)=>{
|
14230
14132
|
if (currentCollapsed > 0) return;
|
14231
14133
|
clearStatusMessage();
|
14232
|
-
let str =
|
14134
|
+
let str = ((str, prefix, colorPrefix, colorSuffix)=>{
|
14135
|
+
if ("" === str) return str;
|
14136
|
+
let prefixWithIndent = currentIndent + prefix;
|
14137
|
+
return colors ? prefixWithIndent + colorPrefix + str.replace(/\n/g, `${colorSuffix}\n${prefix}${colorPrefix}`) + colorSuffix : prefixWithIndent + str.replace(/\n/g, `\n${prefix}`);
|
14138
|
+
})(external_node_util_namespaceObject.format(...args), prefix, colorPrefix, colorSuffix);
|
14233
14139
|
stream.write(`${str}\n`), writeStatusMessage();
|
14234
14140
|
}, writeGroupMessage = writeColored("<-> ", "\u001b[1m\u001b[36m", "\u001b[39m\u001b[22m"), writeGroupCollapsedMessage = writeColored("<+> ", "\u001b[1m\u001b[36m", "\u001b[39m\u001b[22m");
|
14235
14141
|
return {
|
@@ -14665,7 +14571,6 @@ Help:
|
|
14665
14571
|
"node-commonjs",
|
14666
14572
|
"commonjs-import"
|
14667
14573
|
])), getRspackOptionsSchema = memoize(()=>{
|
14668
|
-
var params;
|
14669
14574
|
let filenameTemplate = schemas_string(), filename = filenameTemplate.or(anyFunction), name = schemas_string(), dependencies = schemas_array(name), context = schemas_string().refine((val)=>external_node_path_default().isAbsolute(val), {
|
14670
14575
|
error: (issue)=>`The provided value ${JSON.stringify(issue.input)} must be an absolute path`
|
14671
14576
|
}), mode = schemas_enum([
|
@@ -15234,7 +15139,7 @@ Help:
|
|
15234
15139
|
]).or(_instanceof(RegExp)).or(anyFunction), optimizationSplitChunksSizes = numberOrInfinity.or(record(schemas_string(), numberOrInfinity)), sharedOptimizationSplitChunksCacheGroup = {
|
15235
15140
|
chunks: optimizationSplitChunksChunks,
|
15236
15141
|
defaultSizeTypes: schemas_array(schemas_string()),
|
15237
|
-
minChunks: schemas_number().min(1).or(literal(
|
15142
|
+
minChunks: schemas_number().min(1).or(literal(1 / 0)),
|
15238
15143
|
usedExports: schemas_boolean(),
|
15239
15144
|
name: optimizationSplitChunksName,
|
15240
15145
|
filename: filename,
|
@@ -15449,7 +15354,7 @@ Help:
|
|
15449
15354
|
bail: bail,
|
15450
15355
|
performance: performance
|
15451
15356
|
}).partial().check((ctx)=>{
|
15452
|
-
let
|
15357
|
+
let config = ctx.value, library = config?.output?.library;
|
15453
15358
|
function checkExternalItem(externalItem, path) {
|
15454
15359
|
if ("object" == typeof externalItem && null !== externalItem) for (let [key, value] of Object.entries(externalItem)){
|
15455
15360
|
var externalItemValue, path1;
|
@@ -15471,25 +15376,25 @@ Help:
|
|
15471
15376
|
"externals"
|
15472
15377
|
]));
|
15473
15378
|
});
|
15474
|
-
}), ModuleFederationRuntimePlugin = base_create(binding_.BuiltinPluginName.ModuleFederationRuntimePlugin, ()=>{}),
|
15475
|
-
let object = (obj)=>{
|
15476
|
-
for (let [key, value] of Object.entries(obj))"string" == typeof value || Array.isArray(value) ? fn(key, normalizeSimple(value, key)) : fn(key, normalizeOptions(value, key));
|
15477
|
-
};
|
15478
|
-
if (options) if (Array.isArray(options)) {
|
15479
|
-
var items = options;
|
15480
|
-
for (let item of items)if ("string" == typeof item) fn(item, normalizeSimple(item, item));
|
15481
|
-
else if (item && "object" == typeof item) object(item);
|
15482
|
-
else throw Error("Unexpected options format");
|
15483
|
-
} else if ("object" == typeof options) object(options);
|
15484
|
-
else throw Error("Unexpected options format");
|
15485
|
-
}, parseOptions = (options, normalizeSimple, normalizeOptions)=>{
|
15379
|
+
}), ModuleFederationRuntimePlugin = base_create(binding_.BuiltinPluginName.ModuleFederationRuntimePlugin, ()=>{}), parseOptions = (options, normalizeSimple, normalizeOptions)=>{
|
15486
15380
|
let items = [];
|
15487
|
-
|
15381
|
+
var options1 = options, normalizeSimple1 = normalizeSimple, normalizeOptions1 = normalizeOptions, fn = (key, value)=>{
|
15488
15382
|
items.push([
|
15489
15383
|
key,
|
15490
15384
|
value
|
15491
15385
|
]);
|
15492
|
-
}
|
15386
|
+
};
|
15387
|
+
let object = (obj)=>{
|
15388
|
+
for (let [key, value] of Object.entries(obj))"string" == typeof value || Array.isArray(value) ? fn(key, normalizeSimple1(value, key)) : fn(key, normalizeOptions1(value, key));
|
15389
|
+
};
|
15390
|
+
if (options1) if (Array.isArray(options1)) {
|
15391
|
+
var items1 = options1;
|
15392
|
+
for (let item of items1)if ("string" == typeof item) fn(item, normalizeSimple1(item, item));
|
15393
|
+
else if (item && "object" == typeof item) object(item);
|
15394
|
+
else throw Error("Unexpected options format");
|
15395
|
+
} else if ("object" == typeof options1) object(options1);
|
15396
|
+
else throw Error("Unexpected options format");
|
15397
|
+
return items;
|
15493
15398
|
};
|
15494
15399
|
class ModuleFederationPlugin {
|
15495
15400
|
_options;
|
@@ -15600,9 +15505,9 @@ Help:
|
|
15600
15505
|
let compilerSet = new WeakSet();
|
15601
15506
|
class ShareRuntimePlugin extends RspackBuiltinPlugin {
|
15602
15507
|
enhanced;
|
15603
|
-
name;
|
15508
|
+
name = binding_.BuiltinPluginName.ShareRuntimePlugin;
|
15604
15509
|
constructor(enhanced = !1){
|
15605
|
-
super(), this.enhanced = enhanced
|
15510
|
+
super(), this.enhanced = enhanced;
|
15606
15511
|
}
|
15607
15512
|
raw(compiler) {
|
15608
15513
|
var compiler1, compiler2;
|
@@ -15841,7 +15746,7 @@ Help:
|
|
15841
15746
|
let _options = JSON.stringify(options || {});
|
15842
15747
|
return binding_default().transform(source, _options);
|
15843
15748
|
}
|
15844
|
-
let exports_rspackVersion = "1.4.
|
15749
|
+
let exports_rspackVersion = "1.4.7-alpha.1", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
15845
15750
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
15846
15751
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
15847
15752
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
@@ -15980,12 +15885,13 @@ Help:
|
|
15980
15885
|
}
|
15981
15886
|
};
|
15982
15887
|
function createCompiler(userOptions) {
|
15983
|
-
|
15984
|
-
|
15985
|
-
|
15888
|
+
var options;
|
15889
|
+
let options1 = getNormalizedRspackOptions(userOptions);
|
15890
|
+
defaults_F(options = options1, "context", ()=>process.cwd()), applyInfrastructureLoggingDefaults(options.infrastructureLogging), external_node_assert_default()(!isNil(options1.context));
|
15891
|
+
let compiler = new Compiler(options1.context, options1);
|
15986
15892
|
if (new NodeEnvironmentPlugin({
|
15987
|
-
infrastructureLogging:
|
15988
|
-
}).apply(compiler), Array.isArray(
|
15893
|
+
infrastructureLogging: options1.infrastructureLogging
|
15894
|
+
}).apply(compiler), Array.isArray(options1.plugins)) for (let plugin of options1.plugins)"function" == typeof plugin ? plugin.call(compiler, compiler) : plugin && plugin.apply(compiler);
|
15989
15895
|
return applyRspackOptionsDefaults(compiler.options), compiler.hooks.environment.call(), compiler.hooks.afterEnvironment.call(), new RspackOptionsApply().process(compiler.options, compiler), compiler.hooks.initialize.call(), compiler;
|
15990
15896
|
}
|
15991
15897
|
let src_fn = Object.assign(function(options, callback) {
|