@rspack/core 1.4.7-alpha.0 → 1.4.7
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/compiled/glob-to-regexp/index.d.ts +11 -0
- package/compiled/glob-to-regexp/index.js +187 -0
- package/compiled/glob-to-regexp/package.json +1 -0
- package/compiled/watchpack/index.js +9 -149
- package/dist/Compilation.d.ts +6 -0
- package/dist/NativeWatchFileSystem.d.ts +17 -0
- package/dist/Watching.d.ts +10 -1
- package/dist/config/normalization.d.ts +1 -0
- package/dist/config/types.d.ts +5 -0
- package/dist/cssExtractLoader.js +53 -55
- package/dist/index.js +1632 -1611
- package/dist/schema/config.d.ts +1 -0
- package/dist/util/fs.d.ts +10 -1
- package/dist/worker.js +19 -16
- package/package.json +13 -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;
|
@@ -210,6 +210,9 @@ var __webpack_modules__ = {
|
|
210
210
|
"browserslist-load-config": function(module) {
|
211
211
|
module.exports = require("../compiled/browserslist-load-config/index.js");
|
212
212
|
},
|
213
|
+
"glob-to-regexp": function(module) {
|
214
|
+
module.exports = require("../compiled/glob-to-regexp/index.js");
|
215
|
+
},
|
213
216
|
watchpack: function(module) {
|
214
217
|
module.exports = require("../compiled/watchpack/index.js");
|
215
218
|
},
|
@@ -432,12 +435,12 @@ for(var __webpack_i__ in (()=>{
|
|
432
435
|
webworker: ()=>webworker
|
433
436
|
});
|
434
437
|
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
|
-
|
438
|
+
let lite_tapable_namespaceObject = require("@rspack/lite-tapable"), cutOffLoaderExecution = (stack)=>((stack, flag)=>{
|
439
|
+
let stacks = stack.split("\n");
|
440
|
+
for(let i = 0; i < stacks.length; i++)stacks[i].includes(flag) && (stacks.length = i);
|
441
|
+
return stacks.join("\n");
|
442
|
+
})(stack, "LOADER_EXECUTION"), cleanUp = (stack, name, message)=>{
|
443
|
+
cutOffLoaderExecution(stack);
|
441
444
|
return cutOffMessage(stack, name, message);
|
442
445
|
}, cutOffMessage = (stack, name, message)=>{
|
443
446
|
let nextLine = stack.indexOf("\n");
|
@@ -632,7 +635,7 @@ for(var __webpack_i__ in (()=>{
|
|
632
635
|
case "verbose":
|
633
636
|
return {
|
634
637
|
all: !0,
|
635
|
-
modulesSpace:
|
638
|
+
modulesSpace: 1 / 0
|
636
639
|
};
|
637
640
|
case "errors-only":
|
638
641
|
return {
|
@@ -826,76 +829,7 @@ for(var __webpack_i__ in (()=>{
|
|
826
829
|
return null != aValue ? null != bValue ? comparator(aValue, bValue) : -1 : +(null != bValue);
|
827
830
|
};
|
828
831
|
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
|
-
};
|
832
|
+
}, compareNumbers = (a, b)=>typeof a != typeof b ? typeof a < typeof b ? -1 : 1 : a < b ? -1 : +(a > b);
|
899
833
|
class StatsFactory {
|
900
834
|
hooks;
|
901
835
|
_caches;
|
@@ -1018,7 +952,76 @@ for(var __webpack_i__ in (()=>{
|
|
1018
952
|
}), comparators2 = [];
|
1019
953
|
this._forEachLevel(this.hooks.sortResults, this._caches.sortResults, type, (h)=>h.call(comparators2, context)), comparators2.length > 0 && resultItems.sort(concatComparators(...comparators2));
|
1020
954
|
let groupConfigs = [];
|
1021
|
-
this._forEachLevel(this.hooks.groupResults, this._caches.groupResults, type, (h)=>h.call(groupConfigs, context)), groupConfigs.length > 0 && (resultItems =
|
955
|
+
this._forEachLevel(this.hooks.groupResults, this._caches.groupResults, type, (h)=>h.call(groupConfigs, context)), groupConfigs.length > 0 && (resultItems = ((items, groupConfigs)=>{
|
956
|
+
let itemsWithGroups = new Set(), allGroups = new Map();
|
957
|
+
for (let item of items){
|
958
|
+
let groups = new Set();
|
959
|
+
for(let i = 0; i < groupConfigs.length; i++){
|
960
|
+
let groupConfig = groupConfigs[i], keys = groupConfig.getKeys(item);
|
961
|
+
if (keys) for (let name of keys){
|
962
|
+
let key = `${i}:${name}`, group = allGroups.get(key);
|
963
|
+
void 0 === group && allGroups.set(key, group = {
|
964
|
+
config: groupConfig,
|
965
|
+
name,
|
966
|
+
alreadyGrouped: !1,
|
967
|
+
items: void 0
|
968
|
+
}), groups.add(group);
|
969
|
+
}
|
970
|
+
}
|
971
|
+
itemsWithGroups.add({
|
972
|
+
item,
|
973
|
+
groups
|
974
|
+
});
|
975
|
+
}
|
976
|
+
let runGrouping = (itemsWithGroups)=>{
|
977
|
+
let totalSize = itemsWithGroups.size;
|
978
|
+
for (let entry of itemsWithGroups)for (let group of entry.groups){
|
979
|
+
if (group.alreadyGrouped) continue;
|
980
|
+
let items = group.items;
|
981
|
+
void 0 === items ? group.items = new Set([
|
982
|
+
entry
|
983
|
+
]) : items.add(entry);
|
984
|
+
}
|
985
|
+
let groupMap = new Map();
|
986
|
+
for (let group of allGroups.values())if (group.items) {
|
987
|
+
let items = group.items;
|
988
|
+
group.items = void 0, groupMap.set(group, {
|
989
|
+
items,
|
990
|
+
options: void 0,
|
991
|
+
used: !1
|
992
|
+
});
|
993
|
+
}
|
994
|
+
let results = [];
|
995
|
+
for(;;){
|
996
|
+
let bestGroup, bestGroupItems, bestGroupOptions, bestGroupSize = -1;
|
997
|
+
for (let [group, state] of groupMap){
|
998
|
+
let { items, used } = state, options = state.options;
|
999
|
+
if (void 0 === options) {
|
1000
|
+
let groupConfig = group.config;
|
1001
|
+
state.options = options = groupConfig.getOptions?.(group.name, Array.from(items, ({ item })=>item)) || !1;
|
1002
|
+
}
|
1003
|
+
let force = !1 !== options && options.force;
|
1004
|
+
if (!force && (!1 !== bestGroupOptions && bestGroupOptions?.force || used || items.size <= 1 || totalSize - items.size <= 1)) continue;
|
1005
|
+
let targetGroupCount = !1 !== options && options.targetGroupCount || 4, sizeValue = force ? items.size : Math.min(items.size, 2 * totalSize / targetGroupCount + itemsWithGroups.size - items.size);
|
1006
|
+
(sizeValue > bestGroupSize || force && (!bestGroupOptions || !bestGroupOptions.force)) && (bestGroup = group, bestGroupSize = sizeValue, bestGroupItems = items, bestGroupOptions = options);
|
1007
|
+
}
|
1008
|
+
if (void 0 === bestGroup) break;
|
1009
|
+
let items = new Set(bestGroupItems), options = bestGroupOptions, groupChildren = !options || !1 !== options.groupChildren;
|
1010
|
+
for (let item of items)for (let group of (itemsWithGroups.delete(item), item.groups)){
|
1011
|
+
let state = groupMap.get(group);
|
1012
|
+
void 0 !== state && (state.items.delete(item), 0 === state.items.size ? groupMap.delete(group) : (state.options = void 0, groupChildren && (state.used = !0)));
|
1013
|
+
}
|
1014
|
+
groupMap.delete(bestGroup);
|
1015
|
+
let key = bestGroup.name, groupConfig = bestGroup.config, allItems = Array.from(items, ({ item })=>item);
|
1016
|
+
bestGroup.alreadyGrouped = !0;
|
1017
|
+
let children = groupChildren ? runGrouping(items) : allItems;
|
1018
|
+
bestGroup.alreadyGrouped = !1, results.push(groupConfig.createGroup(key, children, allItems));
|
1019
|
+
}
|
1020
|
+
for (let { item } of itemsWithGroups)results.push(item);
|
1021
|
+
return results;
|
1022
|
+
};
|
1023
|
+
return runGrouping(itemsWithGroups);
|
1024
|
+
})(resultItems, groupConfigs));
|
1022
1025
|
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
1026
|
return void 0 === result && (result = finalResultItems), this._forEachLevelWaterfall(this.hooks.result, this._caches.result, type, result, (h, r)=>h.call(r, context));
|
1024
1027
|
}
|
@@ -1757,6 +1760,24 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
1757
1760
|
});
|
1758
1761
|
}
|
1759
1762
|
fileDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().fileDependencies, (d)=>this.#inner.addFileDependencies(d));
|
1763
|
+
get __internal__addedFileDependencies() {
|
1764
|
+
return this.#inner.dependencies().addedFileDependencies;
|
1765
|
+
}
|
1766
|
+
get __internal__removedFileDependencies() {
|
1767
|
+
return this.#inner.dependencies().removedFileDependencies;
|
1768
|
+
}
|
1769
|
+
get __internal__addedContextDependencies() {
|
1770
|
+
return this.#inner.dependencies().addedContextDependencies;
|
1771
|
+
}
|
1772
|
+
get __internal__removedContextDependencies() {
|
1773
|
+
return this.#inner.dependencies().removedContextDependencies;
|
1774
|
+
}
|
1775
|
+
get __internal__addedMissingDependencies() {
|
1776
|
+
return this.#inner.dependencies().addedMissingDependencies;
|
1777
|
+
}
|
1778
|
+
get __internal__removedMissingDependencies() {
|
1779
|
+
return this.#inner.dependencies().removedMissingDependencies;
|
1780
|
+
}
|
1760
1781
|
contextDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().contextDependencies, (d)=>this.#inner.addContextDependencies(d));
|
1761
1782
|
missingDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().missingDependencies, (d)=>this.#inner.addMissingDependencies(d));
|
1762
1783
|
buildDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().buildDependencies, (d)=>this.#inner.addBuildDependencies(d));
|
@@ -1974,22 +1995,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
1974
1995
|
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
1996
|
}
|
1976
1997
|
}
|
1977
|
-
let
|
1998
|
+
let makeWebpackErrorCallback = (callback, hook)=>(err, result)=>{
|
1978
1999
|
if (err) return err instanceof WebpackError ? void callback(err) : void callback(new HookWebpackError(err, hook));
|
1979
2000
|
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
|
-
};
|
2001
|
+
};
|
1993
2002
|
class Cache {
|
1994
2003
|
static STAGE_DISK = 10;
|
1995
2004
|
static STAGE_MEMORY = -10;
|
@@ -2019,10 +2028,11 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2019
2028
|
get(identifier, etag, callback) {
|
2020
2029
|
let gotHandlers = [];
|
2021
2030
|
this.hooks.get.callAsync(identifier, etag, gotHandlers, (err, res)=>{
|
2022
|
-
|
2031
|
+
var error, hook, times, callback1;
|
2032
|
+
if (err) return void callback((hook = "Cache.hooks.get", (error = err) instanceof WebpackError ? error : new HookWebpackError(error, hook)));
|
2023
2033
|
let result = res;
|
2024
2034
|
if (null === result && (result = void 0), gotHandlers.length > 1) {
|
2025
|
-
let innerCallback =
|
2035
|
+
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
2036
|
for (let gotHandler of gotHandlers)gotHandler(result, innerCallback);
|
2027
2037
|
} else 1 === gotHandlers.length ? gotHandlers[0](result, ()=>callback(null, result)) : callback(null, result);
|
2028
2038
|
});
|
@@ -2151,18 +2161,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2151
2161
|
return old.reset(), old;
|
2152
2162
|
}
|
2153
2163
|
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
2164
|
}, digestCaches = {};
|
2167
2165
|
class BulkUpdateDecorator extends Hash {
|
2168
2166
|
hash;
|
@@ -2221,9 +2219,21 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2221
2219
|
case "debug":
|
2222
2220
|
return new DebugHash();
|
2223
2221
|
case "xxhash64":
|
2224
|
-
return new WasmHashAdapter(
|
2222
|
+
return new WasmHashAdapter((()=>{
|
2223
|
+
if (!createXxhash64) {
|
2224
|
+
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"));
|
2225
|
+
createXxhash64 = wasm_hash.bind(null, xxhash64, [], 32, 16);
|
2226
|
+
}
|
2227
|
+
return createXxhash64();
|
2228
|
+
})());
|
2225
2229
|
case "md4":
|
2226
|
-
return new WasmHashAdapter(
|
2230
|
+
return new WasmHashAdapter((()=>{
|
2231
|
+
if (!createMd4) {
|
2232
|
+
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"));
|
2233
|
+
createMd4 = wasm_hash.bind(null, md4, [], 64, 32);
|
2234
|
+
}
|
2235
|
+
return createMd4();
|
2236
|
+
})());
|
2227
2237
|
case "native-md4":
|
2228
2238
|
return new BulkUpdateDecorator(()=>external_node_crypto_default().createHash("md4"), "md4");
|
2229
2239
|
default:
|
@@ -2245,22 +2255,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2245
2255
|
return this._hash;
|
2246
2256
|
}
|
2247
2257
|
}
|
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
|
-
};
|
2258
|
+
let mapStrings = new Map(), mapObjects = new WeakMap();
|
2264
2259
|
class MergedEtag {
|
2265
2260
|
a;
|
2266
2261
|
b;
|
@@ -2271,31 +2266,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2271
2266
|
return `${this.a.toString()}|${this.b.toString()}`;
|
2272
2267
|
}
|
2273
2268
|
}
|
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
|
-
};
|
2269
|
+
let dualObjectMap = new WeakMap(), objectStringMap = new WeakMap();
|
2299
2270
|
class ItemCacheFacade {
|
2300
2271
|
_cache;
|
2301
2272
|
_name;
|
@@ -2353,10 +2324,49 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2353
2324
|
return new ItemCacheFacade(this._cache, `${this._name}|${identifier}`, etag);
|
2354
2325
|
}
|
2355
2326
|
getLazyHashedEtag(obj) {
|
2356
|
-
return
|
2327
|
+
return ((obj, hashFunction = "xxhash64")=>{
|
2328
|
+
let innerMap;
|
2329
|
+
if ("string" == typeof hashFunction) {
|
2330
|
+
if (void 0 === (innerMap = mapStrings.get(hashFunction))) {
|
2331
|
+
let newHash = new LazyHashedEtag(obj, hashFunction);
|
2332
|
+
return (innerMap = new WeakMap()).set(obj, newHash), mapStrings.set(hashFunction, innerMap), newHash;
|
2333
|
+
}
|
2334
|
+
} else if (void 0 === (innerMap = mapObjects.get(hashFunction))) {
|
2335
|
+
let newHash = new LazyHashedEtag(obj, hashFunction);
|
2336
|
+
return (innerMap = new WeakMap()).set(obj, newHash), mapObjects.set(hashFunction, innerMap), newHash;
|
2337
|
+
}
|
2338
|
+
let hash = innerMap.get(obj);
|
2339
|
+
if (void 0 !== hash) return hash;
|
2340
|
+
let newHash = new LazyHashedEtag(obj, hashFunction);
|
2341
|
+
return innerMap.set(obj, newHash), newHash;
|
2342
|
+
})(obj, this._hashFunction);
|
2357
2343
|
}
|
2358
2344
|
mergeEtags(a, b) {
|
2359
|
-
return
|
2345
|
+
return ((first, second)=>{
|
2346
|
+
let a = first, b = second;
|
2347
|
+
if ("string" == typeof a) {
|
2348
|
+
if ("string" == typeof b) return `${a}|${b}`;
|
2349
|
+
let temp = b;
|
2350
|
+
b = a, a = temp;
|
2351
|
+
} else if ("string" != typeof b) {
|
2352
|
+
let map = dualObjectMap.get(a);
|
2353
|
+
void 0 === map && dualObjectMap.set(a, map = new WeakMap());
|
2354
|
+
let mergedEtag = map.get(b);
|
2355
|
+
if (void 0 === mergedEtag) {
|
2356
|
+
let newMergedEtag = new MergedEtag(a, b);
|
2357
|
+
return map.set(b, newMergedEtag), newMergedEtag;
|
2358
|
+
}
|
2359
|
+
return mergedEtag;
|
2360
|
+
}
|
2361
|
+
let map = objectStringMap.get(a);
|
2362
|
+
void 0 === map && objectStringMap.set(a, map = new Map());
|
2363
|
+
let mergedEtag = map.get(b);
|
2364
|
+
if (void 0 === mergedEtag) {
|
2365
|
+
let newMergedEtag = new MergedEtag(a, b);
|
2366
|
+
return map.set(b, newMergedEtag), newMergedEtag;
|
2367
|
+
}
|
2368
|
+
return mergedEtag;
|
2369
|
+
})(a, b);
|
2360
2370
|
}
|
2361
2371
|
get(identifier, etag, callback) {
|
2362
2372
|
this._cache.get(`${this._name}|${identifier}`, etag, callback);
|
@@ -2416,16 +2426,16 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2416
2426
|
if (external_node_path_default().posix.isAbsolute(rootPath)) return external_node_path_default().posix.join(rootPath, filename);
|
2417
2427
|
if (external_node_path_default().win32.isAbsolute(rootPath)) return external_node_path_default().win32.join(rootPath, filename);
|
2418
2428
|
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
2429
|
}, mkdirp = (fs, p, callback)=>{
|
2425
2430
|
fs.mkdir(p, (err)=>{
|
2426
2431
|
if (err) {
|
2427
2432
|
if ("ENOENT" === err.code) {
|
2428
|
-
let dir =
|
2433
|
+
let dir = ((fs, absPath)=>{
|
2434
|
+
if (fs?.dirname) return fs.dirname(absPath);
|
2435
|
+
if (external_node_path_default().posix.isAbsolute(absPath)) return external_node_path_default().posix.dirname(absPath);
|
2436
|
+
if (external_node_path_default().win32.isAbsolute(absPath)) return external_node_path_default().win32.dirname(absPath);
|
2437
|
+
throw Error(`${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system`);
|
2438
|
+
})(fs, p);
|
2429
2439
|
return dir === p ? void callback(err) : void mkdirp(fs, dir, (err)=>{
|
2430
2440
|
if (err) return void callback(err);
|
2431
2441
|
fs.mkdir(p, (err)=>{
|
@@ -2679,6 +2689,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2679
2689
|
if (bufLike instanceof Uint8Array) return Buffer.from(bufLike.buffer);
|
2680
2690
|
throw Error("Buffer, Uint8Array or string expected");
|
2681
2691
|
};
|
2692
|
+
function serializeObject(map) {
|
2693
|
+
if (!isNil(map)) return "string" == typeof map ? map ? toBuffer(map) : void 0 : toBuffer(JSON.stringify(map));
|
2694
|
+
}
|
2682
2695
|
function stringifyLoaderObject(o) {
|
2683
2696
|
return o.path + o.query + o.fragment;
|
2684
2697
|
}
|
@@ -2696,7 +2709,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2696
2709
|
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);
|
2697
2710
|
}
|
2698
2711
|
return maybeAbsolutePath;
|
2699
|
-
},
|
2712
|
+
}, makeCacheable = (realFn)=>{
|
2700
2713
|
let cache = new WeakMap(), getCache = (associatedObjectForCache)=>{
|
2701
2714
|
let entry = cache.get(associatedObjectForCache);
|
2702
2715
|
if (void 0 !== entry) return entry;
|
@@ -2750,7 +2763,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2750
2763
|
return innerSubCache?.set(identifier, result), result;
|
2751
2764
|
};
|
2752
2765
|
}, cachedFn;
|
2753
|
-
}, 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)=>
|
2766
|
+
}, 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)=>{
|
2767
|
+
var context1, relativePath;
|
2768
|
+
return context1 = context, (relativePath = r).startsWith("./") || relativePath.startsWith("../") ? external_node_path_default().join(context1, relativePath) : relativePath;
|
2769
|
+
}).join("!")), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/, parseResource = makeCacheable((str)=>{
|
2754
2770
|
let match = PATH_QUERY_FRAGMENT_REGEXP.exec(str);
|
2755
2771
|
return {
|
2756
2772
|
resource: str,
|
@@ -2905,9 +2921,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2905
2921
|
"contextDependencies",
|
2906
2922
|
"missingDependencies",
|
2907
2923
|
"buildDependencies"
|
2908
|
-
])
|
2909
|
-
Object.keys(buildInfo).some((key)=>!knownBuildInfoFields.has(key)) && buildInfo[binding_.COMMIT_CUSTOM_FIELDS_SYMBOL]();
|
2910
|
-
};
|
2924
|
+
]);
|
2911
2925
|
Object.defineProperty(binding_.NormalModule.prototype, "identifier", {
|
2912
2926
|
enumerable: !0,
|
2913
2927
|
configurable: !0,
|
@@ -2928,9 +2942,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2928
2942
|
return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
|
2929
2943
|
}
|
2930
2944
|
});
|
2931
|
-
let
|
2932
|
-
_fakeHook: !0
|
2933
|
-
})), deprecateAllProperties = (obj, message, code)=>{
|
2945
|
+
let deprecateAllProperties = (obj, message, code)=>{
|
2934
2946
|
let newObj = {}, descriptors = Object.getOwnPropertyDescriptors(obj);
|
2935
2947
|
for (let name of Object.keys(descriptors)){
|
2936
2948
|
let descriptor = descriptors[name];
|
@@ -2967,12 +2979,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2967
2979
|
"module"
|
2968
2980
|
]),
|
2969
2981
|
readResourceForScheme: new lite_tapable_namespaceObject.HookMap((scheme)=>{
|
2970
|
-
let hook = hooks.readResource.for(scheme);
|
2971
|
-
return
|
2982
|
+
let fakeHook, message, code, hook = hooks.readResource.for(scheme);
|
2983
|
+
return fakeHook = {
|
2972
2984
|
tap: (options, fn)=>hook.tap(options, (loaderContext)=>fn(loaderContext.resource)),
|
2973
2985
|
tapAsync: (options, fn)=>hook.tapAsync(options, (loaderContext, callback)=>fn(loaderContext.resource, callback)),
|
2974
2986
|
tapPromise: (options, fn)=>hook.tapPromise(options, (loaderContext)=>fn(loaderContext.resource))
|
2975
|
-
})
|
2987
|
+
}, Object.freeze(Object.assign(message && code ? deprecateAllProperties(fakeHook, message, code) : fakeHook, {
|
2988
|
+
_fakeHook: !0
|
2989
|
+
}));
|
2976
2990
|
}),
|
2977
2991
|
readResource: new lite_tapable_namespaceObject.HookMap(()=>new lite_tapable_namespaceObject.AsyncSeriesBailHook([
|
2978
2992
|
"loaderContext"
|
@@ -3010,55 +3024,53 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3010
3024
|
}
|
3011
3025
|
static async cleanupJavaScriptTrace() {
|
3012
3026
|
if ("uninitialized" === this.state) throw Error("JavaScriptTracer is not initialized, please call initJavaScriptTrace first");
|
3013
|
-
|
3014
|
-
let profileHandler = (err, param)=>{
|
3015
|
-
let cpu_profile;
|
3016
|
-
if (err ? console.error("Error stopping profiler:", err) : cpu_profile = param.profile, cpu_profile) {
|
3017
|
-
let uuid = this.uuid();
|
3018
|
-
this.pushEvent({
|
3019
|
-
name: "Profile",
|
3020
|
-
ph: "P",
|
3021
|
-
trackName: "JavaScript CPU Profiler",
|
3022
|
-
processName: "JavaScript CPU",
|
3023
|
-
uuid,
|
3024
|
-
...this.getCommonEv(),
|
3025
|
-
categories: [
|
3026
|
-
"disabled-by-default-v8.cpu_profiler"
|
3027
|
-
],
|
3028
|
-
args: {
|
3029
|
-
data: {
|
3030
|
-
startTime: 0
|
3031
|
-
}
|
3032
|
-
}
|
3033
|
-
}), this.pushEvent({
|
3034
|
-
name: "ProfileChunk",
|
3035
|
-
ph: "P",
|
3036
|
-
trackName: "JavaScript CPU Profiler",
|
3037
|
-
processName: "JavaScript CPU",
|
3038
|
-
...this.getCommonEv(),
|
3039
|
-
categories: [
|
3040
|
-
"disabled-by-default-v8.cpu_profiler"
|
3041
|
-
],
|
3042
|
-
uuid,
|
3043
|
-
args: {
|
3044
|
-
data: {
|
3045
|
-
cpuProfile: cpu_profile,
|
3046
|
-
timeDeltas: cpu_profile.timeDeltas
|
3047
|
-
}
|
3048
|
-
}
|
3049
|
-
});
|
3050
|
-
}
|
3051
|
-
};
|
3052
|
-
await new Promise((resolve, reject)=>{
|
3027
|
+
this.layer && "off" !== this.state && (await new Promise((resolve, reject)=>{
|
3053
3028
|
this.session.post("Profiler.stop", (err, params)=>{
|
3054
3029
|
if (err) reject(err);
|
3055
3030
|
else try {
|
3056
|
-
|
3031
|
+
let cpu_profile;
|
3032
|
+
var err1 = err, param = params;
|
3033
|
+
if (err1 ? console.error("Error stopping profiler:", err1) : cpu_profile = param.profile, cpu_profile) {
|
3034
|
+
let uuid = this.uuid();
|
3035
|
+
this.pushEvent({
|
3036
|
+
name: "Profile",
|
3037
|
+
ph: "P",
|
3038
|
+
trackName: "JavaScript CPU Profiler",
|
3039
|
+
processName: "JavaScript CPU",
|
3040
|
+
uuid,
|
3041
|
+
...this.getCommonEv(),
|
3042
|
+
categories: [
|
3043
|
+
"disabled-by-default-v8.cpu_profiler"
|
3044
|
+
],
|
3045
|
+
args: {
|
3046
|
+
data: {
|
3047
|
+
startTime: 0
|
3048
|
+
}
|
3049
|
+
}
|
3050
|
+
}), this.pushEvent({
|
3051
|
+
name: "ProfileChunk",
|
3052
|
+
ph: "P",
|
3053
|
+
trackName: "JavaScript CPU Profiler",
|
3054
|
+
processName: "JavaScript CPU",
|
3055
|
+
...this.getCommonEv(),
|
3056
|
+
categories: [
|
3057
|
+
"disabled-by-default-v8.cpu_profiler"
|
3058
|
+
],
|
3059
|
+
uuid,
|
3060
|
+
args: {
|
3061
|
+
data: {
|
3062
|
+
cpuProfile: cpu_profile,
|
3063
|
+
timeDeltas: cpu_profile.timeDeltas
|
3064
|
+
}
|
3065
|
+
}
|
3066
|
+
});
|
3067
|
+
}
|
3068
|
+
resolve();
|
3057
3069
|
} catch (err) {
|
3058
3070
|
reject(err);
|
3059
3071
|
}
|
3060
3072
|
});
|
3061
|
-
}), this.state = "off";
|
3073
|
+
}), this.state = "off");
|
3062
3074
|
}
|
3063
3075
|
static getTs() {
|
3064
3076
|
return process.hrtime.bigint() - this.startTime;
|
@@ -3172,7 +3184,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3172
3184
|
error: serializeError(e)
|
3173
3185
|
});
|
3174
3186
|
}
|
3175
|
-
Atomics.add(sharedBufferView, 0, 1), Atomics.notify(sharedBufferView, 0,
|
3187
|
+
Atomics.add(sharedBufferView, 0, 1), Atomics.notify(sharedBufferView, 0, 1 / 0);
|
3176
3188
|
}), mainSyncPort.on("messageerror", handleError);
|
3177
3189
|
var obj = task, loaderName1 = loaderName;
|
3178
3190
|
let errors = [];
|
@@ -3344,10 +3356,26 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3344
3356
|
return loader.loaderItem;
|
3345
3357
|
}
|
3346
3358
|
}
|
3359
|
+
class JsSourceMap {
|
3360
|
+
static __from_binding(map) {
|
3361
|
+
return isNil(map) ? void 0 : ((input)=>{
|
3362
|
+
let s;
|
3363
|
+
if (Buffer.isBuffer(input)) s = input.toString("utf8");
|
3364
|
+
else if (input && "object" == typeof input) return input;
|
3365
|
+
else if ("string" == typeof input) s = input;
|
3366
|
+
else throw Error("Buffer or string or object expected");
|
3367
|
+
return JSON.parse(s);
|
3368
|
+
})(map);
|
3369
|
+
}
|
3370
|
+
static __to_binding(map) {
|
3371
|
+
return serializeObject(map);
|
3372
|
+
}
|
3373
|
+
}
|
3347
3374
|
function getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) {
|
3348
3375
|
return loaderContext.loaders?.length && index < loaderContext.loaders.length && index >= 0 && loaderContext.loaders[index] ? loaderContext.loaders[index] : null;
|
3349
3376
|
}
|
3350
3377
|
async function runLoaders(compiler, context) {
|
3378
|
+
var buildInfo;
|
3351
3379
|
let loaderState = context.loaderState, pitch = loaderState === binding_.JsLoaderState.Pitching, { resource } = context, uuid = JavaScriptTracer.uuid();
|
3352
3380
|
JavaScriptTracer.startAsync({
|
3353
3381
|
name: "run_js_loaders",
|
@@ -3546,63 +3574,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3546
3574
|
enumerable: !0,
|
3547
3575
|
get: ()=>context.__internal__parseMeta
|
3548
3576
|
});
|
3549
|
-
let
|
3550
|
-
let normalModule = loaderContext._module instanceof binding_.NormalModule ? loaderContext._module : void 0, workerLoaderContext = {
|
3551
|
-
hot: loaderContext.hot,
|
3552
|
-
context: loaderContext.context,
|
3553
|
-
resourcePath: loaderContext.resourcePath,
|
3554
|
-
resourceQuery: loaderContext.resourceQuery,
|
3555
|
-
resourceFragment: loaderContext.resourceFragment,
|
3556
|
-
resource: loaderContext.resource,
|
3557
|
-
mode: loaderContext.mode,
|
3558
|
-
sourceMap: loaderContext.sourceMap,
|
3559
|
-
rootContext: loaderContext.context,
|
3560
|
-
loaderIndex: loaderContext.loaderIndex,
|
3561
|
-
loaders: loaderContext.loaders.map((item)=>{
|
3562
|
-
let options = item.options;
|
3563
|
-
return (!item.parallel || item.request.startsWith(BUILTIN_LOADER_PREFIX)) && (options = void 0), {
|
3564
|
-
...item,
|
3565
|
-
options,
|
3566
|
-
pitch: void 0,
|
3567
|
-
normal: void 0,
|
3568
|
-
normalExecuted: item.normalExecuted,
|
3569
|
-
pitchExecuted: item.pitchExecuted
|
3570
|
-
};
|
3571
|
-
}),
|
3572
|
-
__internal__workerInfo: {
|
3573
|
-
hashFunction: compiler._lastCompilation.outputOptions.hashFunction
|
3574
|
-
},
|
3575
|
-
_compiler: {
|
3576
|
-
options: {
|
3577
|
-
experiments: {
|
3578
|
-
css: compiler.options.experiments.css
|
3579
|
-
}
|
3580
|
-
}
|
3581
|
-
},
|
3582
|
-
_compilation: {
|
3583
|
-
options: {
|
3584
|
-
output: {
|
3585
|
-
environment: compiler._lastCompilation.outputOptions.environment
|
3586
|
-
}
|
3587
|
-
},
|
3588
|
-
outputOptions: {
|
3589
|
-
hashSalt: compiler._lastCompilation.outputOptions.hashSalt,
|
3590
|
-
hashFunction: compiler._lastCompilation.outputOptions.hashFunction,
|
3591
|
-
hashDigest: compiler._lastCompilation.outputOptions.hashDigest,
|
3592
|
-
hashDigestLength: compiler._lastCompilation.outputOptions.hashDigestLength
|
3593
|
-
}
|
3594
|
-
},
|
3595
|
-
_module: {
|
3596
|
-
type: loaderContext._module.type,
|
3597
|
-
identifier: loaderContext._module.identifier(),
|
3598
|
-
matchResource: normalModule?.matchResource,
|
3599
|
-
request: normalModule?.request,
|
3600
|
-
userRequest: normalModule?.userRequest,
|
3601
|
-
rawRequest: normalModule?.rawRequest
|
3602
|
-
}
|
3603
|
-
};
|
3604
|
-
return Object.assign(workerLoaderContext, compiler.options.loader), workerLoaderContext;
|
3605
|
-
}, enableParallelism = (currentLoaderObject)=>compiler.options.experiments.parallelLoader && currentLoaderObject?.parallel, isomorphoicRun = async (fn, args)=>{
|
3577
|
+
let enableParallelism = (currentLoaderObject)=>compiler.options.experiments.parallelLoader && currentLoaderObject?.parallel, isomorphoicRun = async (fn, args)=>{
|
3606
3578
|
let result, currentLoaderObject = getCurrentLoader(loaderContext), parallelism = enableParallelism(currentLoaderObject), pitch = loaderState === binding_.JsLoaderState.Pitching, loaderName = function(loaderPath, cwd = "") {
|
3607
3579
|
let res = loaderPath.replace(cwd, "");
|
3608
3580
|
if (!external_node_path_default().isAbsolute(res)) return res;
|
@@ -3624,7 +3596,63 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3624
3596
|
resource: resource
|
3625
3597
|
}
|
3626
3598
|
}), parallelism) result = await service_run(loaderName, {
|
3627
|
-
loaderContext:
|
3599
|
+
loaderContext: (()=>{
|
3600
|
+
let normalModule = loaderContext._module instanceof binding_.NormalModule ? loaderContext._module : void 0, workerLoaderContext = {
|
3601
|
+
hot: loaderContext.hot,
|
3602
|
+
context: loaderContext.context,
|
3603
|
+
resourcePath: loaderContext.resourcePath,
|
3604
|
+
resourceQuery: loaderContext.resourceQuery,
|
3605
|
+
resourceFragment: loaderContext.resourceFragment,
|
3606
|
+
resource: loaderContext.resource,
|
3607
|
+
mode: loaderContext.mode,
|
3608
|
+
sourceMap: loaderContext.sourceMap,
|
3609
|
+
rootContext: loaderContext.context,
|
3610
|
+
loaderIndex: loaderContext.loaderIndex,
|
3611
|
+
loaders: loaderContext.loaders.map((item)=>{
|
3612
|
+
let options = item.options;
|
3613
|
+
return (!item.parallel || item.request.startsWith(BUILTIN_LOADER_PREFIX)) && (options = void 0), {
|
3614
|
+
...item,
|
3615
|
+
options,
|
3616
|
+
pitch: void 0,
|
3617
|
+
normal: void 0,
|
3618
|
+
normalExecuted: item.normalExecuted,
|
3619
|
+
pitchExecuted: item.pitchExecuted
|
3620
|
+
};
|
3621
|
+
}),
|
3622
|
+
__internal__workerInfo: {
|
3623
|
+
hashFunction: compiler._lastCompilation.outputOptions.hashFunction
|
3624
|
+
},
|
3625
|
+
_compiler: {
|
3626
|
+
options: {
|
3627
|
+
experiments: {
|
3628
|
+
css: compiler.options.experiments.css
|
3629
|
+
}
|
3630
|
+
}
|
3631
|
+
},
|
3632
|
+
_compilation: {
|
3633
|
+
options: {
|
3634
|
+
output: {
|
3635
|
+
environment: compiler._lastCompilation.outputOptions.environment
|
3636
|
+
}
|
3637
|
+
},
|
3638
|
+
outputOptions: {
|
3639
|
+
hashSalt: compiler._lastCompilation.outputOptions.hashSalt,
|
3640
|
+
hashFunction: compiler._lastCompilation.outputOptions.hashFunction,
|
3641
|
+
hashDigest: compiler._lastCompilation.outputOptions.hashDigest,
|
3642
|
+
hashDigestLength: compiler._lastCompilation.outputOptions.hashDigestLength
|
3643
|
+
}
|
3644
|
+
},
|
3645
|
+
_module: {
|
3646
|
+
type: loaderContext._module.type,
|
3647
|
+
identifier: loaderContext._module.identifier(),
|
3648
|
+
matchResource: normalModule?.matchResource,
|
3649
|
+
request: normalModule?.request,
|
3650
|
+
userRequest: normalModule?.userRequest,
|
3651
|
+
rawRequest: normalModule?.rawRequest
|
3652
|
+
}
|
3653
|
+
};
|
3654
|
+
return Object.assign(workerLoaderContext, compiler.options.loader), workerLoaderContext;
|
3655
|
+
})(),
|
3628
3656
|
loaderState,
|
3629
3657
|
args
|
3630
3658
|
}, {
|
@@ -3772,14 +3800,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3772
3800
|
]);
|
3773
3801
|
if (args.some((value)=>void 0 !== value)) {
|
3774
3802
|
let [content, sourceMap, additionalData] = args;
|
3775
|
-
context.content = isNil(content) ? null : toBuffer(content), context.sourceMap = sourceMap
|
3803
|
+
context.content = isNil(content) ? null : toBuffer(content), context.sourceMap = serializeObject(sourceMap), context.additionalData = additionalData || void 0;
|
3776
3804
|
break;
|
3777
3805
|
}
|
3778
3806
|
}
|
3779
3807
|
break;
|
3780
3808
|
case binding_.JsLoaderState.Normal:
|
3781
3809
|
{
|
3782
|
-
let content = context.content, sourceMap = context.sourceMap, additionalData = context.additionalData;
|
3810
|
+
let content = context.content, sourceMap = JsSourceMap.__from_binding(context.sourceMap), additionalData = context.additionalData;
|
3783
3811
|
for(; loaderContext.loaderIndex >= 0;){
|
3784
3812
|
let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex], parallelism = enableParallelism(currentLoaderObject);
|
3785
3813
|
if (currentLoaderObject.shouldYield()) break;
|
@@ -3795,7 +3823,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3795
3823
|
additionalData
|
3796
3824
|
]));
|
3797
3825
|
}
|
3798
|
-
context.content = isNil(content) ? null : toBuffer(content), context.sourceMap = sourceMap
|
3826
|
+
context.content = isNil(content) ? null : toBuffer(content), context.sourceMap = JsSourceMap.__to_binding(sourceMap), context.additionalData = additionalData || void 0, context.__internal__utf8Hint = "string" == typeof content;
|
3799
3827
|
break;
|
3800
3828
|
}
|
3801
3829
|
default:
|
@@ -3815,7 +3843,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3815
3843
|
is_pitch: pitch,
|
3816
3844
|
resource: resource
|
3817
3845
|
}
|
3818
|
-
}), compiler.options.experiments.cache && compiler.options?.cache &&
|
3846
|
+
}), 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;
|
3819
3847
|
}
|
3820
3848
|
let loader_runner_PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/;
|
3821
3849
|
function parsePathQueryFragment(str) {
|
@@ -3839,8 +3867,41 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3839
3867
|
], path1 = path, options1 = options, uses1.length ? uses1.filter(Boolean).map((use, index)=>{
|
3840
3868
|
let o, isBuiltin = !1;
|
3841
3869
|
if (use.loader.startsWith(BUILTIN_LOADER_PREFIX)) {
|
3842
|
-
|
3843
|
-
|
3870
|
+
let temp = function(identifier, o, options) {
|
3871
|
+
if (identifier.startsWith(`${BUILTIN_LOADER_PREFIX}swc-loader`)) {
|
3872
|
+
var o1, options1, options2 = o;
|
3873
|
+
if (options2 && "object" == typeof options2) {
|
3874
|
+
options2.jsc ??= {}, options2.jsc.experimental ??= {}, options2.jsc.experimental.disableAllLints ??= !0;
|
3875
|
+
let { rspackExperiments } = options2;
|
3876
|
+
rspackExperiments && ((rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
|
3877
|
+
if (pluginImport) return pluginImport.map((config)=>{
|
3878
|
+
let rawConfig = {
|
3879
|
+
...config,
|
3880
|
+
style: {}
|
3881
|
+
};
|
3882
|
+
if ("boolean" == typeof config.style) rawConfig.style.bool = config.style;
|
3883
|
+
else if ("string" == typeof config.style) {
|
3884
|
+
let isTpl = config.style.includes("{{");
|
3885
|
+
rawConfig.style[isTpl ? "custom" : "css"] = config.style;
|
3886
|
+
} else {
|
3887
|
+
var val;
|
3888
|
+
val = config.style, "[object Object]" === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
|
3889
|
+
}
|
3890
|
+
return config.styleLibraryDirectory && (rawConfig.style = {
|
3891
|
+
styleLibraryDirectory: config.styleLibraryDirectory
|
3892
|
+
}), rawConfig;
|
3893
|
+
});
|
3894
|
+
}(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (rspackExperiments.collectTypeScriptInfo = {
|
3895
|
+
typeExports: (options1 = rspackExperiments.collectTypeScriptInfo).typeExports,
|
3896
|
+
exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum ? "none" : "const-only"
|
3897
|
+
}));
|
3898
|
+
}
|
3899
|
+
return options2;
|
3900
|
+
}
|
3901
|
+
return identifier.startsWith(`${BUILTIN_LOADER_PREFIX}lightningcss-loader`) ? ((o1 = o) && "object" == typeof o1 && ("string" == typeof o1.targets && (o1.targets = [
|
3902
|
+
o1.targets
|
3903
|
+
]), o1.include && "object" == typeof o1.include && (o1.include = toFeatures(o1.include)), o1.exclude && "object" == typeof o1.exclude && (o1.exclude = toFeatures(o1.exclude))), o1) : o;
|
3904
|
+
}(use.loader, use.options, 0);
|
3844
3905
|
o = isNil(temp) ? void 0 : "string" == typeof temp ? temp : JSON.stringify(temp, null, 2), isBuiltin = !0;
|
3845
3906
|
}
|
3846
3907
|
return {
|
@@ -3855,125 +3916,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
3855
3916
|
};
|
3856
3917
|
}) : [];
|
3857
3918
|
}
|
3858
|
-
let getSwcLoaderOptions = (options, _)=>{
|
3859
|
-
if (options && "object" == typeof options) {
|
3860
|
-
options.jsc ??= {}, options.jsc.experimental ??= {}, options.jsc.experimental.disableAllLints ??= !0;
|
3861
|
-
let { rspackExperiments } = options;
|
3862
|
-
if (rspackExperiments) {
|
3863
|
-
var options1;
|
3864
|
-
(rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
|
3865
|
-
if (pluginImport) return pluginImport.map((config)=>{
|
3866
|
-
let rawConfig = {
|
3867
|
-
...config,
|
3868
|
-
style: {}
|
3869
|
-
};
|
3870
|
-
if ("boolean" == typeof config.style) rawConfig.style.bool = config.style;
|
3871
|
-
else if ("string" == typeof config.style) {
|
3872
|
-
let isTpl = config.style.includes("{{");
|
3873
|
-
rawConfig.style[isTpl ? "custom" : "css"] = config.style;
|
3874
|
-
} else {
|
3875
|
-
var val;
|
3876
|
-
val = config.style, "[object Object]" === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
|
3877
|
-
}
|
3878
|
-
return config.styleLibraryDirectory && (rawConfig.style = {
|
3879
|
-
styleLibraryDirectory: config.styleLibraryDirectory
|
3880
|
-
}), rawConfig;
|
3881
|
-
});
|
3882
|
-
}(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (rspackExperiments.collectTypeScriptInfo = {
|
3883
|
-
typeExports: (options1 = rspackExperiments.collectTypeScriptInfo).typeExports,
|
3884
|
-
exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum ? "none" : "const-only"
|
3885
|
-
});
|
3886
|
-
}
|
3887
|
-
}
|
3888
|
-
return options;
|
3889
|
-
}, getLightningcssLoaderOptions = (o, _)=>(o && "object" == typeof o && ("string" == typeof o.targets && (o.targets = [
|
3890
|
-
o.targets
|
3891
|
-
]), o.include && "object" == typeof o.include && (o.include = toFeatures(o.include)), o.exclude && "object" == typeof o.exclude && (o.exclude = toFeatures(o.exclude))), o);
|
3892
3919
|
function isUseSourceMap(devtool) {
|
3893
3920
|
return !!devtool && devtool.includes("source-map") && (devtool.includes("module") || !devtool.includes("cheap"));
|
3894
3921
|
}
|
3895
|
-
let getRawOptions = (options, compiler)=>{
|
3896
|
-
var output, module, options1, parser, generator, stats;
|
3897
|
-
let mode = options.mode, experiments = options.experiments;
|
3898
|
-
return {
|
3899
|
-
name: options.name,
|
3900
|
-
mode,
|
3901
|
-
context: options.context,
|
3902
|
-
output: {
|
3903
|
-
...output = options.output,
|
3904
|
-
environment: function(environment = {}) {
|
3905
|
-
return {
|
3906
|
-
const: !!environment.const,
|
3907
|
-
arrowFunction: !!environment.arrowFunction,
|
3908
|
-
nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
|
3909
|
-
asyncFunction: !!environment.asyncFunction,
|
3910
|
-
bigIntLiteral: !!environment.bigIntLiteral,
|
3911
|
-
destructuring: !!environment.destructuring,
|
3912
|
-
document: !!environment.document,
|
3913
|
-
dynamicImport: !!environment.dynamicImport,
|
3914
|
-
forOf: !!environment.forOf,
|
3915
|
-
globalThis: !!environment.globalThis,
|
3916
|
-
module: !!environment.module,
|
3917
|
-
optionalChaining: !!environment.optionalChaining,
|
3918
|
-
templateLiteral: !!environment.templateLiteral
|
3919
|
-
};
|
3920
|
-
}(output.environment)
|
3921
|
-
},
|
3922
|
-
resolve: getRawResolve(options.resolve),
|
3923
|
-
resolveLoader: getRawResolve(options.resolveLoader),
|
3924
|
-
module: (module = options.module, options1 = {
|
3925
|
-
compiler,
|
3926
|
-
mode,
|
3927
|
-
context: options.context,
|
3928
|
-
experiments
|
3929
|
-
}, external_node_assert_default()(!isNil(module.defaultRules), "module.defaultRules should not be nil after defaults"), {
|
3930
|
-
rules: [
|
3931
|
-
{
|
3932
|
-
rules: module.defaultRules
|
3933
|
-
},
|
3934
|
-
{
|
3935
|
-
rules: module.rules
|
3936
|
-
}
|
3937
|
-
].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options1, "javascript/auto")),
|
3938
|
-
parser: Object.fromEntries(Object.entries(parser = module.parser).map(([k, v])=>[
|
3939
|
-
k,
|
3940
|
-
getRawParserOptions(v, k)
|
3941
|
-
]).filter(([k, v])=>void 0 !== v)),
|
3942
|
-
generator: Object.fromEntries(Object.entries(generator = module.generator).map(([k, v])=>[
|
3943
|
-
k,
|
3944
|
-
getRawGeneratorOptions(v, k)
|
3945
|
-
]).filter(([k, v])=>void 0 !== v)),
|
3946
|
-
noParse: module.noParse
|
3947
|
-
}),
|
3948
|
-
optimization: options.optimization,
|
3949
|
-
stats: {
|
3950
|
-
colors: function(options) {
|
3951
|
-
if ("boolean" == typeof options || "string" == typeof options) return presetToOptions(options);
|
3952
|
-
if (!options) return {};
|
3953
|
-
let obj = {
|
3954
|
-
...presetToOptions(options.preset),
|
3955
|
-
...options
|
3956
|
-
};
|
3957
|
-
return delete obj.preset, obj;
|
3958
|
-
}(stats = options.stats).colors ?? !1
|
3959
|
-
},
|
3960
|
-
cache: {
|
3961
|
-
type: options.cache ? "memory" : "disable"
|
3962
|
-
},
|
3963
|
-
experiments,
|
3964
|
-
node: function(node) {
|
3965
|
-
if (!1 !== node) return external_node_assert_default()(!isNil(node.__dirname) && !isNil(node.global) && !isNil(node.__filename)), {
|
3966
|
-
dirname: String(node.__dirname),
|
3967
|
-
filename: String(node.__filename),
|
3968
|
-
global: String(node.global)
|
3969
|
-
};
|
3970
|
-
}(options.node),
|
3971
|
-
profile: options.profile,
|
3972
|
-
amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
|
3973
|
-
bail: options.bail,
|
3974
|
-
__references: {}
|
3975
|
-
};
|
3976
|
-
};
|
3977
3922
|
function getRawAlias(alias = {}) {
|
3978
3923
|
return !("object" != typeof alias || null === alias || Array.isArray(alias)) && Object.entries(alias).map(([key, value])=>({
|
3979
3924
|
path: key,
|
@@ -4199,7 +4144,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
4199
4144
|
};
|
4200
4145
|
}
|
4201
4146
|
function getRawGeneratorOptions(generator, type) {
|
4202
|
-
var options, options1
|
4147
|
+
var options, options1;
|
4203
4148
|
if ("asset" === type) {
|
4204
4149
|
return {
|
4205
4150
|
type: "asset",
|
@@ -4234,14 +4179,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
4234
4179
|
type: "css/module",
|
4235
4180
|
cssModule: getRawCssAutoOrModuleGeneratorOptions(generator)
|
4236
4181
|
};
|
4237
|
-
if ("json" === type) {
|
4238
|
-
|
4239
|
-
|
4240
|
-
|
4241
|
-
|
4242
|
-
|
4243
|
-
};
|
4244
|
-
}
|
4182
|
+
if ("json" === type) return {
|
4183
|
+
type: "json",
|
4184
|
+
json: {
|
4185
|
+
JSONParse: generator.JSONParse
|
4186
|
+
}
|
4187
|
+
};
|
4245
4188
|
if (![
|
4246
4189
|
"asset/source",
|
4247
4190
|
"javascript",
|
@@ -4321,7 +4264,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
4321
4264
|
return Array.isArray(str) ? str.join("\n") : str;
|
4322
4265
|
}
|
4323
4266
|
static getModulesArrayBounds(modules) {
|
4324
|
-
let maxId =
|
4267
|
+
let maxId = -1 / 0, minId = 1 / 0;
|
4325
4268
|
for (let module of modules){
|
4326
4269
|
let moduleId = module.id;
|
4327
4270
|
if ("number" != typeof moduleId) return !1;
|
@@ -4553,10 +4496,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
4553
4496
|
class DynamicEntryPlugin extends RspackBuiltinPlugin {
|
4554
4497
|
context;
|
4555
4498
|
entry;
|
4556
|
-
name;
|
4557
|
-
affectedHooks;
|
4499
|
+
name = binding_.BuiltinPluginName.DynamicEntryPlugin;
|
4500
|
+
affectedHooks = "make";
|
4558
4501
|
constructor(context, entry){
|
4559
|
-
super(), this.context = context, this.entry = entry
|
4502
|
+
super(), this.context = context, this.entry = entry;
|
4560
4503
|
}
|
4561
4504
|
raw(compiler) {
|
4562
4505
|
let raw = {
|
@@ -4604,9 +4547,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4604
4547
|
};
|
4605
4548
|
class EnableLibraryPlugin extends RspackBuiltinPlugin {
|
4606
4549
|
type;
|
4607
|
-
name;
|
4550
|
+
name = binding_.BuiltinPluginName.EnableLibraryPlugin;
|
4608
4551
|
constructor(type){
|
4609
|
-
super(), this.type = type
|
4552
|
+
super(), this.type = type;
|
4610
4553
|
}
|
4611
4554
|
static setEnabled(compiler, type) {
|
4612
4555
|
EnableLibraryPlugin_getEnabledTypes(compiler).add(type);
|
@@ -4623,9 +4566,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4623
4566
|
class ExternalsPlugin extends RspackBuiltinPlugin {
|
4624
4567
|
type;
|
4625
4568
|
externals;
|
4626
|
-
name;
|
4569
|
+
name = binding_.BuiltinPluginName.ExternalsPlugin;
|
4627
4570
|
constructor(type, externals){
|
4628
|
-
super(), this.type = type, this.externals = externals
|
4571
|
+
super(), this.type = type, this.externals = externals;
|
4629
4572
|
}
|
4630
4573
|
raw(compiler) {
|
4631
4574
|
let { type, externals } = this, raw = {
|
@@ -4694,10 +4637,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4694
4637
|
let FileUriPlugin = base_create(binding_.BuiltinPluginName.FileUriPlugin, ()=>{}, "compilation"), FlagDependencyExportsPlugin = base_create(binding_.BuiltinPluginName.FlagDependencyExportsPlugin, ()=>{}, "compilation");
|
4695
4638
|
class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
|
4696
4639
|
global;
|
4697
|
-
name;
|
4698
|
-
affectedHooks;
|
4640
|
+
name = binding_.BuiltinPluginName.FlagDependencyUsagePlugin;
|
4641
|
+
affectedHooks = "compilation";
|
4699
4642
|
constructor(global){
|
4700
|
-
super(), this.global = global
|
4643
|
+
super(), this.global = global;
|
4701
4644
|
}
|
4702
4645
|
raw(compiler) {
|
4703
4646
|
return createBuiltinPlugin(this.name, this.global);
|
@@ -4709,9 +4652,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4709
4652
|
return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0), createBuiltinPlugin(this.name, void 0);
|
4710
4653
|
}
|
4711
4654
|
}
|
4712
|
-
let hooks_compilationHooksMap = new WeakMap()
|
4713
|
-
hooks_compilationHooksMap.delete(compilation);
|
4714
|
-
};
|
4655
|
+
let hooks_compilationHooksMap = new WeakMap();
|
4715
4656
|
function $constructor(name, initializer, params) {
|
4716
4657
|
function init(inst, def) {
|
4717
4658
|
var _a;
|
@@ -4742,7 +4683,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4742
4683
|
value: name
|
4743
4684
|
}), _;
|
4744
4685
|
}
|
4745
|
-
|
4686
|
+
Object.freeze({
|
4687
|
+
status: "aborted"
|
4688
|
+
}), Symbol("zod_brand");
|
4746
4689
|
class $ZodAsyncError extends Error {
|
4747
4690
|
constructor(){
|
4748
4691
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
@@ -4752,9 +4695,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4752
4695
|
function core_config(newConfig) {
|
4753
4696
|
return newConfig && Object.assign(globalConfig, newConfig), globalConfig;
|
4754
4697
|
}
|
4755
|
-
|
4756
|
-
|
4698
|
+
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}$`);
|
4699
|
+
function timeSource(args) {
|
4700
|
+
let hhmm = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
4701
|
+
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+)?)?`;
|
4757
4702
|
}
|
4703
|
+
let integer = /^\d+$/, number = /^-?\d+(?:\.\d+)?/i, regexes_boolean = /true|false/i, _null = /null/i, _undefined = /undefined/i, lowercase = /^[^A-Z]*$/, uppercase = /^[^a-z]*$/;
|
4758
4704
|
function jsonStringifyReplacer(_, value) {
|
4759
4705
|
return "bigint" == typeof value ? value.toString() : value;
|
4760
4706
|
}
|
@@ -4798,18 +4744,15 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4798
4744
|
configurable: !0
|
4799
4745
|
});
|
4800
4746
|
}
|
4801
|
-
function randomString(length = 10) {
|
4802
|
-
let chars = "abcdefghijklmnopqrstuvwxyz", str = "";
|
4803
|
-
for(let i = 0; i < length; i++)str += chars[Math.floor(Math.random() * chars.length)];
|
4804
|
-
return str;
|
4805
|
-
}
|
4806
4747
|
function esc(str) {
|
4807
4748
|
return JSON.stringify(str);
|
4808
4749
|
}
|
4750
|
+
let captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args)=>{};
|
4809
4751
|
function util_isObject(data) {
|
4810
4752
|
return "object" == typeof data && null !== data && !Array.isArray(data);
|
4811
4753
|
}
|
4812
4754
|
let util_allowsEval = util_cached(()=>{
|
4755
|
+
if ("undefined" != typeof navigator && navigator?.userAgent?.includes("Cloudflare")) return !1;
|
4813
4756
|
try {
|
4814
4757
|
return Function(""), !0;
|
4815
4758
|
} catch (_) {
|
@@ -4823,36 +4766,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4823
4766
|
let prot = ctor.prototype;
|
4824
4767
|
return !1 !== util_isObject(prot) && !1 !== Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf");
|
4825
4768
|
}
|
4826
|
-
let
|
4827
|
-
let t = typeof data;
|
4828
|
-
switch(t){
|
4829
|
-
case "undefined":
|
4830
|
-
return "undefined";
|
4831
|
-
case "string":
|
4832
|
-
return "string";
|
4833
|
-
case "number":
|
4834
|
-
return Number.isNaN(data) ? "nan" : "number";
|
4835
|
-
case "boolean":
|
4836
|
-
return "boolean";
|
4837
|
-
case "function":
|
4838
|
-
return "function";
|
4839
|
-
case "bigint":
|
4840
|
-
return "bigint";
|
4841
|
-
case "symbol":
|
4842
|
-
return "symbol";
|
4843
|
-
case "object":
|
4844
|
-
if (Array.isArray(data)) return "array";
|
4845
|
-
if (null === data) return "null";
|
4846
|
-
if (data.then && "function" == typeof data.then && data.catch && "function" == typeof data.catch) return "promise";
|
4847
|
-
if ("undefined" != typeof Map && data instanceof Map) return "map";
|
4848
|
-
if ("undefined" != typeof Set && data instanceof Set) return "set";
|
4849
|
-
if ("undefined" != typeof Date && data instanceof Date) return "date";
|
4850
|
-
if ("undefined" != typeof File && data instanceof File) return "file";
|
4851
|
-
return "object";
|
4852
|
-
default:
|
4853
|
-
throw Error(`Unknown data type: ${t}`);
|
4854
|
-
}
|
4855
|
-
}, propertyKeyTypes = new Set([
|
4769
|
+
let propertyKeyTypes = new Set([
|
4856
4770
|
"string",
|
4857
4771
|
"number",
|
4858
4772
|
"symbol"
|
@@ -4878,9 +4792,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4878
4792
|
error: ()=>_params.error
|
4879
4793
|
} : _params;
|
4880
4794
|
}
|
4881
|
-
function stringifyPrimitive(value) {
|
4882
|
-
return "bigint" == typeof value ? value.toString() + "n" : "string" == typeof value ? `"${value}"` : `${value}`;
|
4883
|
-
}
|
4884
4795
|
let NUMBER_FORMAT_RANGES = {
|
4885
4796
|
safeint: [
|
4886
4797
|
Number.MIN_SAFE_INTEGER,
|
@@ -4904,7 +4815,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4904
4815
|
]
|
4905
4816
|
};
|
4906
4817
|
function aborted(x, startIndex = 0) {
|
4907
|
-
for(let i = startIndex; i < x.issues.length; i++)if (
|
4818
|
+
for(let i = startIndex; i < x.issues.length; i++)if (x.issues[i]?.continue !== !0) return !0;
|
4908
4819
|
return !1;
|
4909
4820
|
}
|
4910
4821
|
function prefixIssues(path, issues) {
|
@@ -4934,62 +4845,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4934
4845
|
...iss
|
4935
4846
|
};
|
4936
4847
|
}
|
4937
|
-
let
|
4938
|
-
inst.name = "$ZodError", Object.defineProperty(inst, "_zod", {
|
4939
|
-
value: inst._zod,
|
4940
|
-
enumerable: !1
|
4941
|
-
}), Object.defineProperty(inst, "issues", {
|
4942
|
-
value: def,
|
4943
|
-
enumerable: !1
|
4944
|
-
}), Object.defineProperty(inst, "message", {
|
4945
|
-
get: ()=>JSON.stringify(def, jsonStringifyReplacer, 2),
|
4946
|
-
enumerable: !0
|
4947
|
-
});
|
4948
|
-
}, $ZodError = $constructor("$ZodError", errors_initializer), $ZodRealError = $constructor("$ZodError", errors_initializer, {
|
4949
|
-
Parent: Error
|
4950
|
-
}), _safeParse = (_Err)=>(schema, value, _ctx)=>{
|
4951
|
-
let ctx = _ctx ? {
|
4952
|
-
..._ctx,
|
4953
|
-
async: !1
|
4954
|
-
} : {
|
4955
|
-
async: !1
|
4956
|
-
}, result = schema._zod.run({
|
4957
|
-
value,
|
4958
|
-
issues: []
|
4959
|
-
}, ctx);
|
4960
|
-
if (result instanceof Promise) throw new $ZodAsyncError();
|
4961
|
-
return result.issues.length ? {
|
4962
|
-
success: !1,
|
4963
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
|
4964
|
-
} : {
|
4965
|
-
success: !0,
|
4966
|
-
data: result.value
|
4967
|
-
};
|
4968
|
-
}, safeParse = _safeParse($ZodRealError), _safeParseAsync = (_Err)=>async (schema, value, _ctx)=>{
|
4969
|
-
let ctx = _ctx ? Object.assign(_ctx, {
|
4970
|
-
async: !0
|
4971
|
-
}) : {
|
4972
|
-
async: !0
|
4973
|
-
}, result = schema._zod.run({
|
4974
|
-
value,
|
4975
|
-
issues: []
|
4976
|
-
}, ctx);
|
4977
|
-
return result instanceof Promise && (result = await result), result.issues.length ? {
|
4978
|
-
success: !1,
|
4979
|
-
error: new _Err(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
|
4980
|
-
} : {
|
4981
|
-
success: !0,
|
4982
|
-
data: result.value
|
4983
|
-
};
|
4984
|
-
}, 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}$`);
|
4985
|
-
function timeSource(args) {
|
4986
|
-
let regex = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
4987
|
-
return args.precision ? regex = `${regex}\\.\\d{${args.precision}}` : null == args.precision && (regex = `${regex}(\\.\\d+)?`), regex;
|
4988
|
-
}
|
4989
|
-
let string = (params)=>{
|
4990
|
-
let regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : "[\\s\\S]*";
|
4991
|
-
return RegExp(`^${regex}$`);
|
4992
|
-
}, 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)=>{
|
4848
|
+
let $ZodCheck = $constructor("$ZodCheck", (inst, def)=>{
|
4993
4849
|
var _a;
|
4994
4850
|
inst._zod ?? (inst._zod = {}), inst._zod.def = def, (_a = inst._zod).onattach ?? (_a.onattach = []);
|
4995
4851
|
}), numericOriginMap = {
|
@@ -5000,7 +4856,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5000
4856
|
$ZodCheck.init(inst, def);
|
5001
4857
|
let origin = numericOriginMap[typeof def.value];
|
5002
4858
|
inst._zod.onattach.push((inst)=>{
|
5003
|
-
let bag = inst._zod.bag, curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ??
|
4859
|
+
let bag = inst._zod.bag, curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? 1 / 0;
|
5004
4860
|
def.value < curr && (def.inclusive ? bag.maximum = def.value : bag.exclusiveMaximum = def.value);
|
5005
4861
|
}), inst._zod.check = (payload)=>{
|
5006
4862
|
(def.inclusive ? payload.value <= def.value : payload.value < def.value) || payload.issues.push({
|
@@ -5017,11 +4873,11 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5017
4873
|
$ZodCheck.init(inst, def);
|
5018
4874
|
let origin = numericOriginMap[typeof def.value];
|
5019
4875
|
inst._zod.onattach.push((inst)=>{
|
5020
|
-
let bag = inst._zod.bag, curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ??
|
4876
|
+
let bag = inst._zod.bag, curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? -1 / 0;
|
5021
4877
|
def.value > curr && (def.inclusive ? bag.minimum = def.value : bag.exclusiveMinimum = def.value);
|
5022
4878
|
}), inst._zod.check = (payload)=>{
|
5023
4879
|
(def.inclusive ? payload.value >= def.value : payload.value > def.value) || payload.issues.push({
|
5024
|
-
origin
|
4880
|
+
origin,
|
5025
4881
|
code: "too_small",
|
5026
4882
|
minimum: def.value,
|
5027
4883
|
input: payload.value,
|
@@ -5084,9 +4940,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5084
4940
|
}
|
5085
4941
|
input < minimum && payload.issues.push({
|
5086
4942
|
origin: "number",
|
5087
|
-
input
|
4943
|
+
input,
|
5088
4944
|
code: "too_small",
|
5089
|
-
minimum
|
4945
|
+
minimum,
|
5090
4946
|
inclusive: !0,
|
5091
4947
|
inst,
|
5092
4948
|
continue: !def.abort
|
@@ -5099,12 +4955,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5099
4955
|
});
|
5100
4956
|
};
|
5101
4957
|
}), $ZodCheckMaxLength = $constructor("$ZodCheckMaxLength", (inst, def)=>{
|
5102
|
-
|
5103
|
-
|
4958
|
+
var _a;
|
4959
|
+
$ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
|
5104
4960
|
let val = payload.value;
|
5105
4961
|
return null != val && void 0 !== val.length;
|
5106
|
-
}, inst._zod.onattach.push((inst)=>{
|
5107
|
-
let curr = inst._zod.bag.maximum ??
|
4962
|
+
}), inst._zod.onattach.push((inst)=>{
|
4963
|
+
let curr = inst._zod.bag.maximum ?? 1 / 0;
|
5108
4964
|
def.maximum < curr && (inst._zod.bag.maximum = def.maximum);
|
5109
4965
|
}), inst._zod.check = (payload)=>{
|
5110
4966
|
let input = payload.value;
|
@@ -5121,12 +4977,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5121
4977
|
});
|
5122
4978
|
};
|
5123
4979
|
}), $ZodCheckMinLength = $constructor("$ZodCheckMinLength", (inst, def)=>{
|
5124
|
-
|
5125
|
-
|
4980
|
+
var _a;
|
4981
|
+
$ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
|
5126
4982
|
let val = payload.value;
|
5127
4983
|
return null != val && void 0 !== val.length;
|
5128
|
-
}, inst._zod.onattach.push((inst)=>{
|
5129
|
-
let curr = inst._zod.bag.minimum ??
|
4984
|
+
}), inst._zod.onattach.push((inst)=>{
|
4985
|
+
let curr = inst._zod.bag.minimum ?? -1 / 0;
|
5130
4986
|
def.minimum > curr && (inst._zod.bag.minimum = def.minimum);
|
5131
4987
|
}), inst._zod.check = (payload)=>{
|
5132
4988
|
let input = payload.value;
|
@@ -5143,11 +4999,11 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5143
4999
|
});
|
5144
5000
|
};
|
5145
5001
|
}), $ZodCheckLengthEquals = $constructor("$ZodCheckLengthEquals", (inst, def)=>{
|
5146
|
-
|
5147
|
-
|
5002
|
+
var _a;
|
5003
|
+
$ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
|
5148
5004
|
let val = payload.value;
|
5149
5005
|
return null != val && void 0 !== val.length;
|
5150
|
-
}, inst._zod.onattach.push((inst)=>{
|
5006
|
+
}), inst._zod.onattach.push((inst)=>{
|
5151
5007
|
let bag = inst._zod.bag;
|
5152
5008
|
bag.minimum = def.length, bag.maximum = def.length, bag.length = def.length;
|
5153
5009
|
}), inst._zod.check = (payload)=>{
|
@@ -5163,18 +5019,19 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5163
5019
|
code: "too_small",
|
5164
5020
|
minimum: def.length
|
5165
5021
|
},
|
5022
|
+
inclusive: !0,
|
5023
|
+
exact: !0,
|
5166
5024
|
input: payload.value,
|
5167
5025
|
inst,
|
5168
5026
|
continue: !def.abort
|
5169
5027
|
});
|
5170
5028
|
};
|
5171
5029
|
}), $ZodCheckStringFormat = $constructor("$ZodCheckStringFormat", (inst, def)=>{
|
5172
|
-
var _a;
|
5030
|
+
var _a, _b;
|
5173
5031
|
$ZodCheck.init(inst, def), inst._zod.onattach.push((inst)=>{
|
5174
5032
|
let bag = inst._zod.bag;
|
5175
5033
|
bag.format = def.format, def.pattern && (bag.patterns ?? (bag.patterns = new Set()), bag.patterns.add(def.pattern));
|
5176
|
-
}), (_a = inst._zod).check ?? (_a.check = (payload)=>{
|
5177
|
-
if (!def.pattern) throw Error("Not implemented.");
|
5034
|
+
}), def.pattern ? (_a = inst._zod).check ?? (_a.check = (payload)=>{
|
5178
5035
|
def.pattern.lastIndex = 0, def.pattern.test(payload.value) || payload.issues.push({
|
5179
5036
|
origin: "string",
|
5180
5037
|
code: "invalid_format",
|
@@ -5186,7 +5043,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5186
5043
|
inst,
|
5187
5044
|
continue: !def.abort
|
5188
5045
|
});
|
5189
|
-
});
|
5046
|
+
}) : (_b = inst._zod).check ?? (_b.check = ()=>{});
|
5190
5047
|
}), $ZodCheckRegex = $constructor("$ZodCheckRegex", (inst, def)=>{
|
5191
5048
|
$ZodCheckStringFormat.init(inst, def), inst._zod.check = (payload)=>{
|
5192
5049
|
def.pattern.lastIndex = 0, def.pattern.test(payload.value) || payload.issues.push({
|
@@ -5287,34 +5144,84 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5287
5144
|
].join("\n"));
|
5288
5145
|
}
|
5289
5146
|
}
|
5290
|
-
let
|
5291
|
-
|
5292
|
-
|
5293
|
-
|
5294
|
-
|
5295
|
-
|
5296
|
-
|
5297
|
-
|
5298
|
-
|
5299
|
-
|
5300
|
-
|
5301
|
-
|
5302
|
-
|
5147
|
+
let errors_initializer = (inst, def)=>{
|
5148
|
+
inst.name = "$ZodError", Object.defineProperty(inst, "_zod", {
|
5149
|
+
value: inst._zod,
|
5150
|
+
enumerable: !1
|
5151
|
+
}), Object.defineProperty(inst, "issues", {
|
5152
|
+
value: def,
|
5153
|
+
enumerable: !1
|
5154
|
+
}), Object.defineProperty(inst, "message", {
|
5155
|
+
get: ()=>JSON.stringify(def, jsonStringifyReplacer, 2),
|
5156
|
+
enumerable: !0
|
5157
|
+
}), Object.defineProperty(inst, "toString", {
|
5158
|
+
value: ()=>inst.message,
|
5159
|
+
enumerable: !1
|
5303
5160
|
});
|
5304
|
-
|
5305
|
-
|
5306
|
-
|
5307
|
-
|
5308
|
-
|
5309
|
-
|
5310
|
-
|
5311
|
-
|
5312
|
-
|
5313
|
-
|
5314
|
-
|
5315
|
-
|
5316
|
-
|
5317
|
-
|
5161
|
+
}, $ZodError = $constructor("$ZodError", errors_initializer), $ZodRealError = $constructor("$ZodError", errors_initializer, {
|
5162
|
+
Parent: Error
|
5163
|
+
}), _safeParse = (_Err)=>(schema, value, _ctx)=>{
|
5164
|
+
let ctx = _ctx ? {
|
5165
|
+
..._ctx,
|
5166
|
+
async: !1
|
5167
|
+
} : {
|
5168
|
+
async: !1
|
5169
|
+
}, result = schema._zod.run({
|
5170
|
+
value,
|
5171
|
+
issues: []
|
5172
|
+
}, ctx);
|
5173
|
+
if (result instanceof Promise) throw new $ZodAsyncError();
|
5174
|
+
return result.issues.length ? {
|
5175
|
+
success: !1,
|
5176
|
+
error: new (_Err ?? $ZodError)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
|
5177
|
+
} : {
|
5178
|
+
success: !0,
|
5179
|
+
data: result.value
|
5180
|
+
};
|
5181
|
+
}, safeParse = _safeParse($ZodRealError), _safeParseAsync = (_Err)=>async (schema, value, _ctx)=>{
|
5182
|
+
let ctx = _ctx ? Object.assign(_ctx, {
|
5183
|
+
async: !0
|
5184
|
+
}) : {
|
5185
|
+
async: !0
|
5186
|
+
}, result = schema._zod.run({
|
5187
|
+
value,
|
5188
|
+
issues: []
|
5189
|
+
}, ctx);
|
5190
|
+
return result instanceof Promise && (result = await result), result.issues.length ? {
|
5191
|
+
success: !1,
|
5192
|
+
error: new _Err(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
|
5193
|
+
} : {
|
5194
|
+
success: !0,
|
5195
|
+
data: result.value
|
5196
|
+
};
|
5197
|
+
}, safeParseAsync = _safeParseAsync($ZodRealError), versions_version = {
|
5198
|
+
major: 4,
|
5199
|
+
minor: 0,
|
5200
|
+
patch: 0
|
5201
|
+
}, $ZodType = $constructor("$ZodType", (inst, def)=>{
|
5202
|
+
var _a;
|
5203
|
+
inst ?? (inst = {}), inst._zod.def = def, inst._zod.bag = inst._zod.bag || {}, inst._zod.version = versions_version;
|
5204
|
+
let checks = [
|
5205
|
+
...inst._zod.def.checks ?? []
|
5206
|
+
];
|
5207
|
+
for (let ch of (inst._zod.traits.has("$ZodCheck") && checks.unshift(inst), checks))for (let fn of ch._zod.onattach)fn(inst);
|
5208
|
+
if (0 === checks.length) (_a = inst._zod).deferred ?? (_a.deferred = []), inst._zod.deferred?.push(()=>{
|
5209
|
+
inst._zod.run = inst._zod.parse;
|
5210
|
+
});
|
5211
|
+
else {
|
5212
|
+
let runChecks = (payload, checks, ctx)=>{
|
5213
|
+
let asyncResult, isAborted = aborted(payload);
|
5214
|
+
for (let ch of checks){
|
5215
|
+
if (ch._zod.def.when) {
|
5216
|
+
if (!ch._zod.def.when(payload)) continue;
|
5217
|
+
} else if (isAborted) continue;
|
5218
|
+
let currLen = payload.issues.length, _ = ch._zod.check(payload);
|
5219
|
+
if (_ instanceof Promise && ctx?.async === !1) throw new $ZodAsyncError();
|
5220
|
+
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async ()=>{
|
5221
|
+
await _, payload.issues.length !== currLen && (isAborted || (isAborted = aborted(payload, currLen)));
|
5222
|
+
});
|
5223
|
+
else {
|
5224
|
+
if (payload.issues.length === currLen) continue;
|
5318
5225
|
isAborted || (isAborted = aborted(payload, currLen));
|
5319
5226
|
}
|
5320
5227
|
}
|
@@ -5352,7 +5259,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5352
5259
|
}), $ZodString = $constructor("$ZodString", (inst, def)=>{
|
5353
5260
|
$ZodType.init(inst, def), inst._zod.pattern = [
|
5354
5261
|
...inst?._zod.bag?.patterns ?? []
|
5355
|
-
].pop() ??
|
5262
|
+
].pop() ?? ((params)=>{
|
5263
|
+
let regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : "[\\s\\S]*";
|
5264
|
+
return RegExp(`^${regex}$`);
|
5265
|
+
})(inst._zod.bag), inst._zod.parse = (payload, _)=>{
|
5356
5266
|
if (def.coerce) try {
|
5357
5267
|
payload.value = String(payload.value);
|
5358
5268
|
} catch (_) {}
|
@@ -5388,7 +5298,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5388
5298
|
}), $ZodURL = $constructor("$ZodURL", (inst, def)=>{
|
5389
5299
|
$ZodStringFormat.init(inst, def), inst._zod.check = (payload)=>{
|
5390
5300
|
try {
|
5391
|
-
let url = new URL(
|
5301
|
+
let orig = payload.value, url = new URL(orig), href = url.href;
|
5392
5302
|
def.hostname && (def.hostname.lastIndex = 0, def.hostname.test(url.hostname) || payload.issues.push({
|
5393
5303
|
code: "invalid_format",
|
5394
5304
|
format: "url",
|
@@ -5405,7 +5315,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5405
5315
|
input: payload.value,
|
5406
5316
|
inst,
|
5407
5317
|
continue: !def.abort
|
5408
|
-
}));
|
5318
|
+
})), !orig.endsWith("/") && href.endsWith("/") ? payload.value = href.slice(0, -1) : payload.value = href;
|
5409
5319
|
return;
|
5410
5320
|
} catch (_) {
|
5411
5321
|
payload.issues.push({
|
@@ -5433,8 +5343,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5433
5343
|
def.pattern ?? (def.pattern = ksuid), $ZodStringFormat.init(inst, def);
|
5434
5344
|
}), $ZodISODateTime = $constructor("$ZodISODateTime", (inst, def)=>{
|
5435
5345
|
def.pattern ?? (def.pattern = function(args) {
|
5436
|
-
let
|
5437
|
-
|
5346
|
+
let time = timeSource({
|
5347
|
+
precision: args.precision
|
5348
|
+
}), opts = [
|
5349
|
+
"Z"
|
5350
|
+
];
|
5351
|
+
args.local && opts.push(""), args.offset && opts.push("([+-]\\d{2}:\\d{2})");
|
5352
|
+
let timeRegex = `${time}(?:${opts.join("|")})`;
|
5353
|
+
return RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
5438
5354
|
}(def)), $ZodStringFormat.init(inst, def);
|
5439
5355
|
}), $ZodISODate = $constructor("$ZodISODate", (inst, def)=>{
|
5440
5356
|
def.pattern ?? (def.pattern = regexes_date), $ZodStringFormat.init(inst, def);
|
@@ -5529,7 +5445,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5529
5445
|
try {
|
5530
5446
|
let tokensParts = token.split(".");
|
5531
5447
|
if (3 !== tokensParts.length) return !1;
|
5532
|
-
let [header] = tokensParts
|
5448
|
+
let [header] = tokensParts;
|
5449
|
+
if (!header) return !1;
|
5450
|
+
let parsedHeader = JSON.parse(atob(header));
|
5533
5451
|
if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT" || !parsedHeader.alg || algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return !1;
|
5534
5452
|
return !0;
|
5535
5453
|
} catch {
|
@@ -5579,8 +5497,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5579
5497
|
}), $ZodUndefined = $constructor("$ZodUndefined", (inst, def)=>{
|
5580
5498
|
$ZodType.init(inst, def), inst._zod.pattern = _undefined, inst._zod.values = new Set([
|
5581
5499
|
void 0
|
5582
|
-
]), inst._zod.parse = (payload, _ctx)=>{
|
5583
|
-
let
|
5500
|
+
]), inst._zod.optin = "optional", inst._zod.optout = "optional", inst._zod.parse = (payload, _ctx)=>{
|
5501
|
+
let input = payload.value;
|
5584
5502
|
return void 0 === input || payload.issues.push({
|
5585
5503
|
expected: "undefined",
|
5586
5504
|
code: "invalid_type",
|
@@ -5592,7 +5510,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5592
5510
|
$ZodType.init(inst, def), inst._zod.pattern = _null, inst._zod.values = new Set([
|
5593
5511
|
null
|
5594
5512
|
]), inst._zod.parse = (payload, _ctx)=>{
|
5595
|
-
let
|
5513
|
+
let input = payload.value;
|
5596
5514
|
return null === input || payload.issues.push({
|
5597
5515
|
expected: "null",
|
5598
5516
|
code: "invalid_type",
|
@@ -5666,23 +5584,34 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5666
5584
|
}
|
5667
5585
|
return propValues;
|
5668
5586
|
});
|
5669
|
-
let
|
5670
|
-
|
5671
|
-
|
5672
|
-
|
5673
|
-
|
5674
|
-
|
5675
|
-
|
5676
|
-
|
5677
|
-
|
5678
|
-
|
5679
|
-
let
|
5680
|
-
|
5681
|
-
|
5682
|
-
|
5683
|
-
|
5684
|
-
|
5685
|
-
|
5587
|
+
let jit = !globalConfig.jitless, fastEnabled = jit && util_allowsEval.value, catchall = def.catchall;
|
5588
|
+
inst._zod.parse = (payload, ctx)=>{
|
5589
|
+
value ?? (value = _normalized.value);
|
5590
|
+
let input = payload.value;
|
5591
|
+
if (!util_isObject(input)) return payload.issues.push({
|
5592
|
+
expected: "object",
|
5593
|
+
code: "invalid_type",
|
5594
|
+
input,
|
5595
|
+
inst
|
5596
|
+
}), payload;
|
5597
|
+
let proms = [];
|
5598
|
+
if (jit && fastEnabled && ctx?.async === !1 && !0 !== ctx.jitless) fastpass || (fastpass = ((shape)=>{
|
5599
|
+
let doc = new Doc([
|
5600
|
+
"shape",
|
5601
|
+
"payload",
|
5602
|
+
"ctx"
|
5603
|
+
]), normalized = _normalized.value, parseStr = (key)=>{
|
5604
|
+
let k = esc(key);
|
5605
|
+
return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
5606
|
+
};
|
5607
|
+
doc.write("const input = payload.value;");
|
5608
|
+
let ids = Object.create(null), counter = 0;
|
5609
|
+
for (let key of normalized.keys)ids[key] = `key_${counter++}`;
|
5610
|
+
for (let key of (doc.write("const newResult = {}"), normalized.keys))if (normalized.optionalKeys.has(key)) {
|
5611
|
+
let id = ids[key];
|
5612
|
+
doc.write(`const ${id} = ${parseStr(key)};`);
|
5613
|
+
let k = esc(key);
|
5614
|
+
doc.write(`
|
5686
5615
|
if (${id}.issues.length) {
|
5687
5616
|
if (input[${k}] === undefined) {
|
5688
5617
|
if (${k} in input) {
|
@@ -5702,29 +5631,18 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5702
5631
|
newResult[${k}] = ${id}.value;
|
5703
5632
|
}
|
5704
5633
|
`);
|
5705
|
-
|
5706
|
-
|
5707
|
-
|
5634
|
+
} else {
|
5635
|
+
let id = ids[key];
|
5636
|
+
doc.write(`const ${id} = ${parseStr(key)};`), doc.write(`
|
5708
5637
|
if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
5709
5638
|
...iss,
|
5710
5639
|
path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
|
5711
5640
|
})));`), doc.write(`newResult[${esc(key)}] = ${id}.value`);
|
5712
|
-
|
5713
|
-
|
5714
|
-
|
5715
|
-
|
5716
|
-
|
5717
|
-
inst._zod.parse = (payload, ctx)=>{
|
5718
|
-
value ?? (value = _normalized.value);
|
5719
|
-
let input = payload.value;
|
5720
|
-
if (!util_isObject(input)) return payload.issues.push({
|
5721
|
-
expected: "object",
|
5722
|
-
code: "invalid_type",
|
5723
|
-
input,
|
5724
|
-
inst
|
5725
|
-
}), payload;
|
5726
|
-
let proms = [];
|
5727
|
-
if (jit && fastEnabled && ctx?.async === !1 && !0 !== ctx.jitless) fastpass || (fastpass = generateFastpass(def.shape)), payload = fastpass(payload, ctx);
|
5641
|
+
}
|
5642
|
+
doc.write("payload.value = newResult;"), doc.write("return payload;");
|
5643
|
+
let fn = doc.compile();
|
5644
|
+
return (payload, ctx)=>fn(shape, payload, ctx);
|
5645
|
+
})(def.shape)), payload = fastpass(payload, ctx);
|
5728
5646
|
else {
|
5729
5647
|
payload.value = {};
|
5730
5648
|
let shape = value.shape;
|
@@ -5768,7 +5686,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5768
5686
|
}), final;
|
5769
5687
|
}
|
5770
5688
|
let $ZodUnion = $constructor("$ZodUnion", (inst, def)=>{
|
5771
|
-
$ZodType.init(inst, def), defineLazy(inst._zod, "values", ()=>{
|
5689
|
+
$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", ()=>{
|
5772
5690
|
if (def.options.every((o)=>o._zod.values)) return new Set(def.options.flatMap((option)=>Array.from(option._zod.values)));
|
5773
5691
|
}), defineLazy(inst._zod, "pattern", ()=>{
|
5774
5692
|
if (def.options.every((o)=>o._zod.pattern)) {
|
@@ -5792,7 +5710,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5792
5710
|
};
|
5793
5711
|
}), $ZodIntersection = $constructor("$ZodIntersection", (inst, def)=>{
|
5794
5712
|
$ZodType.init(inst, def), inst._zod.parse = (payload, ctx)=>{
|
5795
|
-
let
|
5713
|
+
let input = payload.value, left = def.left._zod.run({
|
5796
5714
|
value: input,
|
5797
5715
|
issues: []
|
5798
5716
|
}, ctx), right = def.right._zod.run({
|
@@ -5863,7 +5781,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
5863
5781
|
if (!merged.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
|
5864
5782
|
return result.value = merged.data, result;
|
5865
5783
|
}
|
5866
|
-
let
|
5784
|
+
let $ZodTuple = $constructor("$ZodTuple", (inst, def)=>{
|
5867
5785
|
$ZodType.init(inst, def);
|
5868
5786
|
let items = def.items, optStart = items.length - [
|
5869
5787
|
...items
|
@@ -6013,7 +5931,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6013
5931
|
]) : void 0), defineLazy(inst._zod, "pattern", ()=>{
|
6014
5932
|
let pattern = def.innerType._zod.pattern;
|
6015
5933
|
return pattern ? RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
6016
|
-
}), inst._zod.parse = (payload, ctx)=>void 0 === payload.value ? payload : def.innerType._zod.run(payload, ctx);
|
5934
|
+
}), 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);
|
6017
5935
|
}), $ZodNullable = $constructor("$ZodNullable", (inst, def)=>{
|
6018
5936
|
$ZodType.init(inst, def), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), defineLazy(inst._zod, "pattern", ()=>{
|
6019
5937
|
let pattern = def.innerType._zod.pattern;
|
@@ -6054,7 +5972,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6054
5972
|
}), payload;
|
6055
5973
|
}
|
6056
5974
|
let $ZodCatch = $constructor("$ZodCatch", (inst, def)=>{
|
6057
|
-
$ZodType.init(inst, def),
|
5975
|
+
$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)=>{
|
6058
5976
|
let result = def.innerType._zod.run(payload, ctx);
|
6059
5977
|
return result instanceof Promise ? result.then((result)=>(payload.value = result.value, result.issues.length && (payload.value = def.catchValue({
|
6060
5978
|
...payload,
|
@@ -6083,7 +6001,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6083
6001
|
}, ctx);
|
6084
6002
|
}
|
6085
6003
|
let $ZodReadonly = $constructor("$ZodReadonly", (inst, def)=>{
|
6086
|
-
$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)=>{
|
6004
|
+
$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)=>{
|
6087
6005
|
let result = def.innerType._zod.run(payload, ctx);
|
6088
6006
|
return result instanceof Promise ? result.then(handleReadonlyResult) : handleReadonlyResult(result);
|
6089
6007
|
};
|
@@ -6114,108 +6032,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6114
6032
|
inst._zod.def.params && (_iss.params = inst._zod.def.params), payload.issues.push(util_issue(_iss));
|
6115
6033
|
}
|
6116
6034
|
}
|
6117
|
-
let en_parsedType = (data)=>{
|
6118
|
-
let t = typeof data;
|
6119
|
-
switch(t){
|
6120
|
-
case "number":
|
6121
|
-
return Number.isNaN(data) ? "NaN" : "number";
|
6122
|
-
case "object":
|
6123
|
-
if (Array.isArray(data)) return "array";
|
6124
|
-
if (null === data) return "null";
|
6125
|
-
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
|
6126
|
-
}
|
6127
|
-
return t;
|
6128
|
-
}, en_error = ()=>{
|
6129
|
-
let Sizable = {
|
6130
|
-
string: {
|
6131
|
-
unit: "characters",
|
6132
|
-
verb: "to have"
|
6133
|
-
},
|
6134
|
-
file: {
|
6135
|
-
unit: "bytes",
|
6136
|
-
verb: "to have"
|
6137
|
-
},
|
6138
|
-
array: {
|
6139
|
-
unit: "items",
|
6140
|
-
verb: "to have"
|
6141
|
-
},
|
6142
|
-
set: {
|
6143
|
-
unit: "items",
|
6144
|
-
verb: "to have"
|
6145
|
-
}
|
6146
|
-
}, Nouns = {
|
6147
|
-
regex: "input",
|
6148
|
-
email: "email address",
|
6149
|
-
url: "URL",
|
6150
|
-
emoji: "emoji",
|
6151
|
-
uuid: "UUID",
|
6152
|
-
uuidv4: "UUIDv4",
|
6153
|
-
uuidv6: "UUIDv6",
|
6154
|
-
nanoid: "nanoid",
|
6155
|
-
guid: "GUID",
|
6156
|
-
cuid: "cuid",
|
6157
|
-
cuid2: "cuid2",
|
6158
|
-
ulid: "ULID",
|
6159
|
-
xid: "XID",
|
6160
|
-
ksuid: "KSUID",
|
6161
|
-
datetime: "ISO datetime",
|
6162
|
-
date: "ISO date",
|
6163
|
-
time: "ISO time",
|
6164
|
-
duration: "ISO duration",
|
6165
|
-
ipv4: "IPv4 address",
|
6166
|
-
ipv6: "IPv6 address",
|
6167
|
-
cidrv4: "IPv4 range",
|
6168
|
-
cidrv6: "IPv6 range",
|
6169
|
-
base64: "base64-encoded string",
|
6170
|
-
base64url: "base64url-encoded string",
|
6171
|
-
json_string: "JSON string",
|
6172
|
-
e164: "E.164 number",
|
6173
|
-
jwt: "JWT",
|
6174
|
-
template_literal: "input"
|
6175
|
-
};
|
6176
|
-
return (issue)=>{
|
6177
|
-
switch(issue.code){
|
6178
|
-
case "invalid_type":
|
6179
|
-
return `Invalid input: expected ${issue.expected}, received ${en_parsedType(issue.input)}`;
|
6180
|
-
case "invalid_value":
|
6181
|
-
if (1 === issue.values.length) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
|
6182
|
-
return `Invalid option: expected one of ${joinValues(issue.values, "|")}`;
|
6183
|
-
case "too_big":
|
6184
|
-
{
|
6185
|
-
let adj = issue.inclusive ? "<=" : "<", sizing = Sizable[issue.origin] ?? null;
|
6186
|
-
if (sizing) return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
|
6187
|
-
return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
|
6188
|
-
}
|
6189
|
-
case "too_small":
|
6190
|
-
{
|
6191
|
-
let adj = issue.inclusive ? ">=" : ">", sizing = Sizable[issue.origin] ?? null;
|
6192
|
-
if (sizing) return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
6193
|
-
return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
|
6194
|
-
}
|
6195
|
-
case "invalid_format":
|
6196
|
-
if ("starts_with" === issue.format) return `Invalid string: must start with "${issue.prefix}"`;
|
6197
|
-
if ("ends_with" === issue.format) return `Invalid string: must end with "${issue.suffix}"`;
|
6198
|
-
if ("includes" === issue.format) return `Invalid string: must include "${issue.includes}"`;
|
6199
|
-
if ("regex" === issue.format) return `Invalid string: must match pattern ${issue.pattern}`;
|
6200
|
-
return `Invalid ${Nouns[issue.format] ?? issue.format}`;
|
6201
|
-
case "not_multiple_of":
|
6202
|
-
return `Invalid number: must be a multiple of ${issue.divisor}`;
|
6203
|
-
case "unrecognized_keys":
|
6204
|
-
return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
|
6205
|
-
case "invalid_key":
|
6206
|
-
return `Invalid key in ${issue.origin}`;
|
6207
|
-
case "invalid_union":
|
6208
|
-
default:
|
6209
|
-
return "Invalid input";
|
6210
|
-
case "invalid_element":
|
6211
|
-
return `Invalid value in ${issue.origin}`;
|
6212
|
-
}
|
6213
|
-
};
|
6214
|
-
};
|
6215
6035
|
Symbol("ZodOutput"), Symbol("ZodInput");
|
6216
|
-
class
|
6036
|
+
class $ZodRegistry {
|
6217
6037
|
constructor(){
|
6218
|
-
this._map = new
|
6038
|
+
this._map = new Map(), this._idmap = new Map();
|
6219
6039
|
}
|
6220
6040
|
add(schema, ..._meta) {
|
6221
6041
|
let meta = _meta[0];
|
@@ -6225,8 +6045,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6225
6045
|
}
|
6226
6046
|
return this;
|
6227
6047
|
}
|
6048
|
+
clear() {
|
6049
|
+
return this._map = new Map(), this._idmap = new Map(), this;
|
6050
|
+
}
|
6228
6051
|
remove(schema) {
|
6229
|
-
|
6052
|
+
let meta = this._map.get(schema);
|
6053
|
+
return meta && "object" == typeof meta && "id" in meta && this._idmap.delete(meta.id), this._map.delete(schema), this;
|
6230
6054
|
}
|
6231
6055
|
get(schema) {
|
6232
6056
|
let p = schema._zod.parent;
|
@@ -6245,7 +6069,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6245
6069
|
return this._map.has(schema);
|
6246
6070
|
}
|
6247
6071
|
}
|
6248
|
-
let
|
6072
|
+
let globalRegistry = new $ZodRegistry();
|
6249
6073
|
function _guid(Class, params) {
|
6250
6074
|
return new Class({
|
6251
6075
|
type: "string",
|
@@ -6387,7 +6211,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6387
6211
|
$constructor("ZodError", classic_errors_initializer);
|
6388
6212
|
let ZodRealError = $constructor("ZodError", classic_errors_initializer, {
|
6389
6213
|
Parent: Error
|
6390
|
-
}),
|
6214
|
+
}), parse_parse = (_Err = ZodRealError, (schema, value, _ctx, _params)=>{
|
6391
6215
|
let ctx = _ctx ? Object.assign(_ctx, {
|
6392
6216
|
async: !1
|
6393
6217
|
}) : {
|
@@ -6399,10 +6223,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6399
6223
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
6400
6224
|
if (result.issues.length) {
|
6401
6225
|
let e = new (_params?.Err ?? _Err)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())));
|
6402
|
-
throw
|
6226
|
+
throw captureStackTrace(e, _params?.callee), e;
|
6403
6227
|
}
|
6404
6228
|
return result.value;
|
6405
|
-
}),
|
6229
|
+
}), parse_parseAsync = (_Err1 = ZodRealError, async (schema, value, _ctx, params)=>{
|
6406
6230
|
let ctx = _ctx ? Object.assign(_ctx, {
|
6407
6231
|
async: !0
|
6408
6232
|
}) : {
|
@@ -6413,7 +6237,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6413
6237
|
}, ctx);
|
6414
6238
|
if (result instanceof Promise && (result = await result), result.issues.length) {
|
6415
6239
|
let e = new (params?.Err ?? _Err1)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())));
|
6416
|
-
throw
|
6240
|
+
throw captureStackTrace(e, params?.callee), e;
|
6417
6241
|
}
|
6418
6242
|
return result.value;
|
6419
6243
|
}), parse_safeParse = _safeParse(ZodRealError), parse_safeParseAsync = _safeParseAsync(ZodRealError), ZodType = $constructor("ZodType", (inst, def)=>($ZodType.init(inst, def), inst.def = def, Object.defineProperty(inst, "_def", {
|
@@ -6432,9 +6256,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6432
6256
|
}
|
6433
6257
|
} : ch)
|
6434
6258
|
]
|
6435
|
-
}), inst.clone = (def, params)=>clone(inst, def, params), inst.brand = ()=>inst, inst.register = (reg, meta)=>(reg.add(inst, meta), inst), inst.parse = (data, params)=>
|
6259
|
+
}), 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, {
|
6436
6260
|
callee: inst.parse
|
6437
|
-
}), inst.safeParse = (data, params)=>parse_safeParse(inst, data, params), inst.parseAsync = async (data, params)=>
|
6261
|
+
}), inst.safeParse = (data, params)=>parse_safeParse(inst, data, params), inst.parseAsync = async (data, params)=>parse_parseAsync(inst, data, params, {
|
6438
6262
|
callee: inst.parseAsync
|
6439
6263
|
}), inst.safeParseAsync = async (data, params)=>parse_safeParseAsync(inst, data, params), inst.spa = inst.safeParseAsync, inst.refine = (check, params)=>inst.check(function(fn, _params = {}) {
|
6440
6264
|
return new ZodCustom({
|
@@ -6443,41 +6267,31 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6443
6267
|
fn: fn,
|
6444
6268
|
...normalizeParams(_params)
|
6445
6269
|
});
|
6446
|
-
}(check, params)), inst.superRefine = (refinement)=>inst.check(function(fn
|
6447
|
-
let ch = function(fn
|
6270
|
+
}(check, params)), inst.superRefine = (refinement)=>inst.check(function(fn) {
|
6271
|
+
let ch = function(fn) {
|
6448
6272
|
let ch = new $ZodCheck({
|
6449
|
-
check: "custom"
|
6450
|
-
...normalizeParams(params)
|
6273
|
+
check: "custom"
|
6451
6274
|
});
|
6452
6275
|
return ch._zod.check = fn, ch;
|
6453
6276
|
}((payload)=>(payload.addIssue = (issue)=>{
|
6454
6277
|
"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)));
|
6455
|
-
}, fn(payload.value, payload))
|
6278
|
+
}, fn(payload.value, payload)));
|
6456
6279
|
return ch;
|
6457
|
-
}(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)=>{
|
6458
|
-
var innerType, params1;
|
6459
|
-
return new ZodNonOptional({
|
6280
|
+
}(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({
|
6460
6281
|
type: "nonoptional",
|
6461
|
-
innerType:
|
6462
|
-
...normalizeParams(
|
6463
|
-
})
|
6464
|
-
}, inst.array = ()=>schemas_array(inst), inst.or = (arg)=>union([
|
6282
|
+
innerType: inst,
|
6283
|
+
...normalizeParams(params)
|
6284
|
+
}), inst.array = ()=>schemas_array(inst), inst.or = (arg)=>union([
|
6465
6285
|
inst,
|
6466
6286
|
arg
|
6467
|
-
]), inst.and = (arg)=>{
|
6468
|
-
var left, right;
|
6469
|
-
return new ZodIntersection({
|
6287
|
+
]), inst.and = (arg)=>new ZodIntersection({
|
6470
6288
|
type: "intersection",
|
6471
|
-
left:
|
6472
|
-
right:
|
6473
|
-
})
|
6474
|
-
}, inst.transform = (tx)=>{
|
6475
|
-
var fn;
|
6476
|
-
return pipe(inst, new ZodTransform({
|
6289
|
+
left: inst,
|
6290
|
+
right: arg
|
6291
|
+
}), inst.transform = (tx)=>pipe(inst, new ZodTransform({
|
6477
6292
|
type: "transform",
|
6478
|
-
transform:
|
6479
|
-
}))
|
6480
|
-
}, inst.default = (def)=>{
|
6293
|
+
transform: tx
|
6294
|
+
})), inst.default = (def)=>{
|
6481
6295
|
var innerType, defaultValue;
|
6482
6296
|
return innerType = inst, defaultValue = def, new ZodDefault({
|
6483
6297
|
type: "default",
|
@@ -6496,30 +6310,27 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6496
6310
|
}
|
6497
6311
|
});
|
6498
6312
|
}, inst.catch = (params)=>{
|
6499
|
-
var
|
6313
|
+
var catchValue;
|
6500
6314
|
return new ZodCatch({
|
6501
6315
|
type: "catch",
|
6502
|
-
innerType:
|
6316
|
+
innerType: inst,
|
6503
6317
|
catchValue: "function" == typeof (catchValue = params) ? catchValue : ()=>catchValue
|
6504
6318
|
});
|
6505
|
-
}, inst.pipe = (target)=>pipe(inst, target), inst.readonly = ()=>{
|
6506
|
-
var innerType;
|
6507
|
-
return new ZodReadonly({
|
6319
|
+
}, inst.pipe = (target)=>pipe(inst, target), inst.readonly = ()=>new ZodReadonly({
|
6508
6320
|
type: "readonly",
|
6509
|
-
innerType:
|
6510
|
-
})
|
6511
|
-
}, inst.describe = (description)=>{
|
6321
|
+
innerType: inst
|
6322
|
+
}), inst.describe = (description)=>{
|
6512
6323
|
let cl = inst.clone();
|
6513
|
-
return
|
6324
|
+
return globalRegistry.add(cl, {
|
6514
6325
|
description
|
6515
6326
|
}), cl;
|
6516
6327
|
}, Object.defineProperty(inst, "description", {
|
6517
|
-
get: ()=>
|
6328
|
+
get: ()=>globalRegistry.get(inst)?.description,
|
6518
6329
|
configurable: !0
|
6519
6330
|
}), inst.meta = (...args)=>{
|
6520
|
-
if (0 === args.length) return
|
6331
|
+
if (0 === args.length) return globalRegistry.get(inst);
|
6521
6332
|
let cl = inst.clone();
|
6522
|
-
return
|
6333
|
+
return globalRegistry.add(cl, args[0]), cl;
|
6523
6334
|
}, inst.isOptional = ()=>inst.safeParse(void 0).success, inst.isNullable = ()=>inst.safeParse(null).success, inst)), _ZodString = $constructor("_ZodString", (inst, def)=>{
|
6524
6335
|
$ZodString.init(inst, def), ZodType.init(inst, def);
|
6525
6336
|
let bag = inst._zod.bag;
|
@@ -6692,43 +6503,31 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6692
6503
|
check: "string_format",
|
6693
6504
|
abort: !1,
|
6694
6505
|
...normalizeParams(params)
|
6695
|
-
})), inst.datetime = (params)=>{
|
6696
|
-
var params1;
|
6697
|
-
return inst.check(new ZodISODateTime({
|
6506
|
+
})), inst.datetime = (params)=>inst.check(new ZodISODateTime({
|
6698
6507
|
type: "string",
|
6699
6508
|
format: "datetime",
|
6700
6509
|
check: "string_format",
|
6701
6510
|
offset: !1,
|
6702
6511
|
local: !1,
|
6703
6512
|
precision: null,
|
6704
|
-
...normalizeParams(
|
6705
|
-
}))
|
6706
|
-
}, inst.date = (params)=>{
|
6707
|
-
var params1;
|
6708
|
-
return inst.check(new ZodISODate({
|
6513
|
+
...normalizeParams(params)
|
6514
|
+
})), inst.date = (params)=>inst.check(new ZodISODate({
|
6709
6515
|
type: "string",
|
6710
6516
|
format: "date",
|
6711
6517
|
check: "string_format",
|
6712
|
-
...normalizeParams(
|
6713
|
-
}))
|
6714
|
-
}, inst.time = (params)=>{
|
6715
|
-
var params1;
|
6716
|
-
return inst.check(new ZodISOTime({
|
6518
|
+
...normalizeParams(params)
|
6519
|
+
})), inst.time = (params)=>inst.check(new ZodISOTime({
|
6717
6520
|
type: "string",
|
6718
6521
|
format: "time",
|
6719
6522
|
check: "string_format",
|
6720
6523
|
precision: null,
|
6721
|
-
...normalizeParams(
|
6722
|
-
}))
|
6723
|
-
}, inst.duration = (params)=>{
|
6724
|
-
var params1;
|
6725
|
-
return inst.check(new ZodISODuration({
|
6524
|
+
...normalizeParams(params)
|
6525
|
+
})), inst.duration = (params)=>inst.check(new ZodISODuration({
|
6726
6526
|
type: "string",
|
6727
6527
|
format: "duration",
|
6728
6528
|
check: "string_format",
|
6729
|
-
...normalizeParams(
|
6529
|
+
...normalizeParams(params)
|
6730
6530
|
}));
|
6731
|
-
};
|
6732
6531
|
});
|
6733
6532
|
function schemas_string(params) {
|
6734
6533
|
return new ZodString({
|
@@ -6779,7 +6578,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6779
6578
|
}), ZodNumber = $constructor("ZodNumber", (inst, def)=>{
|
6780
6579
|
$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;
|
6781
6580
|
let bag = inst._zod.bag;
|
6782
|
-
inst.minValue = Math.max(bag.minimum ??
|
6581
|
+
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;
|
6783
6582
|
});
|
6784
6583
|
function schemas_number(params) {
|
6785
6584
|
return new ZodNumber({
|
@@ -6849,15 +6648,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6849
6648
|
$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;
|
6850
6649
|
});
|
6851
6650
|
function schemas_array(element, params) {
|
6852
|
-
|
6853
|
-
return new (Class = ZodArray)({
|
6651
|
+
return new ZodArray({
|
6854
6652
|
type: "array",
|
6855
6653
|
element: element,
|
6856
6654
|
...normalizeParams(params)
|
6857
6655
|
});
|
6858
6656
|
}
|
6859
6657
|
let ZodObject = $constructor("ZodObject", (inst, def)=>{
|
6860
|
-
$ZodObject.init(inst, def), ZodType.init(inst, def), defineLazy(inst, "shape", ()=>
|
6658
|
+
$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({
|
6861
6659
|
...inst._zod.def,
|
6862
6660
|
catchall: catchall
|
6863
6661
|
}), inst.passthrough = ()=>inst.clone({
|
@@ -6873,6 +6671,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6873
6671
|
...inst._zod.def,
|
6874
6672
|
catchall: void 0
|
6875
6673
|
}), inst.extend = (incoming)=>(function(schema, shape) {
|
6674
|
+
if (!isPlainObject(shape)) throw Error("Invalid input to extend: expected a plain object");
|
6876
6675
|
let def = {
|
6877
6676
|
...schema._zod.def,
|
6878
6677
|
get shape () {
|
@@ -7001,7 +6800,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7001
6800
|
let ZodIntersection = $constructor("ZodIntersection", (inst, def)=>{
|
7002
6801
|
$ZodIntersection.init(inst, def), ZodType.init(inst, def);
|
7003
6802
|
}), ZodTuple = $constructor("ZodTuple", (inst, def)=>{
|
7004
|
-
|
6803
|
+
$ZodTuple.init(inst, def), ZodType.init(inst, def), inst.rest = (rest)=>inst.clone({
|
7005
6804
|
...inst._zod.def,
|
7006
6805
|
rest: rest
|
7007
6806
|
});
|
@@ -7160,14 +6959,38 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7160
6959
|
});
|
7161
6960
|
return inst._zod.bag.Class = cls, inst;
|
7162
6961
|
}
|
7163
|
-
|
7164
|
-
status: "aborted"
|
7165
|
-
}), core_config({
|
7166
|
-
localeError: en_error()
|
7167
|
-
});
|
7168
|
-
let numberOrInfinity = schemas_number().or(literal(Number.POSITIVE_INFINITY)), anyFunction = custom((data)=>"function" == typeof data, {
|
6962
|
+
let numberOrInfinity = schemas_number().or(literal(1 / 0)), anyFunction = custom((data)=>"function" == typeof data, {
|
7169
6963
|
error: (input)=>({
|
7170
|
-
message: `Expected function, received ${
|
6964
|
+
message: `Expected function, received ${((data)=>{
|
6965
|
+
let t = typeof data;
|
6966
|
+
switch(t){
|
6967
|
+
case "undefined":
|
6968
|
+
return "undefined";
|
6969
|
+
case "string":
|
6970
|
+
return "string";
|
6971
|
+
case "number":
|
6972
|
+
return Number.isNaN(data) ? "nan" : "number";
|
6973
|
+
case "boolean":
|
6974
|
+
return "boolean";
|
6975
|
+
case "function":
|
6976
|
+
return "function";
|
6977
|
+
case "bigint":
|
6978
|
+
return "bigint";
|
6979
|
+
case "symbol":
|
6980
|
+
return "symbol";
|
6981
|
+
case "object":
|
6982
|
+
if (Array.isArray(data)) return "array";
|
6983
|
+
if (null === data) return "null";
|
6984
|
+
if (data.then && "function" == typeof data.then && data.catch && "function" == typeof data.catch) return "promise";
|
6985
|
+
if ("undefined" != typeof Map && data instanceof Map) return "map";
|
6986
|
+
if ("undefined" != typeof Set && data instanceof Set) return "set";
|
6987
|
+
if ("undefined" != typeof Date && data instanceof Date) return "date";
|
6988
|
+
if ("undefined" != typeof File && data instanceof File) return "file";
|
6989
|
+
return "object";
|
6990
|
+
default:
|
6991
|
+
throw Error(`Unknown data type: ${t}`);
|
6992
|
+
}
|
6993
|
+
})(input)}`
|
7171
6994
|
})
|
7172
6995
|
}), getIgnorePluginOptionsSchema = memoize(()=>union([
|
7173
6996
|
schemas_object({
|
@@ -7497,29 +7320,29 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7497
7320
|
message: `value must be in ${issue.format} format`
|
7498
7321
|
};
|
7499
7322
|
default:
|
7500
|
-
var issue1, issue2, issue3
|
7501
|
-
if ("starts_with" ===
|
7323
|
+
var issue1, issue2, issue3;
|
7324
|
+
if ("starts_with" === issue.format) {
|
7502
7325
|
return {
|
7503
|
-
type: (
|
7504
|
-
path:
|
7505
|
-
message: `value must start with "${
|
7326
|
+
type: (issue1 = issue).code,
|
7327
|
+
path: issue1.path,
|
7328
|
+
message: `value must start with "${issue1.prefix}"`
|
7506
7329
|
};
|
7507
7330
|
}
|
7508
|
-
if ("ends_with" ===
|
7331
|
+
if ("ends_with" === issue.format) {
|
7509
7332
|
return {
|
7510
|
-
type: (
|
7511
|
-
path:
|
7512
|
-
message: `value must end with "${
|
7333
|
+
type: (issue2 = issue).code,
|
7334
|
+
path: issue2.path,
|
7335
|
+
message: `value must end with "${issue2.suffix}"`
|
7513
7336
|
};
|
7514
7337
|
}
|
7515
|
-
if ("includes" ===
|
7338
|
+
if ("includes" === issue.format) {
|
7516
7339
|
return {
|
7517
|
-
type: (
|
7518
|
-
path:
|
7519
|
-
message: `value must include "${
|
7340
|
+
type: (issue3 = issue).code,
|
7341
|
+
path: issue3.path,
|
7342
|
+
message: `value must include "${issue3.includes}"`
|
7520
7343
|
};
|
7521
7344
|
}
|
7522
|
-
if ("regex" ===
|
7345
|
+
if ("regex" === issue.format) return function(issue, options = {
|
7523
7346
|
displayInvalidFormatDetails: !1
|
7524
7347
|
}) {
|
7525
7348
|
let message = "value must match pattern";
|
@@ -7529,7 +7352,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7529
7352
|
message
|
7530
7353
|
};
|
7531
7354
|
}(issue, options);
|
7532
|
-
if ("jwt" ===
|
7355
|
+
if ("jwt" === issue.format) return function(issue, options = {
|
7533
7356
|
displayInvalidFormatDetails: !1
|
7534
7357
|
}) {
|
7535
7358
|
return {
|
@@ -7663,10 +7486,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7663
7486
|
}
|
7664
7487
|
return path.reduce((acc, propertyKey)=>{
|
7665
7488
|
if ("number" == typeof propertyKey) return acc + "[" + propertyKey.toString() + "]";
|
7666
|
-
if ("symbol" == typeof propertyKey && (propertyKey = stringifySymbol(propertyKey)), propertyKey.includes('"'))
|
7667
|
-
var str;
|
7668
|
-
return acc + '["' + (str = propertyKey).replace(/"/g, '\\"') + '"]';
|
7669
|
-
}
|
7489
|
+
if ("symbol" == typeof propertyKey && (propertyKey = stringifySymbol(propertyKey)), propertyKey.includes('"')) return acc + '["' + propertyKey.replace(/"/g, '\\"') + '"]';
|
7670
7490
|
if (!identifierRegex.test(propertyKey)) return acc + '["' + propertyKey + '"]';
|
7671
7491
|
let separator = 0 === acc.length ? "" : ".";
|
7672
7492
|
return acc + separator + propertyKey;
|
@@ -7689,7 +7509,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7689
7509
|
}
|
7690
7510
|
function fromZodErrorWithoutRuntimeCheck(zodError, options = {}) {
|
7691
7511
|
var options1;
|
7692
|
-
let
|
7512
|
+
let zodIssues = zodError.issues;
|
7693
7513
|
return new ValidationError(isNonEmptyArray(zodIssues) ? ("messageBuilder" in (options1 = options) ? options1.messageBuilder : function(partialOptions = {}) {
|
7694
7514
|
let options = {
|
7695
7515
|
...defaultMessageBuilderOptions,
|
@@ -7706,11 +7526,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7706
7526
|
cause: zodError
|
7707
7527
|
});
|
7708
7528
|
}
|
7709
|
-
var toValidationError = (options = {})=>(err)=>isZodErrorLike(err) ? fromZodErrorWithoutRuntimeCheck(err, options) : err instanceof Error ? new ValidationError(err.message, {
|
7710
|
-
cause: err
|
7711
|
-
}) : new ValidationError("Unknown error");
|
7712
7529
|
function fromError(err, options = {}) {
|
7713
|
-
return
|
7530
|
+
return ((options = {})=>(err)=>isZodErrorLike(err) ? fromZodErrorWithoutRuntimeCheck(err, options) : err instanceof Error ? new ValidationError(err.message, {
|
7531
|
+
cause: err
|
7532
|
+
}) : new ValidationError("Unknown error"))(options)(err);
|
7714
7533
|
}
|
7715
7534
|
class validate_ValidationError extends Error {
|
7716
7535
|
constructor(message){
|
@@ -7757,16 +7576,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7757
7576
|
return !1;
|
7758
7577
|
}
|
7759
7578
|
}
|
7760
|
-
let compilationOptionsMap = new WeakMap(),
|
7761
|
-
if (!(compilation instanceof Compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
|
7762
|
-
return compilationOptionsMap.get(compilation)?.[uid];
|
7763
|
-
}, setPluginOptions = (compilation, uid, options)=>{
|
7764
|
-
let optionsMap = compilationOptionsMap.get(compilation) || {};
|
7765
|
-
optionsMap[uid] = options, compilationOptionsMap.set(compilation, optionsMap);
|
7766
|
-
}, cleanPluginOptions = (compilation, uid)=>{
|
7767
|
-
let optionsMap = compilationOptionsMap.get(compilation) || {};
|
7768
|
-
delete optionsMap[uid], 0 === Object.keys(optionsMap).length ? compilationOptionsMap.delete(compilation) : compilationOptionsMap.set(compilation, optionsMap);
|
7769
|
-
}, HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
|
7579
|
+
let compilationOptionsMap = new WeakMap(), HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
|
7770
7580
|
let templateParameters, templateFn, filenames;
|
7771
7581
|
validate(c, getHtmlPluginOptionsSchema);
|
7772
7582
|
let uid = HTML_PLUGIN_UID++, meta = {};
|
@@ -7806,9 +7616,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7806
7616
|
return json;
|
7807
7617
|
}
|
7808
7618
|
this.hooks.compilation.tap("HtmlRspackPlugin", (compilationInstance)=>{
|
7809
|
-
|
7619
|
+
var compilation1 = compilation = compilationInstance, uid1 = uid, options = c;
|
7620
|
+
let optionsMap = compilationOptionsMap.get(compilation1) || {};
|
7621
|
+
optionsMap[uid1] = options, compilationOptionsMap.set(compilation1, optionsMap);
|
7810
7622
|
}), this.hooks.done.tap("HtmlRspackPlugin", (stats)=>{
|
7811
|
-
|
7623
|
+
compilation = stats.compilation, hooks_compilationHooksMap.delete(compilation);
|
7624
|
+
var compilation, compilation1 = stats.compilation, uid1 = uid;
|
7625
|
+
let optionsMap = compilationOptionsMap.get(compilation1) || {};
|
7626
|
+
delete optionsMap[uid1], 0 === Object.keys(optionsMap).length ? compilationOptionsMap.delete(compilation1) : compilationOptionsMap.set(compilation1, optionsMap);
|
7812
7627
|
});
|
7813
7628
|
let templateContent = c.templateContent;
|
7814
7629
|
if ("function" == typeof templateContent) templateFn = async (data)=>{
|
@@ -7947,10 +7762,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7947
7762
|
};
|
7948
7763
|
class HttpUriPlugin extends RspackBuiltinPlugin {
|
7949
7764
|
options;
|
7950
|
-
name;
|
7951
|
-
affectedHooks;
|
7765
|
+
name = binding_.BuiltinPluginName.HttpUriPlugin;
|
7766
|
+
affectedHooks = "compilation";
|
7952
7767
|
constructor(options){
|
7953
|
-
super(), this.options = options
|
7768
|
+
super(), this.options = options;
|
7954
7769
|
}
|
7955
7770
|
raw(compiler) {
|
7956
7771
|
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 = {
|
@@ -7987,21 +7802,21 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7987
7802
|
imports,
|
7988
7803
|
entries,
|
7989
7804
|
test
|
7990
|
-
}), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-",
|
7805
|
+
}), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", noop = (_req, _res, next)=>{
|
7991
7806
|
"function" == typeof next && next();
|
7992
|
-
}, getFullServerUrl = ({ serverUrl, prefix })=>{
|
7993
|
-
let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
|
7994
|
-
return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
|
7995
7807
|
};
|
7996
7808
|
function applyPlugin(compiler, moduleToIndex, indexToModule, options, activeModules, filesByKey) {
|
7997
7809
|
new BuiltinLazyCompilationPlugin(({ module, path })=>{
|
7998
|
-
let index = moduleToIndex.get(module);
|
7810
|
+
let compiler1, index = moduleToIndex.get(module);
|
7999
7811
|
void 0 === index && (index = moduleToIndex.size.toString(), moduleToIndex.set(module, index), indexToModule.set(index, module));
|
8000
7812
|
let key = indexToModule.get(index);
|
8001
7813
|
filesByKey.set(key, path);
|
8002
7814
|
let active = !0 === activeModules.get(key);
|
8003
7815
|
return {
|
8004
|
-
client: `${options.client ||
|
7816
|
+
client: `${options.client || (compiler1 = compiler, require.resolve(`../hot/lazy-compilation-${compiler1.options.externalsPresets.node ? "node" : "web"}.js`))}?${encodeURIComponent((({ serverUrl, prefix })=>{
|
7817
|
+
let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
|
7818
|
+
return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
|
7819
|
+
})(options))}`,
|
8005
7820
|
data: index,
|
8006
7821
|
active
|
8007
7822
|
};
|
@@ -8029,10 +7844,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8029
7844
|
}, LimitChunkCountPlugin = base_create(binding_.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options);
|
8030
7845
|
class MangleExportsPlugin extends RspackBuiltinPlugin {
|
8031
7846
|
deterministic;
|
8032
|
-
name;
|
8033
|
-
affectedHooks;
|
7847
|
+
name = binding_.BuiltinPluginName.MangleExportsPlugin;
|
7848
|
+
affectedHooks = "compilation";
|
8034
7849
|
constructor(deterministic){
|
8035
|
-
super(), this.deterministic = deterministic
|
7850
|
+
super(), this.deterministic = deterministic;
|
8036
7851
|
}
|
8037
7852
|
raw(compiler) {
|
8038
7853
|
return createBuiltinPlugin(this.name, this.deterministic);
|
@@ -8091,29 +7906,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8091
7906
|
])
|
8092
7907
|
}, RuntimePlugin_compilationHooksMap.set(compilation, hooks)), hooks;
|
8093
7908
|
};
|
8094
|
-
let
|
8095
|
-
registerRuntimePluginCreateScriptTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginCreateScript, function() {
|
8096
|
-
return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).createScript;
|
8097
|
-
}, function(queried) {
|
8098
|
-
return function(data) {
|
8099
|
-
return queried.call(data.code, data.chunk);
|
8100
|
-
};
|
8101
|
-
}),
|
8102
|
-
registerRuntimePluginLinkPreloadTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginLinkPreload, function() {
|
8103
|
-
return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).linkPreload;
|
8104
|
-
}, function(queried) {
|
8105
|
-
return function(data) {
|
8106
|
-
return queried.call(data.code, data.chunk);
|
8107
|
-
};
|
8108
|
-
}),
|
8109
|
-
registerRuntimePluginLinkPrefetchTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginLinkPrefetch, function() {
|
8110
|
-
return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).linkPrefetch;
|
8111
|
-
}, function(queried) {
|
8112
|
-
return function(data) {
|
8113
|
-
return queried.call(data.code, data.chunk);
|
8114
|
-
};
|
8115
|
-
})
|
8116
|
-
}), SideEffectsFlagPlugin = base_create(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
|
7909
|
+
let SideEffectsFlagPlugin = base_create(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
|
8117
7910
|
let hints = !1 === options.hints ? void 0 : options.hints;
|
8118
7911
|
return {
|
8119
7912
|
...options,
|
@@ -8129,10 +7922,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8129
7922
|
}
|
8130
7923
|
class SplitChunksPlugin extends RspackBuiltinPlugin {
|
8131
7924
|
options;
|
8132
|
-
name;
|
8133
|
-
affectedHooks;
|
7925
|
+
name = binding_.BuiltinPluginName.SplitChunksPlugin;
|
7926
|
+
affectedHooks = "thisCompilation";
|
8134
7927
|
constructor(options){
|
8135
|
-
super(), this.options = options
|
7928
|
+
super(), this.options = options;
|
8136
7929
|
}
|
8137
7930
|
raw(compiler) {
|
8138
7931
|
let rawOptions = function(sc, compiler) {
|
@@ -8275,9 +8068,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8275
8068
|
wasmLoading;
|
8276
8069
|
module;
|
8277
8070
|
workerPublicPath;
|
8278
|
-
name;
|
8071
|
+
name = binding_.BuiltinPluginName.WorkerPlugin;
|
8279
8072
|
constructor(chunkLoading, wasmLoading, module, workerPublicPath){
|
8280
|
-
super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath
|
8073
|
+
super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath;
|
8281
8074
|
}
|
8282
8075
|
raw(compiler) {
|
8283
8076
|
return this.chunkLoading && new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler), this.wasmLoading && new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler), createBuiltinPlugin(this.name, void 0);
|
@@ -8332,43 +8125,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8332
8125
|
])
|
8333
8126
|
}, RsdoctorPlugin_compilationHooksMap.set(compilation, hooks)), hooks;
|
8334
8127
|
};
|
8335
|
-
let
|
8336
|
-
registerRsdoctorPluginModuleGraphTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleGraph, function() {
|
8337
|
-
return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleGraph;
|
8338
|
-
}, function(queried) {
|
8339
|
-
return async function(data) {
|
8340
|
-
return await queried.promise(data);
|
8341
|
-
};
|
8342
|
-
}),
|
8343
|
-
registerRsdoctorPluginChunkGraphTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginChunkGraph, function() {
|
8344
|
-
return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).chunkGraph;
|
8345
|
-
}, function(queried) {
|
8346
|
-
return async function(data) {
|
8347
|
-
return await queried.promise(data);
|
8348
|
-
};
|
8349
|
-
}),
|
8350
|
-
registerRsdoctorPluginModuleIdsTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleIds, function() {
|
8351
|
-
return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleIds;
|
8352
|
-
}, function(queried) {
|
8353
|
-
return async function(data) {
|
8354
|
-
return await queried.promise(data);
|
8355
|
-
};
|
8356
|
-
}),
|
8357
|
-
registerRsdoctorPluginModuleSourcesTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleSources, function() {
|
8358
|
-
return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleSources;
|
8359
|
-
}, function(queried) {
|
8360
|
-
return async function(data) {
|
8361
|
-
return await queried.promise(data);
|
8362
|
-
};
|
8363
|
-
}),
|
8364
|
-
registerRsdoctorPluginAssetsTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginAssets, function() {
|
8365
|
-
return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).assets;
|
8366
|
-
}, function(queried) {
|
8367
|
-
return async function(data) {
|
8368
|
-
return await queried.promise(data);
|
8369
|
-
};
|
8370
|
-
})
|
8371
|
-
}), SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
|
8128
|
+
let SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
|
8372
8129
|
let htmlPlugin = "Disabled";
|
8373
8130
|
return options.htmlPlugin === NATIVE_HTML_PLUGIN ? htmlPlugin = "Native" : "string" == typeof options.htmlPlugin && (htmlPlugin = "JavaScript"), {
|
8374
8131
|
hashFuncNames: options.hashFuncNames,
|
@@ -8693,8 +8450,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
8693
8450
|
let requiredVersion = versions[name];
|
8694
8451
|
if (!requiredVersion) return !1;
|
8695
8452
|
let [parsedMajor, parserMinor] = "TP" === parsedVersion ? [
|
8696
|
-
|
8697
|
-
|
8453
|
+
1 / 0,
|
8454
|
+
1 / 0
|
8698
8455
|
] : parsedVersion.includes("-") ? parsedVersion.split("-")[0].split(".") : parsedVersion.split(".");
|
8699
8456
|
return "number" == typeof requiredVersion ? +parsedMajor >= requiredVersion : requiredVersion[0] === +parsedMajor ? +parserMinor >= requiredVersion[1] : +parsedMajor > requiredVersion[0];
|
8700
8457
|
}), anyNode = browsers.some((b)=>b.startsWith("node ")), anyBrowser = browsers.some((b)=>/^(?!node)/.test(b)), browserProperty = !!anyBrowser && (!anyNode || null), nodeProperty = !!anyNode && (!anyBrowser || null), es6DynamicImport = rawChecker({
|
@@ -9086,7 +8843,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
9086
8843
|
}, getBrowserslistTargetHandler = memoize(()=>browserslistTargetHandler_namespaceObject), hasBrowserslistConfig = (context)=>{
|
9087
8844
|
let { findConfig } = __webpack_require__("browserslist-load-config");
|
9088
8845
|
return !!findConfig(context);
|
9089
|
-
},
|
8846
|
+
}, versionDependent = (major, minor)=>{
|
9090
8847
|
if (!major) return ()=>void 0;
|
9091
8848
|
let nMajor = +major, nMinor = minor ? +minor : 0;
|
9092
8849
|
return (vMajor, vMinor = 0)=>nMajor > vMajor || nMajor === vMajor && nMinor >= vMinor;
|
@@ -9286,27 +9043,28 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9286
9043
|
}
|
9287
9044
|
}
|
9288
9045
|
throw Error(`Unknown target '${target}'. The following targets are supported:\n${TARGETS.map(([name, description])=>`* ${name}: ${description}`).join("\n")}`);
|
9289
|
-
},
|
9290
|
-
let
|
9291
|
-
|
9292
|
-
let result = {};
|
9293
|
-
for (let key of keys){
|
9294
|
-
let hasTrue = !1, hasFalse = !1;
|
9295
|
-
for (let tp of targetProperties)switch(tp[key]){
|
9296
|
-
case !0:
|
9297
|
-
hasTrue = !0;
|
9298
|
-
break;
|
9299
|
-
case !1:
|
9300
|
-
hasFalse = !0;
|
9301
|
-
}
|
9302
|
-
(hasTrue || hasFalse) && (result[key] = hasFalse && hasTrue ? null : hasTrue);
|
9303
|
-
}
|
9304
|
-
return result;
|
9305
|
-
}, getTargetsProperties = (targets, context)=>mergeTargetProperties(targets.map((t)=>getTargetProperties(t, context))), applyRspackOptionsDefaults = (options)=>{
|
9306
|
-
defaults_F(options, "context", ()=>process.cwd()), defaults_F(options, "target", ()=>getDefaultTarget(options.context));
|
9046
|
+
}, applyRspackOptionsDefaults = (options)=>{
|
9047
|
+
let targets, context;
|
9048
|
+
defaults_F(options, "context", ()=>process.cwd()), defaults_F(options, "target", ()=>hasBrowserslistConfig(options.context) ? "browserslist" : "web");
|
9307
9049
|
let { mode, target } = options;
|
9308
9050
|
external_node_assert_default()(!isNil(target));
|
9309
|
-
let targetProperties = !1 !== target && ("string" == typeof target ? getTargetProperties(target, options.context) :
|
9051
|
+
let targetProperties = !1 !== target && ("string" == typeof target ? getTargetProperties(target, options.context) : (targets = target, context = options.context, ((targetProperties)=>{
|
9052
|
+
let keys = new Set();
|
9053
|
+
for (let tp of targetProperties)for (let key of Object.keys(tp))keys.add(key);
|
9054
|
+
let result = {};
|
9055
|
+
for (let key of keys){
|
9056
|
+
let hasTrue = !1, hasFalse = !1;
|
9057
|
+
for (let tp of targetProperties)switch(tp[key]){
|
9058
|
+
case !0:
|
9059
|
+
hasTrue = !0;
|
9060
|
+
break;
|
9061
|
+
case !1:
|
9062
|
+
hasFalse = !0;
|
9063
|
+
}
|
9064
|
+
(hasTrue || hasFalse) && (result[key] = hasFalse && hasTrue ? null : hasTrue);
|
9065
|
+
}
|
9066
|
+
return result;
|
9067
|
+
})(targets.map((t)=>getTargetProperties(t, context))))), development = "development" === mode, production = "production" === mode || !mode;
|
9310
9068
|
if ("function" != typeof options.entry) for (let key of Object.keys(options.entry))defaults_F(options.entry[key], "import", ()=>[
|
9311
9069
|
"./src"
|
9312
9070
|
]);
|
@@ -9350,8 +9108,6 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9350
9108
|
mode: options.mode,
|
9351
9109
|
css: options.experiments.css
|
9352
9110
|
}), options.resolve), options.resolveLoader = cleverMerge(getResolveLoaderDefaults(), options.resolveLoader);
|
9353
|
-
}, applyRspackOptionsBaseDefaults = (options)=>{
|
9354
|
-
defaults_F(options, "context", ()=>process.cwd()), applyInfrastructureLoggingDefaults(options.infrastructureLogging);
|
9355
9111
|
}, applyInfrastructureLoggingDefaults = (infrastructureLogging)=>{
|
9356
9112
|
defaults_F(infrastructureLogging, "stream", ()=>process.stderr);
|
9357
9113
|
let tty = infrastructureLogging.stream.isTTY && "dumb" !== process.env.TERM;
|
@@ -9359,15 +9115,12 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9359
9115
|
}, applyExperimentsDefaults = (experiments, { production, development })=>{
|
9360
9116
|
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);
|
9361
9117
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
9362
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.7
|
9363
|
-
}, applySnapshotDefaults = (_snapshot, _env)=>{},
|
9364
|
-
|
9118
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.7"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
9119
|
+
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
|
9120
|
+
var parserOptions;
|
9121
|
+
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", [
|
9365
9122
|
"..."
|
9366
|
-
]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", !1), D(parserOptions, "typeReexportsPresence", "no-tolerant")
|
9367
|
-
}, applyJsonGeneratorOptionsDefaults = (generatorOptions)=>{
|
9368
|
-
D(generatorOptions, "JSONParse", !0);
|
9369
|
-
}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
|
9370
|
-
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) {
|
9123
|
+
]), 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) {
|
9371
9124
|
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");
|
9372
9125
|
let localIdentName = uniqueName && uniqueName.length > 0 ? "[uniqueName]-[id]-[local]" : "[id]-[local]";
|
9373
9126
|
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);
|
@@ -9507,8 +9260,38 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9507
9260
|
return "";
|
9508
9261
|
}
|
9509
9262
|
}), defaults_F(output, "devtoolNamespace", ()=>output.uniqueName), defaults_F(output, "module", ()=>!!outputModule);
|
9510
|
-
let environment = output.environment,
|
9511
|
-
defaults_F(environment, "globalThis", ()=>tp?.globalThis), defaults_F(environment, "bigIntLiteral", ()=>
|
9263
|
+
let environment = output.environment, conditionallyOptimistic = (v, c)=>void 0 === v && c || v;
|
9264
|
+
defaults_F(environment, "globalThis", ()=>tp?.globalThis), defaults_F(environment, "bigIntLiteral", ()=>{
|
9265
|
+
let v;
|
9266
|
+
return tp && ((v = tp.bigIntLiteral) || void 0 === v);
|
9267
|
+
}), defaults_F(environment, "const", ()=>{
|
9268
|
+
let v;
|
9269
|
+
return tp && ((v = tp.const) || void 0 === v);
|
9270
|
+
}), defaults_F(environment, "arrowFunction", ()=>{
|
9271
|
+
let v;
|
9272
|
+
return tp && ((v = tp.arrowFunction) || void 0 === v);
|
9273
|
+
}), defaults_F(environment, "asyncFunction", ()=>{
|
9274
|
+
let v;
|
9275
|
+
return tp && ((v = tp.asyncFunction) || void 0 === v);
|
9276
|
+
}), defaults_F(environment, "forOf", ()=>{
|
9277
|
+
let v;
|
9278
|
+
return tp && ((v = tp.forOf) || void 0 === v);
|
9279
|
+
}), defaults_F(environment, "destructuring", ()=>{
|
9280
|
+
let v;
|
9281
|
+
return tp && ((v = tp.destructuring) || void 0 === v);
|
9282
|
+
}), defaults_F(environment, "optionalChaining", ()=>{
|
9283
|
+
let v;
|
9284
|
+
return tp && ((v = tp.optionalChaining) || void 0 === v);
|
9285
|
+
}), defaults_F(environment, "nodePrefixForCoreModules", ()=>{
|
9286
|
+
let v;
|
9287
|
+
return tp && ((v = tp.nodePrefixForCoreModules) || void 0 === v);
|
9288
|
+
}), defaults_F(environment, "templateLiteral", ()=>{
|
9289
|
+
let v;
|
9290
|
+
return tp && ((v = tp.templateLiteral) || void 0 === v);
|
9291
|
+
}), 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", ()=>{
|
9292
|
+
let v;
|
9293
|
+
return tp && ((v = tp.document) || void 0 === v);
|
9294
|
+
}), D(output, "filename", output.module ? "[name].mjs" : "[name].js"), defaults_F(output, "iife", ()=>!output.module), defaults_F(output, "chunkFilename", ()=>{
|
9512
9295
|
let filename = output.filename;
|
9513
9296
|
if ("function" != typeof filename) {
|
9514
9297
|
let hasName = filename.includes("[name]"), hasId = filename.includes("[id]"), hasChunkHash = filename.includes("[chunkhash]"), hasContentHash = filename.includes("[contenthash]");
|
@@ -9632,7 +9415,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9632
9415
|
] : [
|
9633
9416
|
"javascript",
|
9634
9417
|
"unknown"
|
9635
|
-
]), 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 :
|
9418
|
+
]), 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", "-");
|
9636
9419
|
let { cacheGroups } = splitChunks;
|
9637
9420
|
cacheGroups && (defaults_F(cacheGroups, "default", ()=>({
|
9638
9421
|
idHint: "",
|
@@ -10209,12 +9992,16 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10209
9992
|
this.callbacks = [];
|
10210
9993
|
let fileDependencies = new Set([
|
10211
9994
|
...compilation.fileDependencies
|
10212
|
-
])
|
9995
|
+
]);
|
9996
|
+
fileDependencies.added = new Set(compilation.__internal__addedFileDependencies), fileDependencies.removed = new Set(compilation.__internal__removedFileDependencies);
|
9997
|
+
let contextDependencies = new Set([
|
10213
9998
|
...compilation.contextDependencies
|
10214
|
-
])
|
9999
|
+
]);
|
10000
|
+
contextDependencies.added = new Set(compilation.__internal__addedContextDependencies), contextDependencies.removed = new Set(compilation.__internal__removedContextDependencies);
|
10001
|
+
let missingDependencies = new Set([
|
10215
10002
|
...compilation.missingDependencies
|
10216
10003
|
]);
|
10217
|
-
this.compiler.hooks.done.callAsync(stats, (err)=>{
|
10004
|
+
missingDependencies.added = new Set(compilation.__internal__addedMissingDependencies), missingDependencies.removed = new Set(compilation.__internal__removedMissingDependencies), this.compiler.hooks.done.callAsync(stats, (err)=>{
|
10218
10005
|
if (err) return handleError(err, cbs);
|
10219
10006
|
for (let cb of (this.handler(null, stats), process.nextTick(()=>{
|
10220
10007
|
this.#closed || this.watch(fileDependencies, contextDependencies, missingDependencies);
|
@@ -10237,7 +10024,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10237
10024
|
this.suspended && (this.suspended = !1, this.#invalidate());
|
10238
10025
|
}
|
10239
10026
|
}
|
10240
|
-
let CORE_VERSION = "1.4.7
|
10027
|
+
let CORE_VERSION = "1.4.7", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
10241
10028
|
|
10242
10029
|
Help:
|
10243
10030
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
@@ -10247,89 +10034,7 @@ Help:
|
|
10247
10034
|
Help:
|
10248
10035
|
Please ensure the version of @rspack/binding and @rspack/core is the same.
|
10249
10036
|
The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
|
10250
|
-
`,
|
10251
|
-
let getOptions = (uid)=>getPluginOptions(getCompiler().__internal__get_compilation(), uid);
|
10252
|
-
return {
|
10253
|
-
registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration, function() {
|
10254
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeAssetTagGeneration;
|
10255
|
-
}, function(queried) {
|
10256
|
-
return async function(data) {
|
10257
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10258
|
-
...data,
|
10259
|
-
plugin: {
|
10260
|
-
options: getOptions(uid)
|
10261
|
-
}
|
10262
|
-
});
|
10263
|
-
return res.compilationId = compilationId, res.uid = uid, res;
|
10264
|
-
};
|
10265
|
-
}),
|
10266
|
-
registerHtmlPluginAlterAssetTagsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTags, function() {
|
10267
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTags;
|
10268
|
-
}, function(queried) {
|
10269
|
-
return async function(data) {
|
10270
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10271
|
-
...data,
|
10272
|
-
plugin: {
|
10273
|
-
options: getOptions(uid)
|
10274
|
-
}
|
10275
|
-
});
|
10276
|
-
return res.compilationId = compilationId, res.uid = uid, res;
|
10277
|
-
};
|
10278
|
-
}),
|
10279
|
-
registerHtmlPluginAlterAssetTagGroupsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups, function() {
|
10280
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTagGroups;
|
10281
|
-
}, function(queried) {
|
10282
|
-
return async function(data) {
|
10283
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10284
|
-
...data,
|
10285
|
-
plugin: {
|
10286
|
-
options: getOptions(uid)
|
10287
|
-
}
|
10288
|
-
});
|
10289
|
-
return res.compilationId = compilationId, res.uid = uid, res;
|
10290
|
-
};
|
10291
|
-
}),
|
10292
|
-
registerHtmlPluginAfterTemplateExecutionTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterTemplateExecution, function() {
|
10293
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterTemplateExecution;
|
10294
|
-
}, function(queried) {
|
10295
|
-
return async function(data) {
|
10296
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10297
|
-
...data,
|
10298
|
-
plugin: {
|
10299
|
-
options: getOptions(uid)
|
10300
|
-
}
|
10301
|
-
});
|
10302
|
-
return res.compilationId = compilationId, res;
|
10303
|
-
};
|
10304
|
-
}),
|
10305
|
-
registerHtmlPluginBeforeEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeEmit, function() {
|
10306
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeEmit;
|
10307
|
-
}, function(queried) {
|
10308
|
-
return async function(data) {
|
10309
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10310
|
-
...data,
|
10311
|
-
plugin: {
|
10312
|
-
options: getOptions(uid)
|
10313
|
-
}
|
10314
|
-
});
|
10315
|
-
return res.compilationId = compilationId, res.uid = uid, res;
|
10316
|
-
};
|
10317
|
-
}),
|
10318
|
-
registerHtmlPluginAfterEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterEmit, function() {
|
10319
|
-
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterEmit;
|
10320
|
-
}, function(queried) {
|
10321
|
-
return async function(data) {
|
10322
|
-
let { compilationId, uid } = data, res = await queried.promise({
|
10323
|
-
...data,
|
10324
|
-
plugin: {
|
10325
|
-
options: getOptions(uid)
|
10326
|
-
}
|
10327
|
-
});
|
10328
|
-
return res.compilationId = compilationId, res.uid = uid, res;
|
10329
|
-
};
|
10330
|
-
})
|
10331
|
-
};
|
10332
|
-
}, RESERVED_RUNTIME_GLOBALS = new Map();
|
10037
|
+
`, RESERVED_RUNTIME_GLOBALS = new Map();
|
10333
10038
|
function __from_binding_runtime_globals(runtimeRequirements) {
|
10334
10039
|
let res = new Set();
|
10335
10040
|
for (let flag of runtimeRequirements.value)flag in RuntimeGlobals ? res.add(RuntimeGlobals[flag]) : res.add(flag);
|
@@ -10418,7 +10123,6 @@ Help:
|
|
10418
10123
|
asyncModule: "__webpack_require__.a"
|
10419
10124
|
};
|
10420
10125
|
for (let entry of Object.entries(RuntimeGlobals))RESERVED_RUNTIME_GLOBALS.set(entry[1], entry[0]);
|
10421
|
-
let isReservedRuntimeGlobal = (r)=>RESERVED_RUNTIME_GLOBALS.has(r);
|
10422
10126
|
class CodeGenerationResult {
|
10423
10127
|
#inner;
|
10424
10128
|
constructor(result){
|
@@ -10428,263 +10132,21 @@ Help:
|
|
10428
10132
|
return this.#inner.sources[sourceType];
|
10429
10133
|
}
|
10430
10134
|
}
|
10431
|
-
|
10432
|
-
|
10433
|
-
|
10434
|
-
|
10435
|
-
|
10436
|
-
|
10437
|
-
|
10438
|
-
|
10439
|
-
|
10440
|
-
|
10441
|
-
|
10442
|
-
|
10443
|
-
|
10444
|
-
|
10445
|
-
|
10446
|
-
let set = __from_binding_runtime_globals(runtimeRequirements), all = __from_binding_runtime_globals(allRuntimeRequirements), customRuntimeGlobals = new Set(), originalAdd = all.add.bind(all), add = function(r) {
|
10447
|
-
return all.has(r) ? all : (isReservedRuntimeGlobal(r) || customRuntimeGlobals.add(r), originalAdd(r));
|
10448
|
-
};
|
10449
|
-
for (let r of (all.add = add.bind(add), set))queried.for(r).call(chunk, all);
|
10450
|
-
for (let r of customRuntimeGlobals)queried.for(r).call(chunk, all);
|
10451
|
-
return {
|
10452
|
-
allRuntimeRequirements: __to_binding_runtime_globals(all)
|
10453
|
-
};
|
10454
|
-
};
|
10455
|
-
}),
|
10456
|
-
registerCompilationRuntimeModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationRuntimeModule, function() {
|
10457
|
-
return getCompiler().__internal__get_compilation().hooks.runtimeModule;
|
10458
|
-
}, function(queried) {
|
10459
|
-
return function({ module, chunk }) {
|
10460
|
-
let originSource = module.source?.source;
|
10461
|
-
queried.call(module, chunk);
|
10462
|
-
let newSource = module.source?.source;
|
10463
|
-
if (newSource && newSource !== originSource) return module;
|
10464
|
-
};
|
10465
|
-
}),
|
10466
|
-
registerCompilationBuildModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationBuildModule, function() {
|
10467
|
-
return getCompiler().__internal__get_compilation().hooks.buildModule;
|
10468
|
-
}, function(queried) {
|
10469
|
-
return function(module) {
|
10470
|
-
return queried.call(module);
|
10471
|
-
};
|
10472
|
-
}),
|
10473
|
-
registerCompilationStillValidModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationStillValidModule, function() {
|
10474
|
-
return getCompiler().__internal__get_compilation().hooks.stillValidModule;
|
10475
|
-
}, function(queried) {
|
10476
|
-
return function(module) {
|
10477
|
-
return queried.call(module);
|
10478
|
-
};
|
10479
|
-
}),
|
10480
|
-
registerCompilationSucceedModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationSucceedModule, function() {
|
10481
|
-
return getCompiler().__internal__get_compilation().hooks.succeedModule;
|
10482
|
-
}, function(queried) {
|
10483
|
-
return function(module) {
|
10484
|
-
return queried.call(module);
|
10485
|
-
};
|
10486
|
-
}),
|
10487
|
-
registerCompilationExecuteModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationExecuteModule, function() {
|
10488
|
-
return getCompiler().__internal__get_compilation().hooks.executeModule;
|
10489
|
-
}, function(queried) {
|
10490
|
-
return function({ entry, id, codegenResults, runtimeModules }) {
|
10491
|
-
try {
|
10492
|
-
let __nested_webpack_require_4786_4805__ = (id)=>{
|
10493
|
-
let cached = moduleCache[id];
|
10494
|
-
if (void 0 !== cached) {
|
10495
|
-
if (cached.error) throw cached.error;
|
10496
|
-
return cached.exports;
|
10497
|
-
}
|
10498
|
-
let execOptions = {
|
10499
|
-
id,
|
10500
|
-
module: {
|
10501
|
-
id,
|
10502
|
-
exports: {},
|
10503
|
-
loaded: !1,
|
10504
|
-
error: void 0
|
10505
|
-
},
|
10506
|
-
require: __nested_webpack_require_4786_4805__
|
10507
|
-
};
|
10508
|
-
for (let handler of interceptModuleExecution)handler(execOptions);
|
10509
|
-
let result = codegenResults.map[id]["build time"], moduleObject = execOptions.module;
|
10510
|
-
return id && (moduleCache[id] = moduleObject), tryRunOrWebpackError(()=>queried.call({
|
10511
|
-
codeGenerationResult: new CodeGenerationResult(result),
|
10512
|
-
moduleObject
|
10513
|
-
}, {
|
10514
|
-
__webpack_require__: __nested_webpack_require_4786_4805__
|
10515
|
-
}), "Compilation.hooks.executeModule"), moduleObject.loaded = !0, moduleObject.exports;
|
10516
|
-
}, moduleCache = __nested_webpack_require_4786_4805__[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {}, interceptModuleExecution = __nested_webpack_require_4786_4805__[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
|
10517
|
-
for (let runtimeModule of runtimeModules)__nested_webpack_require_4786_4805__(runtimeModule);
|
10518
|
-
let executeResult = __nested_webpack_require_4786_4805__(entry);
|
10519
|
-
getCompiler().__internal__get_module_execution_results_map().set(id, executeResult);
|
10520
|
-
} catch (e) {
|
10521
|
-
throw getCompiler().__internal__get_module_execution_results_map().set(id, e), e;
|
10522
|
-
}
|
10523
|
-
};
|
10524
|
-
}),
|
10525
|
-
registerCompilationFinishModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationFinishModules, function() {
|
10526
|
-
return getCompiler().__internal__get_compilation().hooks.finishModules;
|
10527
|
-
}, function(queried) {
|
10528
|
-
return async function() {
|
10529
|
-
return await queried.promise(getCompiler().__internal__get_compilation().modules);
|
10530
|
-
};
|
10531
|
-
}),
|
10532
|
-
registerCompilationOptimizeModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeModules, function() {
|
10533
|
-
return getCompiler().__internal__get_compilation().hooks.optimizeModules;
|
10534
|
-
}, function(queried) {
|
10535
|
-
return function() {
|
10536
|
-
return queried.call(getCompiler().__internal__get_compilation().modules.values());
|
10537
|
-
};
|
10538
|
-
}),
|
10539
|
-
registerCompilationAfterOptimizeModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterOptimizeModules, function() {
|
10540
|
-
return getCompiler().__internal__get_compilation().hooks.afterOptimizeModules;
|
10541
|
-
}, function(queried) {
|
10542
|
-
return function() {
|
10543
|
-
queried.call(getCompiler().__internal__get_compilation().modules.values());
|
10544
|
-
};
|
10545
|
-
}),
|
10546
|
-
registerCompilationOptimizeTreeTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeTree, function() {
|
10547
|
-
return getCompiler().__internal__get_compilation().hooks.optimizeTree;
|
10548
|
-
}, function(queried) {
|
10549
|
-
return async function() {
|
10550
|
-
return await queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
|
10551
|
-
};
|
10552
|
-
}),
|
10553
|
-
registerCompilationOptimizeChunkModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeChunkModules, function() {
|
10554
|
-
return getCompiler().__internal__get_compilation().hooks.optimizeChunkModules;
|
10555
|
-
}, function(queried) {
|
10556
|
-
return async function() {
|
10557
|
-
return await queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
|
10558
|
-
};
|
10559
|
-
}),
|
10560
|
-
registerCompilationChunkHashTaps: createTap(binding_.RegisterJsTapKind.CompilationChunkHash, function() {
|
10561
|
-
return getCompiler().__internal__get_compilation().hooks.chunkHash;
|
10562
|
-
}, function(queried) {
|
10563
|
-
return function(chunk) {
|
10564
|
-
let digestResult;
|
10565
|
-
if (!getCompiler().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
|
10566
|
-
let hash = createHash(getCompiler().options.output.hashFunction);
|
10567
|
-
return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler().options.output.hashDigest ? hash.digest(getCompiler().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
|
10568
|
-
};
|
10569
|
-
}),
|
10570
|
-
registerCompilationChunkAssetTaps: createTap(binding_.RegisterJsTapKind.CompilationChunkAsset, function() {
|
10571
|
-
return getCompiler().__internal__get_compilation().hooks.chunkAsset;
|
10572
|
-
}, function(queried) {
|
10573
|
-
return function({ chunk, filename }) {
|
10574
|
-
return queried.call(chunk, filename);
|
10575
|
-
};
|
10576
|
-
}),
|
10577
|
-
registerCompilationProcessAssetsTaps: createTap(binding_.RegisterJsTapKind.CompilationProcessAssets, function() {
|
10578
|
-
return getCompiler().__internal__get_compilation().hooks.processAssets;
|
10579
|
-
}, function(queried) {
|
10580
|
-
return async function() {
|
10581
|
-
return await queried.promise(getCompiler().__internal__get_compilation().assets);
|
10582
|
-
};
|
10583
|
-
}),
|
10584
|
-
registerCompilationAfterProcessAssetsTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterProcessAssets, function() {
|
10585
|
-
return getCompiler().__internal__get_compilation().hooks.afterProcessAssets;
|
10586
|
-
}, function(queried) {
|
10587
|
-
return function() {
|
10588
|
-
return queried.call(getCompiler().__internal__get_compilation().assets);
|
10589
|
-
};
|
10590
|
-
}),
|
10591
|
-
registerCompilationSealTaps: createTap(binding_.RegisterJsTapKind.CompilationSeal, function() {
|
10592
|
-
return getCompiler().__internal__get_compilation().hooks.seal;
|
10593
|
-
}, function(queried) {
|
10594
|
-
return function() {
|
10595
|
-
return queried.call();
|
10596
|
-
};
|
10597
|
-
}),
|
10598
|
-
registerCompilationAfterSealTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterSeal, function() {
|
10599
|
-
return getCompiler().__internal__get_compilation().hooks.afterSeal;
|
10600
|
-
}, function(queried) {
|
10601
|
-
return async function() {
|
10602
|
-
return await queried.promise();
|
10603
|
-
};
|
10604
|
-
})
|
10605
|
-
}), createCompilerHooksRegisters = (getCompiler, createTap, createMapTap)=>({
|
10606
|
-
registerCompilerThisCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerThisCompilation, function() {
|
10607
|
-
return getCompiler().hooks.thisCompilation;
|
10608
|
-
}, function(queried) {
|
10609
|
-
return function(native) {
|
10610
|
-
return getCompiler().__internal__create_compilation(native), queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
|
10611
|
-
};
|
10612
|
-
}),
|
10613
|
-
registerCompilerCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerCompilation, function() {
|
10614
|
-
return getCompiler().hooks.compilation;
|
10615
|
-
}, function(queried) {
|
10616
|
-
return function() {
|
10617
|
-
return queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
|
10618
|
-
};
|
10619
|
-
}),
|
10620
|
-
registerCompilerMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerMake, function() {
|
10621
|
-
return getCompiler().hooks.make;
|
10622
|
-
}, function(queried) {
|
10623
|
-
return async function() {
|
10624
|
-
return await queried.promise(getCompiler().__internal__get_compilation());
|
10625
|
-
};
|
10626
|
-
}),
|
10627
|
-
registerCompilerFinishMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerFinishMake, function() {
|
10628
|
-
return getCompiler().hooks.finishMake;
|
10629
|
-
}, function(queried) {
|
10630
|
-
return async function() {
|
10631
|
-
return await queried.promise(getCompiler().__internal__get_compilation());
|
10632
|
-
};
|
10633
|
-
}),
|
10634
|
-
registerCompilerShouldEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerShouldEmit, function() {
|
10635
|
-
return getCompiler().hooks.shouldEmit;
|
10636
|
-
}, function(queried) {
|
10637
|
-
return function() {
|
10638
|
-
return queried.call(getCompiler().__internal__get_compilation());
|
10639
|
-
};
|
10640
|
-
}),
|
10641
|
-
registerCompilerEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerEmit, function() {
|
10642
|
-
return getCompiler().hooks.emit;
|
10643
|
-
}, function(queried) {
|
10644
|
-
return async function() {
|
10645
|
-
return await queried.promise(getCompiler().__internal__get_compilation());
|
10646
|
-
};
|
10647
|
-
}),
|
10648
|
-
registerCompilerAfterEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerAfterEmit, function() {
|
10649
|
-
return getCompiler().hooks.afterEmit;
|
10650
|
-
}, function(queried) {
|
10651
|
-
return async function() {
|
10652
|
-
return await queried.promise(getCompiler().__internal__get_compilation());
|
10653
|
-
};
|
10654
|
-
}),
|
10655
|
-
registerCompilerAssetEmittedTaps: createTap(binding_.RegisterJsTapKind.CompilerAssetEmitted, function() {
|
10656
|
-
return getCompiler().hooks.assetEmitted;
|
10657
|
-
}, function(queried) {
|
10658
|
-
return async function({ filename, targetPath, outputPath }) {
|
10659
|
-
return queried.promise(filename, {
|
10660
|
-
compilation: getCompiler().__internal__get_compilation(),
|
10661
|
-
targetPath,
|
10662
|
-
outputPath,
|
10663
|
-
get source () {
|
10664
|
-
return getCompiler().__internal__get_compilation().getAsset(filename)?.source;
|
10665
|
-
},
|
10666
|
-
get content () {
|
10667
|
-
return this.source?.buffer();
|
10668
|
-
}
|
10669
|
-
});
|
10670
|
-
};
|
10671
|
-
})
|
10672
|
-
});
|
10673
|
-
class ContextModuleFactoryBeforeResolveData {
|
10674
|
-
#inner;
|
10675
|
-
static __from_binding(binding) {
|
10676
|
-
return new ContextModuleFactoryBeforeResolveData(binding);
|
10677
|
-
}
|
10678
|
-
static __to_binding(data) {
|
10679
|
-
return data.#inner;
|
10680
|
-
}
|
10681
|
-
constructor(binding){
|
10682
|
-
this.#inner = binding, Object.defineProperties(this, {
|
10683
|
-
context: {
|
10684
|
-
enumerable: !0,
|
10685
|
-
get: ()=>binding.context,
|
10686
|
-
set (val) {
|
10687
|
-
binding.context = val;
|
10135
|
+
class ContextModuleFactoryBeforeResolveData {
|
10136
|
+
#inner;
|
10137
|
+
static __from_binding(binding) {
|
10138
|
+
return new ContextModuleFactoryBeforeResolveData(binding);
|
10139
|
+
}
|
10140
|
+
static __to_binding(data) {
|
10141
|
+
return data.#inner;
|
10142
|
+
}
|
10143
|
+
constructor(binding){
|
10144
|
+
this.#inner = binding, Object.defineProperties(this, {
|
10145
|
+
context: {
|
10146
|
+
enumerable: !0,
|
10147
|
+
get: ()=>binding.context,
|
10148
|
+
set (val) {
|
10149
|
+
binding.context = val;
|
10688
10150
|
}
|
10689
10151
|
},
|
10690
10152
|
request: {
|
@@ -10783,136 +10245,7 @@ Help:
|
|
10783
10245
|
return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
|
10784
10246
|
}
|
10785
10247
|
});
|
10786
|
-
let
|
10787
|
-
registerContextModuleFactoryBeforeResolveTaps: createTap(binding_.RegisterJsTapKind.ContextModuleFactoryBeforeResolve, function() {
|
10788
|
-
return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.beforeResolve;
|
10789
|
-
}, function(queried) {
|
10790
|
-
return async function(bindingData) {
|
10791
|
-
let data = !!bindingData && ContextModuleFactoryBeforeResolveData.__from_binding(bindingData), result = await queried.promise(data);
|
10792
|
-
return !!result && ContextModuleFactoryBeforeResolveData.__to_binding(result);
|
10793
|
-
};
|
10794
|
-
}),
|
10795
|
-
registerContextModuleFactoryAfterResolveTaps: createTap(binding_.RegisterJsTapKind.ContextModuleFactoryAfterResolve, function() {
|
10796
|
-
return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.afterResolve;
|
10797
|
-
}, function(queried) {
|
10798
|
-
return async function(bindingData) {
|
10799
|
-
let data = !!bindingData && ContextModuleFactoryAfterResolveData.__from_binding(bindingData), result = await queried.promise(data);
|
10800
|
-
return !!result && ContextModuleFactoryAfterResolveData.__to_binding(result);
|
10801
|
-
};
|
10802
|
-
})
|
10803
|
-
}), createJavaScriptModulesHooksRegisters = (getCompiler, createTap, createMapTap)=>({
|
10804
|
-
registerJavascriptModulesChunkHashTaps: createTap(binding_.RegisterJsTapKind.JavascriptModulesChunkHash, function() {
|
10805
|
-
return JavascriptModulesPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).chunkHash;
|
10806
|
-
}, function(queried) {
|
10807
|
-
return function(chunk) {
|
10808
|
-
let digestResult;
|
10809
|
-
if (!getCompiler().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
|
10810
|
-
let hash = createHash(getCompiler().options.output.hashFunction);
|
10811
|
-
return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler().options.output.hashDigest ? hash.digest(getCompiler().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
|
10812
|
-
};
|
10813
|
-
})
|
10814
|
-
}), createNormalModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap)=>({
|
10815
|
-
registerNormalModuleFactoryBeforeResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryBeforeResolve, function() {
|
10816
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
|
10817
|
-
}, function(queried) {
|
10818
|
-
return async function(resolveData) {
|
10819
|
-
let normalizedResolveData = {
|
10820
|
-
contextInfo: {
|
10821
|
-
issuer: resolveData.issuer,
|
10822
|
-
issuerLayer: resolveData.issuerLayer ?? null
|
10823
|
-
},
|
10824
|
-
request: resolveData.request,
|
10825
|
-
context: resolveData.context,
|
10826
|
-
fileDependencies: [],
|
10827
|
-
missingDependencies: [],
|
10828
|
-
contextDependencies: []
|
10829
|
-
}, ret = await queried.promise(normalizedResolveData);
|
10830
|
-
return resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, [
|
10831
|
-
ret,
|
10832
|
-
resolveData
|
10833
|
-
];
|
10834
|
-
};
|
10835
|
-
}),
|
10836
|
-
registerNormalModuleFactoryFactorizeTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryFactorize, function() {
|
10837
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
|
10838
|
-
}, function(queried) {
|
10839
|
-
return async function(resolveData) {
|
10840
|
-
let normalizedResolveData = {
|
10841
|
-
contextInfo: {
|
10842
|
-
issuer: resolveData.issuer,
|
10843
|
-
issuerLayer: resolveData.issuerLayer ?? null
|
10844
|
-
},
|
10845
|
-
request: resolveData.request,
|
10846
|
-
context: resolveData.context,
|
10847
|
-
fileDependencies: [],
|
10848
|
-
missingDependencies: [],
|
10849
|
-
contextDependencies: []
|
10850
|
-
};
|
10851
|
-
return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
|
10852
|
-
};
|
10853
|
-
}),
|
10854
|
-
registerNormalModuleFactoryResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryResolve, function() {
|
10855
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
|
10856
|
-
}, function(queried) {
|
10857
|
-
return async function(resolveData) {
|
10858
|
-
let normalizedResolveData = {
|
10859
|
-
contextInfo: {
|
10860
|
-
issuer: resolveData.issuer,
|
10861
|
-
issuerLayer: resolveData.issuerLayer ?? null
|
10862
|
-
},
|
10863
|
-
request: resolveData.request,
|
10864
|
-
context: resolveData.context,
|
10865
|
-
fileDependencies: [],
|
10866
|
-
missingDependencies: [],
|
10867
|
-
contextDependencies: []
|
10868
|
-
};
|
10869
|
-
return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
|
10870
|
-
};
|
10871
|
-
}),
|
10872
|
-
registerNormalModuleFactoryResolveForSchemeTaps: createMapTap(binding_.RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
|
10873
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolveForScheme;
|
10874
|
-
}, function(queried) {
|
10875
|
-
return async function(args) {
|
10876
|
-
return [
|
10877
|
-
await queried.for(args.scheme).promise(args.resourceData),
|
10878
|
-
args.resourceData
|
10879
|
-
];
|
10880
|
-
};
|
10881
|
-
}),
|
10882
|
-
registerNormalModuleFactoryAfterResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryAfterResolve, function() {
|
10883
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
|
10884
|
-
}, function(queried) {
|
10885
|
-
return async function(arg) {
|
10886
|
-
let data = {
|
10887
|
-
contextInfo: {
|
10888
|
-
issuer: arg.issuer,
|
10889
|
-
issuerLayer: arg.issuerLayer ?? null
|
10890
|
-
},
|
10891
|
-
request: arg.request,
|
10892
|
-
context: arg.context,
|
10893
|
-
fileDependencies: arg.fileDependencies,
|
10894
|
-
missingDependencies: arg.missingDependencies,
|
10895
|
-
contextDependencies: arg.contextDependencies,
|
10896
|
-
createData: arg.createData
|
10897
|
-
};
|
10898
|
-
return [
|
10899
|
-
await queried.promise(data),
|
10900
|
-
data.createData
|
10901
|
-
];
|
10902
|
-
};
|
10903
|
-
}),
|
10904
|
-
registerNormalModuleFactoryCreateModuleTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryCreateModule, function() {
|
10905
|
-
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.createModule;
|
10906
|
-
}, function(queried) {
|
10907
|
-
return async function(args) {
|
10908
|
-
let data = {
|
10909
|
-
...args,
|
10910
|
-
settings: {}
|
10911
|
-
};
|
10912
|
-
await queried.promise(data, {});
|
10913
|
-
};
|
10914
|
-
})
|
10915
|
-
}), traceHookPlugin_PLUGIN_NAME = "TraceHookPlugin", PLUGIN_PROCESS_NAME = "Plugin Analysis", makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
|
10248
|
+
let traceHookPlugin_PLUGIN_NAME = "TraceHookPlugin", PLUGIN_PROCESS_NAME = "Plugin Analysis", makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
|
10916
10249
|
register: (tapInfo)=>{
|
10917
10250
|
let { name, type, fn: internalFn } = tapInfo, newFn = name === traceHookPlugin_PLUGIN_NAME ? internalFn : makeNewTraceTapFn(compilerName, hookName, tracer, {
|
10918
10251
|
name,
|
@@ -11356,10 +10689,91 @@ Help:
|
|
11356
10689
|
return this.#compilationParams = params, params;
|
11357
10690
|
}
|
11358
10691
|
#getInstance(callback) {
|
11359
|
-
let error =
|
10692
|
+
let error = CORE_VERSION === binding_.EXPECTED_RSPACK_CORE_VERSION || CORE_VERSION.includes("canary") ? null : Error(bindingVersionCheck_errorMessage(CORE_VERSION, binding_.EXPECTED_RSPACK_CORE_VERSION));
|
11360
10693
|
if (error) return callback(error);
|
11361
10694
|
if (this.#instance) return callback(null, this.#instance);
|
11362
|
-
let options = this.options, rawOptions =
|
10695
|
+
let options = this.options, rawOptions = ((options, compiler)=>{
|
10696
|
+
var output, module, options1, parser, generator, stats;
|
10697
|
+
let mode = options.mode, experiments = options.experiments;
|
10698
|
+
return {
|
10699
|
+
name: options.name,
|
10700
|
+
mode,
|
10701
|
+
context: options.context,
|
10702
|
+
output: {
|
10703
|
+
...output = options.output,
|
10704
|
+
environment: function(environment = {}) {
|
10705
|
+
return {
|
10706
|
+
const: !!environment.const,
|
10707
|
+
arrowFunction: !!environment.arrowFunction,
|
10708
|
+
nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
|
10709
|
+
asyncFunction: !!environment.asyncFunction,
|
10710
|
+
bigIntLiteral: !!environment.bigIntLiteral,
|
10711
|
+
destructuring: !!environment.destructuring,
|
10712
|
+
document: !!environment.document,
|
10713
|
+
dynamicImport: !!environment.dynamicImport,
|
10714
|
+
forOf: !!environment.forOf,
|
10715
|
+
globalThis: !!environment.globalThis,
|
10716
|
+
module: !!environment.module,
|
10717
|
+
optionalChaining: !!environment.optionalChaining,
|
10718
|
+
templateLiteral: !!environment.templateLiteral
|
10719
|
+
};
|
10720
|
+
}(output.environment)
|
10721
|
+
},
|
10722
|
+
resolve: getRawResolve(options.resolve),
|
10723
|
+
resolveLoader: getRawResolve(options.resolveLoader),
|
10724
|
+
module: (module = options.module, options1 = {
|
10725
|
+
compiler,
|
10726
|
+
mode,
|
10727
|
+
context: options.context,
|
10728
|
+
experiments
|
10729
|
+
}, external_node_assert_default()(!isNil(module.defaultRules), "module.defaultRules should not be nil after defaults"), {
|
10730
|
+
rules: [
|
10731
|
+
{
|
10732
|
+
rules: module.defaultRules
|
10733
|
+
},
|
10734
|
+
{
|
10735
|
+
rules: module.rules
|
10736
|
+
}
|
10737
|
+
].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options1, "javascript/auto")),
|
10738
|
+
parser: Object.fromEntries(Object.entries(parser = module.parser).map(([k, v])=>[
|
10739
|
+
k,
|
10740
|
+
getRawParserOptions(v, k)
|
10741
|
+
]).filter(([k, v])=>void 0 !== v)),
|
10742
|
+
generator: Object.fromEntries(Object.entries(generator = module.generator).map(([k, v])=>[
|
10743
|
+
k,
|
10744
|
+
getRawGeneratorOptions(v, k)
|
10745
|
+
]).filter(([k, v])=>void 0 !== v)),
|
10746
|
+
noParse: module.noParse
|
10747
|
+
}),
|
10748
|
+
optimization: options.optimization,
|
10749
|
+
stats: {
|
10750
|
+
colors: function(options) {
|
10751
|
+
if ("boolean" == typeof options || "string" == typeof options) return presetToOptions(options);
|
10752
|
+
if (!options) return {};
|
10753
|
+
let obj = {
|
10754
|
+
...presetToOptions(options.preset),
|
10755
|
+
...options
|
10756
|
+
};
|
10757
|
+
return delete obj.preset, obj;
|
10758
|
+
}(stats = options.stats).colors ?? !1
|
10759
|
+
},
|
10760
|
+
cache: {
|
10761
|
+
type: options.cache ? "memory" : "disable"
|
10762
|
+
},
|
10763
|
+
experiments,
|
10764
|
+
node: function(node) {
|
10765
|
+
if (!1 !== node) return external_node_assert_default()(!isNil(node.__dirname) && !isNil(node.global) && !isNil(node.__filename)), {
|
10766
|
+
dirname: String(node.__dirname),
|
10767
|
+
filename: String(node.__filename),
|
10768
|
+
global: String(node.global)
|
10769
|
+
};
|
10770
|
+
}(options.node),
|
10771
|
+
profile: options.profile,
|
10772
|
+
amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
|
10773
|
+
bail: options.bail,
|
10774
|
+
__references: {}
|
10775
|
+
};
|
10776
|
+
})(options, this);
|
11363
10777
|
rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries());
|
11364
10778
|
let instanceBinding = __webpack_require__("@rspack/binding");
|
11365
10779
|
this.#registers = this.#createHooksRegisters();
|
@@ -11367,16 +10781,537 @@ Help:
|
|
11367
10781
|
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);
|
11368
10782
|
}
|
11369
10783
|
#createHooksRegisters() {
|
11370
|
-
let ref = new WeakRef(this),
|
10784
|
+
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);
|
11371
10785
|
return {
|
11372
|
-
...
|
11373
|
-
|
11374
|
-
|
11375
|
-
|
11376
|
-
|
11377
|
-
|
11378
|
-
|
11379
|
-
|
10786
|
+
...(getCompiler = getCompiler7, {
|
10787
|
+
registerCompilerThisCompilationTaps: (createTap = createTap6)(binding_.RegisterJsTapKind.CompilerThisCompilation, function() {
|
10788
|
+
return getCompiler().hooks.thisCompilation;
|
10789
|
+
}, function(queried) {
|
10790
|
+
return function(native) {
|
10791
|
+
return getCompiler().__internal__create_compilation(native), queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
|
10792
|
+
};
|
10793
|
+
}),
|
10794
|
+
registerCompilerCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerCompilation, function() {
|
10795
|
+
return getCompiler().hooks.compilation;
|
10796
|
+
}, function(queried) {
|
10797
|
+
return function() {
|
10798
|
+
return queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
|
10799
|
+
};
|
10800
|
+
}),
|
10801
|
+
registerCompilerMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerMake, function() {
|
10802
|
+
return getCompiler().hooks.make;
|
10803
|
+
}, function(queried) {
|
10804
|
+
return async function() {
|
10805
|
+
return await queried.promise(getCompiler().__internal__get_compilation());
|
10806
|
+
};
|
10807
|
+
}),
|
10808
|
+
registerCompilerFinishMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerFinishMake, function() {
|
10809
|
+
return getCompiler().hooks.finishMake;
|
10810
|
+
}, function(queried) {
|
10811
|
+
return async function() {
|
10812
|
+
return await queried.promise(getCompiler().__internal__get_compilation());
|
10813
|
+
};
|
10814
|
+
}),
|
10815
|
+
registerCompilerShouldEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerShouldEmit, function() {
|
10816
|
+
return getCompiler().hooks.shouldEmit;
|
10817
|
+
}, function(queried) {
|
10818
|
+
return function() {
|
10819
|
+
return queried.call(getCompiler().__internal__get_compilation());
|
10820
|
+
};
|
10821
|
+
}),
|
10822
|
+
registerCompilerEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerEmit, function() {
|
10823
|
+
return getCompiler().hooks.emit;
|
10824
|
+
}, function(queried) {
|
10825
|
+
return async function() {
|
10826
|
+
return await queried.promise(getCompiler().__internal__get_compilation());
|
10827
|
+
};
|
10828
|
+
}),
|
10829
|
+
registerCompilerAfterEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerAfterEmit, function() {
|
10830
|
+
return getCompiler().hooks.afterEmit;
|
10831
|
+
}, function(queried) {
|
10832
|
+
return async function() {
|
10833
|
+
return await queried.promise(getCompiler().__internal__get_compilation());
|
10834
|
+
};
|
10835
|
+
}),
|
10836
|
+
registerCompilerAssetEmittedTaps: createTap(binding_.RegisterJsTapKind.CompilerAssetEmitted, function() {
|
10837
|
+
return getCompiler().hooks.assetEmitted;
|
10838
|
+
}, function(queried) {
|
10839
|
+
return async function({ filename, targetPath, outputPath }) {
|
10840
|
+
return queried.promise(filename, {
|
10841
|
+
compilation: getCompiler().__internal__get_compilation(),
|
10842
|
+
targetPath,
|
10843
|
+
outputPath,
|
10844
|
+
get source () {
|
10845
|
+
return getCompiler().__internal__get_compilation().getAsset(filename)?.source;
|
10846
|
+
},
|
10847
|
+
get content () {
|
10848
|
+
return this.source?.buffer();
|
10849
|
+
}
|
10850
|
+
});
|
10851
|
+
};
|
10852
|
+
})
|
10853
|
+
}),
|
10854
|
+
...(getCompiler1 = getCompiler7, createTap1 = createTap6, createMapTap = createMapTap2, {
|
10855
|
+
registerCompilationAdditionalTreeRuntimeRequirementsTaps: createTap1(binding_.RegisterJsTapKind.CompilationAdditionalTreeRuntimeRequirements, function() {
|
10856
|
+
return getCompiler1().__internal__get_compilation().hooks.additionalTreeRuntimeRequirements;
|
10857
|
+
}, function(queried) {
|
10858
|
+
return function({ chunk, runtimeRequirements }) {
|
10859
|
+
let set = __from_binding_runtime_globals(runtimeRequirements);
|
10860
|
+
return queried.call(chunk, set), {
|
10861
|
+
runtimeRequirements: __to_binding_runtime_globals(set)
|
10862
|
+
};
|
10863
|
+
};
|
10864
|
+
}),
|
10865
|
+
registerCompilationRuntimeRequirementInTreeTaps: createMapTap(binding_.RegisterJsTapKind.CompilationRuntimeRequirementInTree, function() {
|
10866
|
+
return getCompiler1().__internal__get_compilation().hooks.runtimeRequirementInTree;
|
10867
|
+
}, function(queried) {
|
10868
|
+
return function({ chunk, allRuntimeRequirements, runtimeRequirements }) {
|
10869
|
+
let set = __from_binding_runtime_globals(runtimeRequirements), all = __from_binding_runtime_globals(allRuntimeRequirements), customRuntimeGlobals = new Set(), originalAdd = all.add.bind(all), add = function(r) {
|
10870
|
+
let r1;
|
10871
|
+
return all.has(r) ? all : (r1 = r, RESERVED_RUNTIME_GLOBALS.has(r1) || customRuntimeGlobals.add(r), originalAdd(r));
|
10872
|
+
};
|
10873
|
+
for (let r of (all.add = add.bind(add), set))queried.for(r).call(chunk, all);
|
10874
|
+
for (let r of customRuntimeGlobals)queried.for(r).call(chunk, all);
|
10875
|
+
return {
|
10876
|
+
allRuntimeRequirements: __to_binding_runtime_globals(all)
|
10877
|
+
};
|
10878
|
+
};
|
10879
|
+
}),
|
10880
|
+
registerCompilationRuntimeModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationRuntimeModule, function() {
|
10881
|
+
return getCompiler1().__internal__get_compilation().hooks.runtimeModule;
|
10882
|
+
}, function(queried) {
|
10883
|
+
return function({ module, chunk }) {
|
10884
|
+
let originSource = module.source?.source;
|
10885
|
+
queried.call(module, chunk);
|
10886
|
+
let newSource = module.source?.source;
|
10887
|
+
if (newSource && newSource !== originSource) return module;
|
10888
|
+
};
|
10889
|
+
}),
|
10890
|
+
registerCompilationBuildModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationBuildModule, function() {
|
10891
|
+
return getCompiler1().__internal__get_compilation().hooks.buildModule;
|
10892
|
+
}, function(queried) {
|
10893
|
+
return function(module) {
|
10894
|
+
return queried.call(module);
|
10895
|
+
};
|
10896
|
+
}),
|
10897
|
+
registerCompilationStillValidModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationStillValidModule, function() {
|
10898
|
+
return getCompiler1().__internal__get_compilation().hooks.stillValidModule;
|
10899
|
+
}, function(queried) {
|
10900
|
+
return function(module) {
|
10901
|
+
return queried.call(module);
|
10902
|
+
};
|
10903
|
+
}),
|
10904
|
+
registerCompilationSucceedModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationSucceedModule, function() {
|
10905
|
+
return getCompiler1().__internal__get_compilation().hooks.succeedModule;
|
10906
|
+
}, function(queried) {
|
10907
|
+
return function(module) {
|
10908
|
+
return queried.call(module);
|
10909
|
+
};
|
10910
|
+
}),
|
10911
|
+
registerCompilationExecuteModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationExecuteModule, function() {
|
10912
|
+
return getCompiler1().__internal__get_compilation().hooks.executeModule;
|
10913
|
+
}, function(queried) {
|
10914
|
+
return function({ entry, id, codegenResults, runtimeModules }) {
|
10915
|
+
try {
|
10916
|
+
let __nested_webpack_require_4786_4805__ = (id)=>{
|
10917
|
+
let cached = moduleCache[id];
|
10918
|
+
if (void 0 !== cached) {
|
10919
|
+
if (cached.error) throw cached.error;
|
10920
|
+
return cached.exports;
|
10921
|
+
}
|
10922
|
+
let execOptions = {
|
10923
|
+
id,
|
10924
|
+
module: {
|
10925
|
+
id,
|
10926
|
+
exports: {},
|
10927
|
+
loaded: !1,
|
10928
|
+
error: void 0
|
10929
|
+
},
|
10930
|
+
require: __nested_webpack_require_4786_4805__
|
10931
|
+
};
|
10932
|
+
for (let handler of interceptModuleExecution)handler(execOptions);
|
10933
|
+
let result = codegenResults.map[id]["build time"], moduleObject = execOptions.module;
|
10934
|
+
return id && (moduleCache[id] = moduleObject), ((fn, hook)=>{
|
10935
|
+
try {
|
10936
|
+
fn();
|
10937
|
+
} catch (err) {
|
10938
|
+
if (err instanceof WebpackError) throw err;
|
10939
|
+
throw new HookWebpackError(err, hook);
|
10940
|
+
}
|
10941
|
+
})(()=>queried.call({
|
10942
|
+
codeGenerationResult: new CodeGenerationResult(result),
|
10943
|
+
moduleObject
|
10944
|
+
}, {
|
10945
|
+
__webpack_require__: __nested_webpack_require_4786_4805__
|
10946
|
+
}), "Compilation.hooks.executeModule"), moduleObject.loaded = !0, moduleObject.exports;
|
10947
|
+
}, moduleCache = __nested_webpack_require_4786_4805__[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {}, interceptModuleExecution = __nested_webpack_require_4786_4805__[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
|
10948
|
+
for (let runtimeModule of runtimeModules)__nested_webpack_require_4786_4805__(runtimeModule);
|
10949
|
+
let executeResult = __nested_webpack_require_4786_4805__(entry);
|
10950
|
+
getCompiler1().__internal__get_module_execution_results_map().set(id, executeResult);
|
10951
|
+
} catch (e) {
|
10952
|
+
throw getCompiler1().__internal__get_module_execution_results_map().set(id, e), e;
|
10953
|
+
}
|
10954
|
+
};
|
10955
|
+
}),
|
10956
|
+
registerCompilationFinishModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationFinishModules, function() {
|
10957
|
+
return getCompiler1().__internal__get_compilation().hooks.finishModules;
|
10958
|
+
}, function(queried) {
|
10959
|
+
return async function() {
|
10960
|
+
return await queried.promise(getCompiler1().__internal__get_compilation().modules);
|
10961
|
+
};
|
10962
|
+
}),
|
10963
|
+
registerCompilationOptimizeModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeModules, function() {
|
10964
|
+
return getCompiler1().__internal__get_compilation().hooks.optimizeModules;
|
10965
|
+
}, function(queried) {
|
10966
|
+
return function() {
|
10967
|
+
return queried.call(getCompiler1().__internal__get_compilation().modules.values());
|
10968
|
+
};
|
10969
|
+
}),
|
10970
|
+
registerCompilationAfterOptimizeModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterOptimizeModules, function() {
|
10971
|
+
return getCompiler1().__internal__get_compilation().hooks.afterOptimizeModules;
|
10972
|
+
}, function(queried) {
|
10973
|
+
return function() {
|
10974
|
+
queried.call(getCompiler1().__internal__get_compilation().modules.values());
|
10975
|
+
};
|
10976
|
+
}),
|
10977
|
+
registerCompilationOptimizeTreeTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeTree, function() {
|
10978
|
+
return getCompiler1().__internal__get_compilation().hooks.optimizeTree;
|
10979
|
+
}, function(queried) {
|
10980
|
+
return async function() {
|
10981
|
+
return await queried.promise(getCompiler1().__internal__get_compilation().chunks, getCompiler1().__internal__get_compilation().modules);
|
10982
|
+
};
|
10983
|
+
}),
|
10984
|
+
registerCompilationOptimizeChunkModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeChunkModules, function() {
|
10985
|
+
return getCompiler1().__internal__get_compilation().hooks.optimizeChunkModules;
|
10986
|
+
}, function(queried) {
|
10987
|
+
return async function() {
|
10988
|
+
return await queried.promise(getCompiler1().__internal__get_compilation().chunks, getCompiler1().__internal__get_compilation().modules);
|
10989
|
+
};
|
10990
|
+
}),
|
10991
|
+
registerCompilationChunkHashTaps: createTap1(binding_.RegisterJsTapKind.CompilationChunkHash, function() {
|
10992
|
+
return getCompiler1().__internal__get_compilation().hooks.chunkHash;
|
10993
|
+
}, function(queried) {
|
10994
|
+
return function(chunk) {
|
10995
|
+
let digestResult;
|
10996
|
+
if (!getCompiler1().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
|
10997
|
+
let hash = createHash(getCompiler1().options.output.hashFunction);
|
10998
|
+
return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler1().options.output.hashDigest ? hash.digest(getCompiler1().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
|
10999
|
+
};
|
11000
|
+
}),
|
11001
|
+
registerCompilationChunkAssetTaps: createTap1(binding_.RegisterJsTapKind.CompilationChunkAsset, function() {
|
11002
|
+
return getCompiler1().__internal__get_compilation().hooks.chunkAsset;
|
11003
|
+
}, function(queried) {
|
11004
|
+
return function({ chunk, filename }) {
|
11005
|
+
return queried.call(chunk, filename);
|
11006
|
+
};
|
11007
|
+
}),
|
11008
|
+
registerCompilationProcessAssetsTaps: createTap1(binding_.RegisterJsTapKind.CompilationProcessAssets, function() {
|
11009
|
+
return getCompiler1().__internal__get_compilation().hooks.processAssets;
|
11010
|
+
}, function(queried) {
|
11011
|
+
return async function() {
|
11012
|
+
return await queried.promise(getCompiler1().__internal__get_compilation().assets);
|
11013
|
+
};
|
11014
|
+
}),
|
11015
|
+
registerCompilationAfterProcessAssetsTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterProcessAssets, function() {
|
11016
|
+
return getCompiler1().__internal__get_compilation().hooks.afterProcessAssets;
|
11017
|
+
}, function(queried) {
|
11018
|
+
return function() {
|
11019
|
+
return queried.call(getCompiler1().__internal__get_compilation().assets);
|
11020
|
+
};
|
11021
|
+
}),
|
11022
|
+
registerCompilationSealTaps: createTap1(binding_.RegisterJsTapKind.CompilationSeal, function() {
|
11023
|
+
return getCompiler1().__internal__get_compilation().hooks.seal;
|
11024
|
+
}, function(queried) {
|
11025
|
+
return function() {
|
11026
|
+
return queried.call();
|
11027
|
+
};
|
11028
|
+
}),
|
11029
|
+
registerCompilationAfterSealTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterSeal, function() {
|
11030
|
+
return getCompiler1().__internal__get_compilation().hooks.afterSeal;
|
11031
|
+
}, function(queried) {
|
11032
|
+
return async function() {
|
11033
|
+
return await queried.promise();
|
11034
|
+
};
|
11035
|
+
})
|
11036
|
+
}),
|
11037
|
+
...(getCompiler2 = getCompiler7, createTap2 = createTap6, createMapTap1 = createMapTap2, {
|
11038
|
+
registerNormalModuleFactoryBeforeResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryBeforeResolve, function() {
|
11039
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
|
11040
|
+
}, function(queried) {
|
11041
|
+
return async function(resolveData) {
|
11042
|
+
let normalizedResolveData = {
|
11043
|
+
contextInfo: {
|
11044
|
+
issuer: resolveData.issuer,
|
11045
|
+
issuerLayer: resolveData.issuerLayer ?? null
|
11046
|
+
},
|
11047
|
+
request: resolveData.request,
|
11048
|
+
context: resolveData.context,
|
11049
|
+
fileDependencies: [],
|
11050
|
+
missingDependencies: [],
|
11051
|
+
contextDependencies: []
|
11052
|
+
}, ret = await queried.promise(normalizedResolveData);
|
11053
|
+
return resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, [
|
11054
|
+
ret,
|
11055
|
+
resolveData
|
11056
|
+
];
|
11057
|
+
};
|
11058
|
+
}),
|
11059
|
+
registerNormalModuleFactoryFactorizeTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryFactorize, function() {
|
11060
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
|
11061
|
+
}, function(queried) {
|
11062
|
+
return async function(resolveData) {
|
11063
|
+
let normalizedResolveData = {
|
11064
|
+
contextInfo: {
|
11065
|
+
issuer: resolveData.issuer,
|
11066
|
+
issuerLayer: resolveData.issuerLayer ?? null
|
11067
|
+
},
|
11068
|
+
request: resolveData.request,
|
11069
|
+
context: resolveData.context,
|
11070
|
+
fileDependencies: [],
|
11071
|
+
missingDependencies: [],
|
11072
|
+
contextDependencies: []
|
11073
|
+
};
|
11074
|
+
return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
|
11075
|
+
};
|
11076
|
+
}),
|
11077
|
+
registerNormalModuleFactoryResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryResolve, function() {
|
11078
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
|
11079
|
+
}, function(queried) {
|
11080
|
+
return async function(resolveData) {
|
11081
|
+
let normalizedResolveData = {
|
11082
|
+
contextInfo: {
|
11083
|
+
issuer: resolveData.issuer,
|
11084
|
+
issuerLayer: resolveData.issuerLayer ?? null
|
11085
|
+
},
|
11086
|
+
request: resolveData.request,
|
11087
|
+
context: resolveData.context,
|
11088
|
+
fileDependencies: [],
|
11089
|
+
missingDependencies: [],
|
11090
|
+
contextDependencies: []
|
11091
|
+
};
|
11092
|
+
return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
|
11093
|
+
};
|
11094
|
+
}),
|
11095
|
+
registerNormalModuleFactoryResolveForSchemeTaps: createMapTap1(binding_.RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
|
11096
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.resolveForScheme;
|
11097
|
+
}, function(queried) {
|
11098
|
+
return async function(args) {
|
11099
|
+
return [
|
11100
|
+
await queried.for(args.scheme).promise(args.resourceData),
|
11101
|
+
args.resourceData
|
11102
|
+
];
|
11103
|
+
};
|
11104
|
+
}),
|
11105
|
+
registerNormalModuleFactoryAfterResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryAfterResolve, function() {
|
11106
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
|
11107
|
+
}, function(queried) {
|
11108
|
+
return async function(arg) {
|
11109
|
+
let data = {
|
11110
|
+
contextInfo: {
|
11111
|
+
issuer: arg.issuer,
|
11112
|
+
issuerLayer: arg.issuerLayer ?? null
|
11113
|
+
},
|
11114
|
+
request: arg.request,
|
11115
|
+
context: arg.context,
|
11116
|
+
fileDependencies: arg.fileDependencies,
|
11117
|
+
missingDependencies: arg.missingDependencies,
|
11118
|
+
contextDependencies: arg.contextDependencies,
|
11119
|
+
createData: arg.createData
|
11120
|
+
};
|
11121
|
+
return [
|
11122
|
+
await queried.promise(data),
|
11123
|
+
data.createData
|
11124
|
+
];
|
11125
|
+
};
|
11126
|
+
}),
|
11127
|
+
registerNormalModuleFactoryCreateModuleTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryCreateModule, function() {
|
11128
|
+
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.createModule;
|
11129
|
+
}, function(queried) {
|
11130
|
+
return async function(args) {
|
11131
|
+
let data = {
|
11132
|
+
...args,
|
11133
|
+
settings: {}
|
11134
|
+
};
|
11135
|
+
await queried.promise(data, {});
|
11136
|
+
};
|
11137
|
+
})
|
11138
|
+
}),
|
11139
|
+
...(getCompiler3 = getCompiler7, {
|
11140
|
+
registerContextModuleFactoryBeforeResolveTaps: (createTap3 = createTap6)(binding_.RegisterJsTapKind.ContextModuleFactoryBeforeResolve, function() {
|
11141
|
+
return getCompiler3().__internal__get_compilation_params().contextModuleFactory.hooks.beforeResolve;
|
11142
|
+
}, function(queried) {
|
11143
|
+
return async function(bindingData) {
|
11144
|
+
let data = !!bindingData && ContextModuleFactoryBeforeResolveData.__from_binding(bindingData), result = await queried.promise(data);
|
11145
|
+
return !!result && ContextModuleFactoryBeforeResolveData.__to_binding(result);
|
11146
|
+
};
|
11147
|
+
}),
|
11148
|
+
registerContextModuleFactoryAfterResolveTaps: createTap3(binding_.RegisterJsTapKind.ContextModuleFactoryAfterResolve, function() {
|
11149
|
+
return getCompiler3().__internal__get_compilation_params().contextModuleFactory.hooks.afterResolve;
|
11150
|
+
}, function(queried) {
|
11151
|
+
return async function(bindingData) {
|
11152
|
+
let data = !!bindingData && ContextModuleFactoryAfterResolveData.__from_binding(bindingData), result = await queried.promise(data);
|
11153
|
+
return !!result && ContextModuleFactoryAfterResolveData.__to_binding(result);
|
11154
|
+
};
|
11155
|
+
})
|
11156
|
+
}),
|
11157
|
+
...(getCompiler4 = getCompiler7, {
|
11158
|
+
registerJavascriptModulesChunkHashTaps: createTap6(binding_.RegisterJsTapKind.JavascriptModulesChunkHash, function() {
|
11159
|
+
return JavascriptModulesPlugin.getCompilationHooks(getCompiler4().__internal__get_compilation()).chunkHash;
|
11160
|
+
}, function(queried) {
|
11161
|
+
return function(chunk) {
|
11162
|
+
let digestResult;
|
11163
|
+
if (!getCompiler4().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
|
11164
|
+
let hash = createHash(getCompiler4().options.output.hashFunction);
|
11165
|
+
return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler4().options.output.hashDigest ? hash.digest(getCompiler4().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
|
11166
|
+
};
|
11167
|
+
})
|
11168
|
+
}),
|
11169
|
+
...((getCompiler, createTap, createMapTap)=>{
|
11170
|
+
let getOptions = (uid)=>((compilation, uid)=>{
|
11171
|
+
if (!(compilation instanceof Compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
|
11172
|
+
return compilationOptionsMap.get(compilation)?.[uid];
|
11173
|
+
})(getCompiler().__internal__get_compilation(), uid);
|
11174
|
+
return {
|
11175
|
+
registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration, function() {
|
11176
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeAssetTagGeneration;
|
11177
|
+
}, function(queried) {
|
11178
|
+
return async function(data) {
|
11179
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11180
|
+
...data,
|
11181
|
+
plugin: {
|
11182
|
+
options: getOptions(uid)
|
11183
|
+
}
|
11184
|
+
});
|
11185
|
+
return res.compilationId = compilationId, res.uid = uid, res;
|
11186
|
+
};
|
11187
|
+
}),
|
11188
|
+
registerHtmlPluginAlterAssetTagsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTags, function() {
|
11189
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTags;
|
11190
|
+
}, function(queried) {
|
11191
|
+
return async function(data) {
|
11192
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11193
|
+
...data,
|
11194
|
+
plugin: {
|
11195
|
+
options: getOptions(uid)
|
11196
|
+
}
|
11197
|
+
});
|
11198
|
+
return res.compilationId = compilationId, res.uid = uid, res;
|
11199
|
+
};
|
11200
|
+
}),
|
11201
|
+
registerHtmlPluginAlterAssetTagGroupsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups, function() {
|
11202
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTagGroups;
|
11203
|
+
}, function(queried) {
|
11204
|
+
return async function(data) {
|
11205
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11206
|
+
...data,
|
11207
|
+
plugin: {
|
11208
|
+
options: getOptions(uid)
|
11209
|
+
}
|
11210
|
+
});
|
11211
|
+
return res.compilationId = compilationId, res.uid = uid, res;
|
11212
|
+
};
|
11213
|
+
}),
|
11214
|
+
registerHtmlPluginAfterTemplateExecutionTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterTemplateExecution, function() {
|
11215
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterTemplateExecution;
|
11216
|
+
}, function(queried) {
|
11217
|
+
return async function(data) {
|
11218
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11219
|
+
...data,
|
11220
|
+
plugin: {
|
11221
|
+
options: getOptions(uid)
|
11222
|
+
}
|
11223
|
+
});
|
11224
|
+
return res.compilationId = compilationId, res;
|
11225
|
+
};
|
11226
|
+
}),
|
11227
|
+
registerHtmlPluginBeforeEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeEmit, function() {
|
11228
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeEmit;
|
11229
|
+
}, function(queried) {
|
11230
|
+
return async function(data) {
|
11231
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11232
|
+
...data,
|
11233
|
+
plugin: {
|
11234
|
+
options: getOptions(uid)
|
11235
|
+
}
|
11236
|
+
});
|
11237
|
+
return res.compilationId = compilationId, res.uid = uid, res;
|
11238
|
+
};
|
11239
|
+
}),
|
11240
|
+
registerHtmlPluginAfterEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterEmit, function() {
|
11241
|
+
return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterEmit;
|
11242
|
+
}, function(queried) {
|
11243
|
+
return async function(data) {
|
11244
|
+
let { compilationId, uid } = data, res = await queried.promise({
|
11245
|
+
...data,
|
11246
|
+
plugin: {
|
11247
|
+
options: getOptions(uid)
|
11248
|
+
}
|
11249
|
+
});
|
11250
|
+
return res.compilationId = compilationId, res.uid = uid, res;
|
11251
|
+
};
|
11252
|
+
})
|
11253
|
+
};
|
11254
|
+
})(getCompiler7, createTap6, 0),
|
11255
|
+
...(getCompiler5 = getCompiler7, {
|
11256
|
+
registerRuntimePluginCreateScriptTaps: (createTap4 = createTap6)(binding_.RegisterJsTapKind.RuntimePluginCreateScript, function() {
|
11257
|
+
return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).createScript;
|
11258
|
+
}, function(queried) {
|
11259
|
+
return function(data) {
|
11260
|
+
return queried.call(data.code, data.chunk);
|
11261
|
+
};
|
11262
|
+
}),
|
11263
|
+
registerRuntimePluginLinkPreloadTaps: createTap4(binding_.RegisterJsTapKind.RuntimePluginLinkPreload, function() {
|
11264
|
+
return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).linkPreload;
|
11265
|
+
}, function(queried) {
|
11266
|
+
return function(data) {
|
11267
|
+
return queried.call(data.code, data.chunk);
|
11268
|
+
};
|
11269
|
+
}),
|
11270
|
+
registerRuntimePluginLinkPrefetchTaps: createTap4(binding_.RegisterJsTapKind.RuntimePluginLinkPrefetch, function() {
|
11271
|
+
return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).linkPrefetch;
|
11272
|
+
}, function(queried) {
|
11273
|
+
return function(data) {
|
11274
|
+
return queried.call(data.code, data.chunk);
|
11275
|
+
};
|
11276
|
+
})
|
11277
|
+
}),
|
11278
|
+
...(getCompiler6 = getCompiler7, {
|
11279
|
+
registerRsdoctorPluginModuleGraphTaps: (createTap5 = createTap6)(binding_.RegisterJsTapKind.RsdoctorPluginModuleGraph, function() {
|
11280
|
+
return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleGraph;
|
11281
|
+
}, function(queried) {
|
11282
|
+
return async function(data) {
|
11283
|
+
return await queried.promise(data);
|
11284
|
+
};
|
11285
|
+
}),
|
11286
|
+
registerRsdoctorPluginChunkGraphTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginChunkGraph, function() {
|
11287
|
+
return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).chunkGraph;
|
11288
|
+
}, function(queried) {
|
11289
|
+
return async function(data) {
|
11290
|
+
return await queried.promise(data);
|
11291
|
+
};
|
11292
|
+
}),
|
11293
|
+
registerRsdoctorPluginModuleIdsTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginModuleIds, function() {
|
11294
|
+
return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleIds;
|
11295
|
+
}, function(queried) {
|
11296
|
+
return async function(data) {
|
11297
|
+
return await queried.promise(data);
|
11298
|
+
};
|
11299
|
+
}),
|
11300
|
+
registerRsdoctorPluginModuleSourcesTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginModuleSources, function() {
|
11301
|
+
return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleSources;
|
11302
|
+
}, function(queried) {
|
11303
|
+
return async function(data) {
|
11304
|
+
return await queried.promise(data);
|
11305
|
+
};
|
11306
|
+
}),
|
11307
|
+
registerRsdoctorPluginAssetsTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginAssets, function() {
|
11308
|
+
return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).assets;
|
11309
|
+
}, function(queried) {
|
11310
|
+
return async function(data) {
|
11311
|
+
return await queried.promise(data);
|
11312
|
+
};
|
11313
|
+
})
|
11314
|
+
})
|
11380
11315
|
};
|
11381
11316
|
}
|
11382
11317
|
#updateNonSkippableRegisters() {
|
@@ -11502,7 +11437,7 @@ Help:
|
|
11502
11437
|
obj.children = this.stats.map((stat, idx)=>{
|
11503
11438
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
11504
11439
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
11505
|
-
}), childOptions.version && (obj.rspackVersion = "1.4.7
|
11440
|
+
}), childOptions.version && (obj.rspackVersion = "1.4.7", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
11506
11441
|
let mapError = (j, obj)=>({
|
11507
11442
|
...obj,
|
11508
11443
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
@@ -11536,24 +11471,22 @@ Help:
|
|
11536
11471
|
func = asyncLib_noop, fn(err);
|
11537
11472
|
};
|
11538
11473
|
}
|
11539
|
-
let
|
11540
|
-
|
11541
|
-
|
11542
|
-
|
11543
|
-
|
11544
|
-
|
11545
|
-
|
11474
|
+
let asyncLib_each = function(collection, iterator, originalCallback) {
|
11475
|
+
let callback = once(originalCallback), size = 0, completed = 0;
|
11476
|
+
if (Array.isArray(collection)) {
|
11477
|
+
size = collection.length;
|
11478
|
+
var array = collection, iterator1 = iterator, callback1 = (err)=>{
|
11479
|
+
err ? (callback = once(callback))(err) : ++completed === size && callback(null);
|
11480
|
+
};
|
11481
|
+
let index = -1;
|
11482
|
+
for(; ++index < array.length;)iterator1(array[index], function(func) {
|
11483
|
+
return (err)=>{
|
11484
|
+
let fn = func;
|
11485
|
+
func = throwError, fn(err);
|
11546
11486
|
};
|
11547
|
-
|
11548
|
-
for(; ++index < array.length;)iterator1(array[index], function(func) {
|
11549
|
-
return (err)=>{
|
11550
|
-
let fn = func;
|
11551
|
-
func = throwError, fn(err);
|
11552
|
-
};
|
11553
|
-
}(callback1));
|
11554
|
-
}
|
11555
|
-
size || callback(null);
|
11487
|
+
}(callback1));
|
11556
11488
|
}
|
11489
|
+
size || callback(null);
|
11557
11490
|
}, MultiWatching = class {
|
11558
11491
|
watchings;
|
11559
11492
|
compiler;
|
@@ -11561,15 +11494,15 @@ Help:
|
|
11561
11494
|
this.watchings = watchings, this.compiler = compiler;
|
11562
11495
|
}
|
11563
11496
|
invalidate(callback) {
|
11564
|
-
if (callback)
|
11497
|
+
if (callback) asyncLib_each(this.watchings, (watching, callback)=>watching.invalidate(callback), callback);
|
11565
11498
|
else for (let watching of this.watchings)watching.invalidate();
|
11566
11499
|
}
|
11567
11500
|
invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback) {
|
11568
|
-
if (callback)
|
11501
|
+
if (callback) asyncLib_each(this.watchings, (watching, callback)=>watching.invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback), callback);
|
11569
11502
|
else for (let watching of this.watchings)watching.invalidateWithChangesAndRemovals(changedFiles, removedFiles);
|
11570
11503
|
}
|
11571
11504
|
close(callback) {
|
11572
|
-
|
11505
|
+
asyncLib_each(this.watchings, (watching, finishedCallback)=>{
|
11573
11506
|
watching.close(finishedCallback);
|
11574
11507
|
}, (err)=>{
|
11575
11508
|
this.compiler.hooks.watchClose.call(), "function" == typeof callback && (this.compiler.running = !1, callback(err));
|
@@ -11642,7 +11575,7 @@ Help:
|
|
11642
11575
|
shutdown: new lite_tapable_namespaceObject.MultiHook(normalizedCompilers.map((c)=>c.hooks.shutdown)),
|
11643
11576
|
infrastructureLog: new lite_tapable_namespaceObject.MultiHook(normalizedCompilers.map((c)=>c.hooks.infrastructureLog))
|
11644
11577
|
}, this.compilers = normalizedCompilers, this._options = {
|
11645
|
-
parallelism: options?.parallelism ||
|
11578
|
+
parallelism: options?.parallelism || 1 / 0
|
11646
11579
|
}, this.dependencies = new WeakMap(), this.running = !1;
|
11647
11580
|
let compilerStats = this.compilers.map(()=>null), doneCompilers = 0;
|
11648
11581
|
for(let index = 0; index < this.compilers.length; index++){
|
@@ -11743,7 +11676,7 @@ Help:
|
|
11743
11676
|
for (let node of nodes)0 === node.parents.length && (node.state = "queued", queue.enqueue(node));
|
11744
11677
|
let errored = !1, running = 0, parallelism = this._options.parallelism, nodeDone = (node, err, stats)=>{
|
11745
11678
|
if (!errored) {
|
11746
|
-
if (err) return errored = !0,
|
11679
|
+
if (err) return errored = !0, asyncLib_each(nodes, (node, callback)=>{
|
11747
11680
|
node.compiler.watching ? node.compiler.watching.close(callback) : callback();
|
11748
11681
|
}, ()=>callback(err));
|
11749
11682
|
if (node.result = stats, running--, "running" === node.state) for (let child of (node.state = "done", node.children))"blocked" === child.state && queue.enqueue(child);
|
@@ -11754,11 +11687,12 @@ Help:
|
|
11754
11687
|
for (let child of ("done" === node.state ? node.state = "blocked" : "running" === node.state && (node.state = "running-outdated"), node.children))nodeInvalidFromParent(child);
|
11755
11688
|
}, nodeInvalid = (node)=>{
|
11756
11689
|
for (let child of ("done" === node.state ? node.state = "pending" : "running" === node.state && (node.state = "running-outdated"), node.children))nodeInvalidFromParent(child);
|
11757
|
-
}, nodeChange = (node)=>{
|
11758
|
-
nodeInvalid(node), "pending" === node.state && (node.state = "blocked"), "blocked" === node.state && (queue.enqueue(node), processQueue());
|
11759
11690
|
}, setupResults = [];
|
11760
11691
|
nodes.forEach((node, i)=>{
|
11761
|
-
setupResults.push(node.setupResult = setup(node.compiler, i, nodeDone.bind(null, node), ()=>"starting" !== node.state && "running" !== node.state, ()=>
|
11692
|
+
setupResults.push(node.setupResult = setup(node.compiler, i, nodeDone.bind(null, node), ()=>"starting" !== node.state && "running" !== node.state, ()=>{
|
11693
|
+
var node1;
|
11694
|
+
nodeInvalid(node1 = node), "pending" === node1.state && (node1.state = "blocked"), "blocked" === node1.state && (queue.enqueue(node1), processQueue());
|
11695
|
+
}, ()=>nodeInvalid(node)));
|
11762
11696
|
});
|
11763
11697
|
let processing = !0, processQueue = ()=>{
|
11764
11698
|
processing || (processing = !0, process.nextTick(processQueueWorker));
|
@@ -11801,7 +11735,7 @@ Help:
|
|
11801
11735
|
for (let compiler of this.compilers)compiler.inputFileSystem?.purge?.();
|
11802
11736
|
}
|
11803
11737
|
close(callback) {
|
11804
|
-
|
11738
|
+
asyncLib_each(this.compilers, (compiler, cb)=>{
|
11805
11739
|
compiler.close(cb);
|
11806
11740
|
}, callback);
|
11807
11741
|
}
|
@@ -11868,17 +11802,6 @@ Help:
|
|
11868
11802
|
let count = 0;
|
11869
11803
|
for (let child of children)child.children || child.filteredChildren ? (child.children && (count += getTotalItems(child.children)), child.filteredChildren && (count += child.filteredChildren)) : count++;
|
11870
11804
|
return count;
|
11871
|
-
}, collapse = (children)=>{
|
11872
|
-
let newChildren = [];
|
11873
|
-
for (let child of children)if (child.children) {
|
11874
|
-
let filteredChildren = child.filteredChildren || 0;
|
11875
|
-
filteredChildren += getTotalItems(child.children), newChildren.push({
|
11876
|
-
...child,
|
11877
|
-
children: void 0,
|
11878
|
-
filteredChildren
|
11879
|
-
});
|
11880
|
-
} else newChildren.push(child);
|
11881
|
-
return newChildren;
|
11882
11805
|
}, getTotalSize = (children)=>{
|
11883
11806
|
let size = 0;
|
11884
11807
|
for (let child of children)size += getItemSize(child);
|
@@ -11922,7 +11845,18 @@ Help:
|
|
11922
11845
|
}
|
11923
11846
|
}
|
11924
11847
|
children = groups.concat(items);
|
11925
|
-
} else limit === max ? (children =
|
11848
|
+
} else limit === max ? (children = ((children)=>{
|
11849
|
+
let newChildren = [];
|
11850
|
+
for (let child of children)if (child.children) {
|
11851
|
+
let filteredChildren = child.filteredChildren || 0;
|
11852
|
+
filteredChildren += getTotalItems(child.children), newChildren.push({
|
11853
|
+
...child,
|
11854
|
+
children: void 0,
|
11855
|
+
filteredChildren
|
11856
|
+
});
|
11857
|
+
} else newChildren.push(child);
|
11858
|
+
return newChildren;
|
11859
|
+
})(groups), filteredChildren = items.length) : filteredChildren = getTotalItems(itemsAndGroups);
|
11926
11860
|
}
|
11927
11861
|
return {
|
11928
11862
|
children,
|
@@ -11932,10 +11866,11 @@ Help:
|
|
11932
11866
|
let count = getItems(compilation, "").length;
|
11933
11867
|
for (let child of compilation.children)count += countWithChildren(child, (c, type)=>getItems(c, `.children[].compilation${type}`));
|
11934
11868
|
return count;
|
11935
|
-
},
|
11869
|
+
}, sortByField = (field)=>{
|
11870
|
+
var field1;
|
11936
11871
|
if (!field) return (_a, _b)=>0;
|
11937
|
-
let fieldKey =
|
11938
|
-
if (!
|
11872
|
+
let fieldKey = "!" === (field1 = field)[0] ? field1.slice(1) : field1, sortFn = compareSelect((m)=>m[fieldKey], compareIds);
|
11873
|
+
if ("!" === field[0]) {
|
11939
11874
|
let oldSortFn = sortFn;
|
11940
11875
|
sortFn = (a, b)=>oldSortFn(b, a);
|
11941
11876
|
}
|
@@ -12402,7 +12337,7 @@ Help:
|
|
12402
12337
|
object.hash = context.getStatsCompilation(compilation).hash;
|
12403
12338
|
},
|
12404
12339
|
version: (object)=>{
|
12405
|
-
object.version = "5.75.0", object.rspackVersion = "1.4.7
|
12340
|
+
object.version = "5.75.0", object.rspackVersion = "1.4.7";
|
12406
12341
|
},
|
12407
12342
|
env: (object, _compilation, _context, { _env })=>{
|
12408
12343
|
object.env = _env;
|
@@ -12442,7 +12377,7 @@ Help:
|
|
12442
12377
|
object.assetsByChunkName = assetsByChunkName.reduce((acc, cur)=>(acc[cur.name] = cur.files, acc), {});
|
12443
12378
|
let limited = spaceLimited(factory.create(`${type}.assets`, Array.from(assets), {
|
12444
12379
|
...context
|
12445
|
-
}), options.assetsSpace ??
|
12380
|
+
}), options.assetsSpace ?? 1 / 0);
|
12446
12381
|
object.assets = limited.children, object.filteredAssets = limited.filteredChildren;
|
12447
12382
|
},
|
12448
12383
|
chunks: (object, compilation, context, options, factory)=>{
|
@@ -12734,12 +12669,12 @@ Help:
|
|
12734
12669
|
orphanModules: !0,
|
12735
12670
|
runtimeModules: !0,
|
12736
12671
|
excludeModules: !1,
|
12737
|
-
errorsSpace:
|
12738
|
-
warningsSpace:
|
12739
|
-
modulesSpace:
|
12740
|
-
chunkModulesSpace:
|
12741
|
-
assetsSpace:
|
12742
|
-
reasonsSpace:
|
12672
|
+
errorsSpace: 1 / 0,
|
12673
|
+
warningsSpace: 1 / 0,
|
12674
|
+
modulesSpace: 1 / 0,
|
12675
|
+
chunkModulesSpace: 1 / 0,
|
12676
|
+
assetsSpace: 1 / 0,
|
12677
|
+
reasonsSpace: 1 / 0,
|
12743
12678
|
children: !0
|
12744
12679
|
},
|
12745
12680
|
detailed: {
|
@@ -12788,7 +12723,7 @@ Help:
|
|
12788
12723
|
all: !1,
|
12789
12724
|
errors: !0,
|
12790
12725
|
errorsCount: !0,
|
12791
|
-
errorsSpace:
|
12726
|
+
errorsSpace: 1 / 0,
|
12792
12727
|
moduleTrace: !0,
|
12793
12728
|
logging: "error"
|
12794
12729
|
},
|
@@ -12796,10 +12731,10 @@ Help:
|
|
12796
12731
|
all: !1,
|
12797
12732
|
errors: !0,
|
12798
12733
|
errorsCount: !0,
|
12799
|
-
errorsSpace:
|
12734
|
+
errorsSpace: 1 / 0,
|
12800
12735
|
warnings: !0,
|
12801
12736
|
warningsCount: !0,
|
12802
|
-
warningsSpace:
|
12737
|
+
warningsSpace: 1 / 0,
|
12803
12738
|
logging: "warn"
|
12804
12739
|
},
|
12805
12740
|
summary: {
|
@@ -12823,7 +12758,7 @@ Help:
|
|
12823
12758
|
chunkGroups: OFF_FOR_TO_STRING,
|
12824
12759
|
chunkGroupAuxiliary: OFF_FOR_TO_STRING,
|
12825
12760
|
chunkGroupChildren: OFF_FOR_TO_STRING,
|
12826
|
-
chunkGroupMaxAssets: (o, { forToString })=>forToString ? 5 :
|
12761
|
+
chunkGroupMaxAssets: (o, { forToString })=>forToString ? 5 : 1 / 0,
|
12827
12762
|
chunks: OFF_FOR_TO_STRING,
|
12828
12763
|
chunkRelations: OFF_FOR_TO_STRING,
|
12829
12764
|
chunkModules: ({ all, modules })=>!1 !== all && (!0 === all || !modules),
|
@@ -12838,16 +12773,16 @@ Help:
|
|
12838
12773
|
groupModulesByAttributes: ON_FOR_TO_STRING,
|
12839
12774
|
groupModulesByPath: ON_FOR_TO_STRING,
|
12840
12775
|
groupModulesByExtension: ON_FOR_TO_STRING,
|
12841
|
-
modulesSpace: (o, { forToString })=>forToString ? 15 :
|
12842
|
-
chunkModulesSpace: (o, { forToString })=>forToString ? 10 :
|
12843
|
-
nestedModulesSpace: (o, { forToString })=>forToString ? 10 :
|
12776
|
+
modulesSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
|
12777
|
+
chunkModulesSpace: (o, { forToString })=>forToString ? 10 : 1 / 0,
|
12778
|
+
nestedModulesSpace: (o, { forToString })=>forToString ? 10 : 1 / 0,
|
12844
12779
|
relatedAssets: OFF_FOR_TO_STRING,
|
12845
12780
|
groupAssetsByEmitStatus: ON_FOR_TO_STRING,
|
12846
12781
|
groupAssetsByInfo: ON_FOR_TO_STRING,
|
12847
12782
|
groupAssetsByPath: ON_FOR_TO_STRING,
|
12848
12783
|
groupAssetsByExtension: ON_FOR_TO_STRING,
|
12849
12784
|
groupAssetsByChunk: ON_FOR_TO_STRING,
|
12850
|
-
assetsSpace: (o, { forToString })=>forToString ? 15 :
|
12785
|
+
assetsSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
|
12851
12786
|
orphanModules: OFF_FOR_TO_STRING,
|
12852
12787
|
runtimeModules: ({ all, runtime }, { forToString })=>void 0 !== runtime ? runtime : forToString ? !0 === all : !1 !== all,
|
12853
12788
|
cachedModules: ({ all, cached }, { forToString })=>void 0 !== cached ? cached : forToString ? !0 === all : !1 !== all,
|
@@ -12855,7 +12790,7 @@ Help:
|
|
12855
12790
|
depth: OFF_FOR_TO_STRING,
|
12856
12791
|
cachedAssets: OFF_FOR_TO_STRING,
|
12857
12792
|
reasons: OFF_FOR_TO_STRING,
|
12858
|
-
reasonsSpace: (o, { forToString })=>forToString ? 15 :
|
12793
|
+
reasonsSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
|
12859
12794
|
groupReasonsByOrigin: ON_FOR_TO_STRING,
|
12860
12795
|
usedExports: OFF_FOR_TO_STRING,
|
12861
12796
|
providedExports: OFF_FOR_TO_STRING,
|
@@ -12936,13 +12871,7 @@ Help:
|
|
12936
12871
|
if (!dataUrl) return resource;
|
12937
12872
|
let len = dataUrl[0].length + 16;
|
12938
12873
|
return resource.length < len ? resource : `${resource.slice(0, Math.min(resource.length - 2, len))}..`;
|
12939
|
-
},
|
12940
|
-
let matchResourceMatch = /^([^!]+)!=!/.exec(name), n = matchResourceMatch ? matchResourceMatch[0] + getResourceName(name.slice(matchResourceMatch[0].length)) : name, [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(n) || [];
|
12941
|
-
return [
|
12942
|
-
prefix,
|
12943
|
-
getResourceName(resource)
|
12944
|
-
];
|
12945
|
-
}, 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 = {
|
12874
|
+
}, 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 = {
|
12946
12875
|
"compilation.summary!": (_, { type, bold, green, red, yellow, formatDateTime, formatTime, compilation: { name, hash, rspackVersion, time, builtAt, errorsCount, warningsCount } })=>{
|
12947
12876
|
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";
|
12948
12877
|
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}`;
|
@@ -13003,9 +12932,18 @@ Help:
|
|
13003
12932
|
assetChunkName: (name)=>name,
|
13004
12933
|
assetChunkIdHint: (name)=>name,
|
13005
12934
|
"module.type": (type)=>"module" !== type ? type : void 0,
|
13006
|
-
"module.id": (id, { formatModuleId })=>
|
12935
|
+
"module.id": (id, { formatModuleId })=>{
|
12936
|
+
let id1;
|
12937
|
+
return "number" == typeof (id1 = id) || id1 ? formatModuleId(id) : void 0;
|
12938
|
+
},
|
13007
12939
|
"module.name": (name, { bold })=>{
|
13008
|
-
let [prefix, resource] =
|
12940
|
+
let [prefix, resource] = ((name)=>{
|
12941
|
+
let matchResourceMatch = /^([^!]+)!=!/.exec(name), n = matchResourceMatch ? matchResourceMatch[0] + getResourceName(name.slice(matchResourceMatch[0].length)) : name, [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(n) || [];
|
12942
|
+
return [
|
12943
|
+
prefix,
|
12944
|
+
getResourceName(resource)
|
12945
|
+
];
|
12946
|
+
})(name);
|
13009
12947
|
return `${prefix || ""}${bold(resource || "")}`;
|
13010
12948
|
},
|
13011
12949
|
"module.identifier": (identifier)=>void 0,
|
@@ -13050,7 +12988,10 @@ Help:
|
|
13050
12988
|
"moduleIssuer.profile.total": (value, { formatTime })=>formatTime(value),
|
13051
12989
|
"moduleReason.type": (type)=>type,
|
13052
12990
|
"moduleReason.userRequest": (userRequest, { cyan })=>cyan(getResourceName(userRequest)),
|
13053
|
-
"moduleReason.moduleId": (moduleId, { formatModuleId })=>
|
12991
|
+
"moduleReason.moduleId": (moduleId, { formatModuleId })=>{
|
12992
|
+
let id;
|
12993
|
+
return "number" == typeof (id = moduleId) || id ? formatModuleId(moduleId) : void 0;
|
12994
|
+
},
|
13054
12995
|
"moduleReason.module": (module, { magenta })=>magenta(module),
|
13055
12996
|
"moduleReason.loc": (loc)=>loc,
|
13056
12997
|
"moduleReason.explanation": (explanation, { cyan })=>cyan(explanation),
|
@@ -13102,7 +13043,10 @@ Help:
|
|
13102
13043
|
return items.sort((a, b)=>compareIds(a.type, b.type)), Array.isArray(childrenByOrder) ? void 0 : printer.print(context.type, items, context);
|
13103
13044
|
},
|
13104
13045
|
"chunk.childrenByOrder[].type": (type)=>`${type}:`,
|
13105
|
-
"chunk.childrenByOrder[].children[]": (id, { formatChunkId })=>
|
13046
|
+
"chunk.childrenByOrder[].children[]": (id, { formatChunkId })=>{
|
13047
|
+
let id1;
|
13048
|
+
return "number" == typeof (id1 = id) || id1 ? formatChunkId(id) : void 0;
|
13049
|
+
},
|
13106
13050
|
"chunk.entry": (entry, { formatFlag, yellow })=>entry ? yellow(formatFlag("entry")) : void 0,
|
13107
13051
|
"chunk.initial": (initial, { formatFlag, yellow })=>initial ? yellow(formatFlag("initial")) : void 0,
|
13108
13052
|
"chunk.rendered": (rendered, { formatFlag, green })=>rendered ? green(formatFlag("rendered")) : void 0,
|
@@ -13111,7 +13055,10 @@ Help:
|
|
13111
13055
|
"chunk.filteredModules": (filteredModules, { chunk: { modules } })=>filteredModules > 0 ? `${moreCount(modules, filteredModules)} chunk ${DefaultStatsPrinterPlugin_plural(filteredModules, "module", "modules")}` : void 0,
|
13112
13056
|
"chunk.separator!": ()=>"\n",
|
13113
13057
|
"chunkOrigin.request": (request)=>request,
|
13114
|
-
"chunkOrigin.moduleId": (moduleId, { formatModuleId })=>
|
13058
|
+
"chunkOrigin.moduleId": (moduleId, { formatModuleId })=>{
|
13059
|
+
let id;
|
13060
|
+
return "number" == typeof (id = moduleId) || id ? formatModuleId(moduleId) : void 0;
|
13061
|
+
},
|
13115
13062
|
"chunkOrigin.moduleName": (moduleName, { bold })=>bold(moduleName),
|
13116
13063
|
"chunkOrigin.loc": (loc)=>loc,
|
13117
13064
|
"error.file": (file, { bold })=>bold(file),
|
@@ -13988,7 +13935,80 @@ Help:
|
|
13988
13935
|
});
|
13989
13936
|
}
|
13990
13937
|
}
|
13991
|
-
var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.
|
13938
|
+
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);
|
13939
|
+
let stringToRegexp = (ignored)=>{
|
13940
|
+
if (0 === ignored.length) return;
|
13941
|
+
let { source } = __webpack_require__("glob-to-regexp")(ignored, {
|
13942
|
+
globstar: !0,
|
13943
|
+
extended: !0
|
13944
|
+
});
|
13945
|
+
return `${source.slice(0, -1)}(?:$|\\/)`;
|
13946
|
+
};
|
13947
|
+
class NativeWatchFileSystem {
|
13948
|
+
#inner;
|
13949
|
+
watch(files, directories, missing, _startTime, options, callback, callbackUndelayed) {
|
13950
|
+
if ((!files.added || "function" != typeof files.added[Symbol.iterator]) && (!files.removed || "function" != typeof files.removed[Symbol.iterator])) throw Error("Invalid arguments: 'files'");
|
13951
|
+
if ((!directories.added || "function" != typeof directories.added[Symbol.iterator]) && (!directories.removed || "function" != typeof directories.removed[Symbol.iterator])) throw Error("Invalid arguments: 'directories'");
|
13952
|
+
if ("function" != typeof callback) throw Error("Invalid arguments: 'callback'");
|
13953
|
+
if ("object" != typeof options) throw Error("Invalid arguments: 'options'");
|
13954
|
+
if ("function" != typeof callbackUndelayed && callbackUndelayed) throw Error("Invalid arguments: 'callbackUndelayed'");
|
13955
|
+
let nativeWatcher = this.getNativeWatcher(options);
|
13956
|
+
return nativeWatcher.watch([
|
13957
|
+
Array.from(files.added),
|
13958
|
+
Array.from(files.removed)
|
13959
|
+
], [
|
13960
|
+
Array.from(directories.added),
|
13961
|
+
Array.from(directories.removed)
|
13962
|
+
], [
|
13963
|
+
Array.from(missing.added),
|
13964
|
+
Array.from(missing.removed)
|
13965
|
+
], (err, result)=>{
|
13966
|
+
let { changedFiles, removedFiles } = result;
|
13967
|
+
callback(err, new Map(), new Map(), new Set(changedFiles), new Set(removedFiles));
|
13968
|
+
}, (fileName)=>{
|
13969
|
+
callbackUndelayed(fileName, Date.now());
|
13970
|
+
}), {
|
13971
|
+
close: ()=>{
|
13972
|
+
nativeWatcher.close();
|
13973
|
+
},
|
13974
|
+
pause: ()=>{
|
13975
|
+
nativeWatcher.pause();
|
13976
|
+
},
|
13977
|
+
getInfo: ()=>({
|
13978
|
+
changes: new Set(),
|
13979
|
+
removals: new Set(),
|
13980
|
+
fileTimeInfoEntries: new Map(),
|
13981
|
+
contextTimeInfoEntries: new Map()
|
13982
|
+
})
|
13983
|
+
};
|
13984
|
+
}
|
13985
|
+
getNativeWatcher(options) {
|
13986
|
+
if (this.#inner) return this.#inner;
|
13987
|
+
let nativeWatcherOptions = {
|
13988
|
+
followSymlinks: options.followSymlinks,
|
13989
|
+
aggregateTimeout: options.aggregateTimeout,
|
13990
|
+
pollInterval: "boolean" == typeof options.poll ? 0 : options.poll,
|
13991
|
+
ignored: ((ignored)=>{
|
13992
|
+
if (Array.isArray(ignored)) {
|
13993
|
+
let stringRegexps = ignored.map((i)=>stringToRegexp(i)).filter(Boolean);
|
13994
|
+
if (0 === stringRegexps.length) return ()=>!1;
|
13995
|
+
let regexp = new RegExp(stringRegexps.join("|"));
|
13996
|
+
return (item)=>regexp.test(item.replace(/\\/g, "/"));
|
13997
|
+
}
|
13998
|
+
if ("string" == typeof ignored) {
|
13999
|
+
let stringRegexp = stringToRegexp(ignored);
|
14000
|
+
if (!stringRegexp) return ()=>!1;
|
14001
|
+
let regexp = new RegExp(stringRegexp);
|
14002
|
+
return (item)=>regexp.test(item.replace(/\\/g, "/"));
|
14003
|
+
}
|
14004
|
+
if (ignored instanceof RegExp) return (item)=>ignored.test(item.replace(/\\/g, "/"));
|
14005
|
+
if ("function" == typeof ignored) return (item)=>ignored(item);
|
14006
|
+
if (ignored) throw Error(`Invalid option for 'ignored': ${ignored}`);
|
14007
|
+
})(options.ignored)
|
14008
|
+
}, nativeWatcher = new binding_.NativeWatcher(nativeWatcherOptions);
|
14009
|
+
return this.#inner = nativeWatcher, nativeWatcher;
|
14010
|
+
}
|
14011
|
+
}
|
13992
14012
|
let filterToFunction = (item)=>{
|
13993
14013
|
if ("string" == typeof item) {
|
13994
14014
|
let regExp = RegExp(`[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)`);
|
@@ -14004,82 +14024,6 @@ Help:
|
|
14004
14024
|
log: 2,
|
14005
14025
|
true: 2,
|
14006
14026
|
verbose: 1
|
14007
|
-
}, createConsoleLogger = ({ level = "info", debug = !1, console: console1 })=>{
|
14008
|
-
let debugFilters = "boolean" == typeof debug ? [
|
14009
|
-
()=>debug
|
14010
|
-
] : [].concat(debug).map(filterToFunction), loglevel = LogLevel[`${level}`] || 0;
|
14011
|
-
return (name, type, args)=>{
|
14012
|
-
let labeledArgs = ()=>Array.isArray(args) ? args.length > 0 && "string" == typeof args[0] ? [
|
14013
|
-
`[${name}] ${args[0]}`,
|
14014
|
-
...args.slice(1)
|
14015
|
-
] : [
|
14016
|
-
`[${name}]`,
|
14017
|
-
...args
|
14018
|
-
] : [], debug = debugFilters.some((f)=>f(name));
|
14019
|
-
switch(type){
|
14020
|
-
case LogType.debug:
|
14021
|
-
if (!debug) return;
|
14022
|
-
"function" == typeof console1.debug ? console1.debug(...labeledArgs()) : console1.log(...labeledArgs());
|
14023
|
-
break;
|
14024
|
-
case LogType.log:
|
14025
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14026
|
-
console1.log(...labeledArgs());
|
14027
|
-
break;
|
14028
|
-
case LogType.info:
|
14029
|
-
if (!debug && loglevel > LogLevel.info) return;
|
14030
|
-
console1.info(...labeledArgs());
|
14031
|
-
break;
|
14032
|
-
case LogType.warn:
|
14033
|
-
if (!debug && loglevel > LogLevel.warn) return;
|
14034
|
-
console1.warn(...labeledArgs());
|
14035
|
-
break;
|
14036
|
-
case LogType.error:
|
14037
|
-
if (!debug && loglevel > LogLevel.error) return;
|
14038
|
-
console1.error(...labeledArgs());
|
14039
|
-
break;
|
14040
|
-
case LogType.trace:
|
14041
|
-
if (!debug) return;
|
14042
|
-
console1.trace();
|
14043
|
-
break;
|
14044
|
-
case LogType.groupCollapsed:
|
14045
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14046
|
-
if (!debug && loglevel > LogLevel.verbose) {
|
14047
|
-
"function" == typeof console1.groupCollapsed ? console1.groupCollapsed(...labeledArgs()) : console1.log(...labeledArgs());
|
14048
|
-
break;
|
14049
|
-
}
|
14050
|
-
case LogType.group:
|
14051
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14052
|
-
"function" == typeof console1.group ? console1.group(...labeledArgs()) : console1.log(...labeledArgs());
|
14053
|
-
break;
|
14054
|
-
case LogType.groupEnd:
|
14055
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14056
|
-
"function" == typeof console1.groupEnd && console1.groupEnd();
|
14057
|
-
break;
|
14058
|
-
case LogType.time:
|
14059
|
-
{
|
14060
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14061
|
-
let ms = 1000 * args[1] + args[2] / 1000000, msg = `[${name}] ${args[0]}: ${ms} ms`;
|
14062
|
-
"function" == typeof console1.logTime ? console1.logTime(msg) : console1.log(msg);
|
14063
|
-
break;
|
14064
|
-
}
|
14065
|
-
case LogType.profile:
|
14066
|
-
"function" == typeof console1.profile && console1.profile(...labeledArgs());
|
14067
|
-
break;
|
14068
|
-
case LogType.profileEnd:
|
14069
|
-
"function" == typeof console1.profileEnd && console1.profileEnd(...labeledArgs());
|
14070
|
-
break;
|
14071
|
-
case LogType.clear:
|
14072
|
-
if (!debug && loglevel > LogLevel.log) return;
|
14073
|
-
"function" == typeof console1.clear && console1.clear();
|
14074
|
-
break;
|
14075
|
-
case LogType.status:
|
14076
|
-
if (!debug && loglevel > LogLevel.info) return;
|
14077
|
-
"function" == typeof console1.status ? 0 === args.length ? console1.status() : console1.status(...labeledArgs()) : 0 !== args.length && console1.info(...labeledArgs());
|
14078
|
-
break;
|
14079
|
-
default:
|
14080
|
-
throw Error(`Unexpected LogType ${type}`);
|
14081
|
-
}
|
14082
|
-
};
|
14083
14027
|
};
|
14084
14028
|
class NodeWatchFileSystem {
|
14085
14029
|
inputFileSystem;
|
@@ -14196,15 +14140,87 @@ Help:
|
|
14196
14140
|
}
|
14197
14141
|
apply(compiler) {
|
14198
14142
|
let { infrastructureLogging } = this.options;
|
14199
|
-
compiler.infrastructureLogger =
|
14143
|
+
compiler.infrastructureLogger = (({ level = "info", debug = !1, console: console1 })=>{
|
14144
|
+
let debugFilters = "boolean" == typeof debug ? [
|
14145
|
+
()=>debug
|
14146
|
+
] : [].concat(debug).map(filterToFunction), loglevel = LogLevel[`${level}`] || 0;
|
14147
|
+
return (name, type, args)=>{
|
14148
|
+
let labeledArgs = ()=>Array.isArray(args) ? args.length > 0 && "string" == typeof args[0] ? [
|
14149
|
+
`[${name}] ${args[0]}`,
|
14150
|
+
...args.slice(1)
|
14151
|
+
] : [
|
14152
|
+
`[${name}]`,
|
14153
|
+
...args
|
14154
|
+
] : [], debug = debugFilters.some((f)=>f(name));
|
14155
|
+
switch(type){
|
14156
|
+
case LogType.debug:
|
14157
|
+
if (!debug) return;
|
14158
|
+
"function" == typeof console1.debug ? console1.debug(...labeledArgs()) : console1.log(...labeledArgs());
|
14159
|
+
break;
|
14160
|
+
case LogType.log:
|
14161
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14162
|
+
console1.log(...labeledArgs());
|
14163
|
+
break;
|
14164
|
+
case LogType.info:
|
14165
|
+
if (!debug && loglevel > LogLevel.info) return;
|
14166
|
+
console1.info(...labeledArgs());
|
14167
|
+
break;
|
14168
|
+
case LogType.warn:
|
14169
|
+
if (!debug && loglevel > LogLevel.warn) return;
|
14170
|
+
console1.warn(...labeledArgs());
|
14171
|
+
break;
|
14172
|
+
case LogType.error:
|
14173
|
+
if (!debug && loglevel > LogLevel.error) return;
|
14174
|
+
console1.error(...labeledArgs());
|
14175
|
+
break;
|
14176
|
+
case LogType.trace:
|
14177
|
+
if (!debug) return;
|
14178
|
+
console1.trace();
|
14179
|
+
break;
|
14180
|
+
case LogType.groupCollapsed:
|
14181
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14182
|
+
if (!debug && loglevel > LogLevel.verbose) {
|
14183
|
+
"function" == typeof console1.groupCollapsed ? console1.groupCollapsed(...labeledArgs()) : console1.log(...labeledArgs());
|
14184
|
+
break;
|
14185
|
+
}
|
14186
|
+
case LogType.group:
|
14187
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14188
|
+
"function" == typeof console1.group ? console1.group(...labeledArgs()) : console1.log(...labeledArgs());
|
14189
|
+
break;
|
14190
|
+
case LogType.groupEnd:
|
14191
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14192
|
+
"function" == typeof console1.groupEnd && console1.groupEnd();
|
14193
|
+
break;
|
14194
|
+
case LogType.time:
|
14195
|
+
{
|
14196
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14197
|
+
let ms = 1000 * args[1] + args[2] / 1000000, msg = `[${name}] ${args[0]}: ${ms} ms`;
|
14198
|
+
"function" == typeof console1.logTime ? console1.logTime(msg) : console1.log(msg);
|
14199
|
+
break;
|
14200
|
+
}
|
14201
|
+
case LogType.profile:
|
14202
|
+
"function" == typeof console1.profile && console1.profile(...labeledArgs());
|
14203
|
+
break;
|
14204
|
+
case LogType.profileEnd:
|
14205
|
+
"function" == typeof console1.profileEnd && console1.profileEnd(...labeledArgs());
|
14206
|
+
break;
|
14207
|
+
case LogType.clear:
|
14208
|
+
if (!debug && loglevel > LogLevel.log) return;
|
14209
|
+
"function" == typeof console1.clear && console1.clear();
|
14210
|
+
break;
|
14211
|
+
case LogType.status:
|
14212
|
+
if (!debug && loglevel > LogLevel.info) return;
|
14213
|
+
"function" == typeof console1.status ? 0 === args.length ? console1.status() : console1.status(...labeledArgs()) : 0 !== args.length && console1.info(...labeledArgs());
|
14214
|
+
break;
|
14215
|
+
default:
|
14216
|
+
throw Error(`Unexpected LogType ${type}`);
|
14217
|
+
}
|
14218
|
+
};
|
14219
|
+
})({
|
14200
14220
|
level: infrastructureLogging.level || "info",
|
14201
14221
|
debug: infrastructureLogging.debug || !1,
|
14202
14222
|
console: infrastructureLogging.console || function({ colors, appendOnly, stream }) {
|
14203
|
-
let currentStatusMessage, hasStatusMessage = !1, currentIndent = "", currentCollapsed = 0,
|
14204
|
-
if ("" === str) return str;
|
14205
|
-
let prefixWithIndent = currentIndent + prefix;
|
14206
|
-
return colors ? prefixWithIndent + colorPrefix + str.replace(/\n/g, `${colorSuffix}\n${prefix}${colorPrefix}`) + colorSuffix : prefixWithIndent + str.replace(/\n/g, `\n${prefix}`);
|
14207
|
-
}, clearStatusMessage = ()=>{
|
14223
|
+
let currentStatusMessage, hasStatusMessage = !1, currentIndent = "", currentCollapsed = 0, clearStatusMessage = ()=>{
|
14208
14224
|
hasStatusMessage && (stream.write("\x1b[2K\r"), hasStatusMessage = !1);
|
14209
14225
|
}, writeStatusMessage = ()=>{
|
14210
14226
|
if (!currentStatusMessage) return;
|
@@ -14213,7 +14229,11 @@ Help:
|
|
14213
14229
|
}, writeColored = (prefix, colorPrefix, colorSuffix)=>(...args)=>{
|
14214
14230
|
if (currentCollapsed > 0) return;
|
14215
14231
|
clearStatusMessage();
|
14216
|
-
let str =
|
14232
|
+
let str = ((str, prefix, colorPrefix, colorSuffix)=>{
|
14233
|
+
if ("" === str) return str;
|
14234
|
+
let prefixWithIndent = currentIndent + prefix;
|
14235
|
+
return colors ? prefixWithIndent + colorPrefix + str.replace(/\n/g, `${colorSuffix}\n${prefix}${colorPrefix}`) + colorSuffix : prefixWithIndent + str.replace(/\n/g, `\n${prefix}`);
|
14236
|
+
})(external_node_util_namespaceObject.format(...args), prefix, colorPrefix, colorSuffix);
|
14217
14237
|
stream.write(`${str}\n`), writeStatusMessage();
|
14218
14238
|
}, writeGroupMessage = writeColored("<-> ", "\u001b[1m\u001b[36m", "\u001b[39m\u001b[22m"), writeGroupCollapsedMessage = writeColored("<+> ", "\u001b[1m\u001b[36m", "\u001b[39m\u001b[22m");
|
14219
14239
|
return {
|
@@ -14258,7 +14278,7 @@ Help:
|
|
14258
14278
|
})
|
14259
14279
|
});
|
14260
14280
|
let inputFileSystem = new (CachedInputFileSystem_default())(graceful_fs_index_js_default(), 60000);
|
14261
|
-
compiler.inputFileSystem = inputFileSystem, compiler.outputFileSystem = graceful_fs_index_js_default(), compiler.intermediateFileSystem = null, compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem), compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler)=>{
|
14281
|
+
compiler.inputFileSystem = inputFileSystem, compiler.outputFileSystem = graceful_fs_index_js_default(), compiler.intermediateFileSystem = null, compiler.options.experiments.nativeWatcher ? compiler.watchFileSystem = new NativeWatchFileSystem() : compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem), compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler)=>{
|
14262
14282
|
compiler.inputFileSystem === inputFileSystem && (compiler.fsStartTime = Date.now(), inputFileSystem.purge?.());
|
14263
14283
|
});
|
14264
14284
|
}
|
@@ -14649,7 +14669,6 @@ Help:
|
|
14649
14669
|
"node-commonjs",
|
14650
14670
|
"commonjs-import"
|
14651
14671
|
])), getRspackOptionsSchema = memoize(()=>{
|
14652
|
-
var params;
|
14653
14672
|
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), {
|
14654
14673
|
error: (issue)=>`The provided value ${JSON.stringify(issue.input)} must be an absolute path`
|
14655
14674
|
}), mode = schemas_enum([
|
@@ -15218,7 +15237,7 @@ Help:
|
|
15218
15237
|
]).or(_instanceof(RegExp)).or(anyFunction), optimizationSplitChunksSizes = numberOrInfinity.or(record(schemas_string(), numberOrInfinity)), sharedOptimizationSplitChunksCacheGroup = {
|
15219
15238
|
chunks: optimizationSplitChunksChunks,
|
15220
15239
|
defaultSizeTypes: schemas_array(schemas_string()),
|
15221
|
-
minChunks: schemas_number().min(1).or(literal(
|
15240
|
+
minChunks: schemas_number().min(1).or(literal(1 / 0)),
|
15222
15241
|
usedExports: schemas_boolean(),
|
15223
15242
|
name: optimizationSplitChunksName,
|
15224
15243
|
filename: filename,
|
@@ -15376,7 +15395,8 @@ Help:
|
|
15376
15395
|
useInputFileSystem: useInputFileSystem,
|
15377
15396
|
inlineConst: schemas_boolean(),
|
15378
15397
|
inlineEnum: schemas_boolean(),
|
15379
|
-
typeReexportsPresence: schemas_boolean()
|
15398
|
+
typeReexportsPresence: schemas_boolean(),
|
15399
|
+
nativeWatcher: schemas_boolean()
|
15380
15400
|
}).partial(), watch = schemas_boolean(), watchOptions = strictObject({
|
15381
15401
|
aggregateTimeout: numberOrInfinity,
|
15382
15402
|
followSymlinks: schemas_boolean(),
|
@@ -15433,7 +15453,7 @@ Help:
|
|
15433
15453
|
bail: bail,
|
15434
15454
|
performance: performance
|
15435
15455
|
}).partial().check((ctx)=>{
|
15436
|
-
let
|
15456
|
+
let config = ctx.value, library = config?.output?.library;
|
15437
15457
|
function checkExternalItem(externalItem, path) {
|
15438
15458
|
if ("object" == typeof externalItem && null !== externalItem) for (let [key, value] of Object.entries(externalItem)){
|
15439
15459
|
var externalItemValue, path1;
|
@@ -15455,25 +15475,25 @@ Help:
|
|
15455
15475
|
"externals"
|
15456
15476
|
]));
|
15457
15477
|
});
|
15458
|
-
}), ModuleFederationRuntimePlugin = base_create(binding_.BuiltinPluginName.ModuleFederationRuntimePlugin, ()=>{}),
|
15459
|
-
let object = (obj)=>{
|
15460
|
-
for (let [key, value] of Object.entries(obj))"string" == typeof value || Array.isArray(value) ? fn(key, normalizeSimple(value, key)) : fn(key, normalizeOptions(value, key));
|
15461
|
-
};
|
15462
|
-
if (options) if (Array.isArray(options)) {
|
15463
|
-
var items = options;
|
15464
|
-
for (let item of items)if ("string" == typeof item) fn(item, normalizeSimple(item, item));
|
15465
|
-
else if (item && "object" == typeof item) object(item);
|
15466
|
-
else throw Error("Unexpected options format");
|
15467
|
-
} else if ("object" == typeof options) object(options);
|
15468
|
-
else throw Error("Unexpected options format");
|
15469
|
-
}, parseOptions = (options, normalizeSimple, normalizeOptions)=>{
|
15478
|
+
}), ModuleFederationRuntimePlugin = base_create(binding_.BuiltinPluginName.ModuleFederationRuntimePlugin, ()=>{}), parseOptions = (options, normalizeSimple, normalizeOptions)=>{
|
15470
15479
|
let items = [];
|
15471
|
-
|
15480
|
+
var options1 = options, normalizeSimple1 = normalizeSimple, normalizeOptions1 = normalizeOptions, fn = (key, value)=>{
|
15472
15481
|
items.push([
|
15473
15482
|
key,
|
15474
15483
|
value
|
15475
15484
|
]);
|
15476
|
-
}
|
15485
|
+
};
|
15486
|
+
let object = (obj)=>{
|
15487
|
+
for (let [key, value] of Object.entries(obj))"string" == typeof value || Array.isArray(value) ? fn(key, normalizeSimple1(value, key)) : fn(key, normalizeOptions1(value, key));
|
15488
|
+
};
|
15489
|
+
if (options1) if (Array.isArray(options1)) {
|
15490
|
+
var items1 = options1;
|
15491
|
+
for (let item of items1)if ("string" == typeof item) fn(item, normalizeSimple1(item, item));
|
15492
|
+
else if (item && "object" == typeof item) object(item);
|
15493
|
+
else throw Error("Unexpected options format");
|
15494
|
+
} else if ("object" == typeof options1) object(options1);
|
15495
|
+
else throw Error("Unexpected options format");
|
15496
|
+
return items;
|
15477
15497
|
};
|
15478
15498
|
class ModuleFederationPlugin {
|
15479
15499
|
_options;
|
@@ -15584,9 +15604,9 @@ Help:
|
|
15584
15604
|
let compilerSet = new WeakSet();
|
15585
15605
|
class ShareRuntimePlugin extends RspackBuiltinPlugin {
|
15586
15606
|
enhanced;
|
15587
|
-
name;
|
15607
|
+
name = binding_.BuiltinPluginName.ShareRuntimePlugin;
|
15588
15608
|
constructor(enhanced = !1){
|
15589
|
-
super(), this.enhanced = enhanced
|
15609
|
+
super(), this.enhanced = enhanced;
|
15590
15610
|
}
|
15591
15611
|
raw(compiler) {
|
15592
15612
|
var compiler1, compiler2;
|
@@ -15825,7 +15845,7 @@ Help:
|
|
15825
15845
|
let _options = JSON.stringify(options || {});
|
15826
15846
|
return binding_default().transform(source, _options);
|
15827
15847
|
}
|
15828
|
-
let exports_rspackVersion = "1.4.7
|
15848
|
+
let exports_rspackVersion = "1.4.7", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
15829
15849
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
15830
15850
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
15831
15851
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
@@ -15964,12 +15984,13 @@ Help:
|
|
15964
15984
|
}
|
15965
15985
|
};
|
15966
15986
|
function createCompiler(userOptions) {
|
15967
|
-
|
15968
|
-
|
15969
|
-
|
15987
|
+
var options;
|
15988
|
+
let options1 = getNormalizedRspackOptions(userOptions);
|
15989
|
+
defaults_F(options = options1, "context", ()=>process.cwd()), applyInfrastructureLoggingDefaults(options.infrastructureLogging), external_node_assert_default()(!isNil(options1.context));
|
15990
|
+
let compiler = new Compiler(options1.context, options1);
|
15970
15991
|
if (new NodeEnvironmentPlugin({
|
15971
|
-
infrastructureLogging:
|
15972
|
-
}).apply(compiler), Array.isArray(
|
15992
|
+
infrastructureLogging: options1.infrastructureLogging
|
15993
|
+
}).apply(compiler), Array.isArray(options1.plugins)) for (let plugin of options1.plugins)"function" == typeof plugin ? plugin.call(compiler, compiler) : plugin && plugin.apply(compiler);
|
15973
15994
|
return applyRspackOptionsDefaults(compiler.options), compiler.hooks.environment.call(), compiler.hooks.afterEnvironment.call(), new RspackOptionsApply().process(compiler.options, compiler), compiler.hooks.initialize.call(), compiler;
|
15974
15995
|
}
|
15975
15996
|
let src_fn = Object.assign(function(options, callback) {
|