@rspack-canary/core 1.7.0-canary-7f9f7f14-20251231041831 → 1.7.0-canary-b303a917-20251231130755
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/dist/BuildInfo.d.ts +4 -4
- package/dist/Chunk.d.ts +3 -3
- package/dist/ChunkGraph.d.ts +3 -3
- package/dist/Chunks.d.ts +2 -2
- package/dist/Compilation.d.ts +40 -40
- package/dist/Compiler.d.ts +23 -25
- package/dist/ConcatenatedModule.d.ts +1 -1
- package/dist/ContextModule.d.ts +1 -1
- package/dist/ContextModuleFactory.d.ts +2 -2
- package/dist/Diagnostics.d.ts +2 -2
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/ExecuteModulePlugin.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +2 -2
- package/dist/ExternalModule.d.ts +1 -1
- package/dist/FileSystem.d.ts +3 -3
- package/dist/Module.d.ts +6 -6
- package/dist/ModuleGraph.d.ts +3 -3
- package/dist/MultiCompiler.d.ts +8 -8
- package/dist/MultiStats.d.ts +3 -3
- package/dist/MultiWatching.d.ts +3 -3
- package/dist/NativeWatchFileSystem.d.ts +5 -5
- package/dist/NormalModule.d.ts +6 -6
- package/dist/NormalModuleFactory.d.ts +4 -4
- package/dist/Resolver.d.ts +2 -2
- package/dist/ResolverFactory.d.ts +3 -3
- package/dist/RspackError.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +2 -2
- package/dist/RuntimeModule.d.ts +4 -4
- package/dist/Stats.d.ts +4 -4
- package/dist/VirtualModulesPlugin.d.ts +1 -1
- package/dist/Watching.d.ts +5 -5
- package/dist/builtin-loader/index.d.ts +1 -1
- package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +1 -1
- package/dist/builtin-loader/swc/index.d.ts +5 -5
- package/dist/builtin-loader/swc/types.d.ts +8 -10
- package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +10 -5
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +4 -4
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EntryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +2 -2
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +3 -3
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +4 -4
- package/dist/builtin-plugin/IgnorePlugin.d.ts +4 -4
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +6 -6
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +8 -8
- package/dist/builtin-plugin/RslibPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +5 -5
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +4 -4
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +5 -5
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/{CaseSensitivePlugin.d.ts → WarnCaseSensitiveModulesPlugin.d.ts} +1 -1
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +3 -3
- package/dist/builtin-plugin/WorkerPlugin.d.ts +4 -4
- package/dist/builtin-plugin/base.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/index.d.ts +7 -7
- package/dist/builtin-plugin/css-extract/loader.d.ts +2 -2
- package/dist/builtin-plugin/css-extract/utils.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +4 -4
- package/dist/builtin-plugin/html-plugin/index.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/options.d.ts +6 -6
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +5 -5
- package/dist/builtin-plugin/html-plugin/taps.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +88 -84
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +2 -2
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +10 -0
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +10 -0
- package/dist/builtin-plugin/rsc/index.d.ts +15 -0
- package/dist/config/adapter.d.ts +7 -7
- package/dist/config/adapterRuleUse.d.ts +16 -16
- package/dist/config/browserslistTargetHandler.d.ts +1 -1
- package/dist/config/defaults.d.ts +2 -11
- package/dist/config/devServer.d.ts +32 -32
- package/dist/config/index.d.ts +5 -5
- package/dist/config/normalization.d.ts +9 -9
- package/dist/config/target.d.ts +7 -7
- package/dist/config/types.d.ts +74 -75
- package/dist/container/ContainerPlugin.d.ts +4 -4
- package/dist/container/ContainerReferencePlugin.d.ts +4 -4
- package/dist/container/ModuleFederationManifestPlugin.d.ts +3 -3
- package/dist/container/ModuleFederationPlugin.d.ts +6 -8
- package/dist/container/ModuleFederationPluginV1.d.ts +5 -5
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +0 -4
- package/dist/container/index.d.ts +4 -4
- package/dist/cssExtractHmr.js +19 -19
- package/dist/cssExtractLoader.js +16 -16
- package/dist/exports.d.ts +74 -76
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1965 -1933
- package/dist/lib/AbstractMethodError.d.ts +1 -1
- package/dist/lib/Cache.d.ts +2 -2
- package/dist/lib/CacheFacade.d.ts +3 -3
- package/dist/lib/DllPlugin.d.ts +1 -1
- package/dist/lib/DllReferencePlugin.d.ts +5 -5
- package/dist/lib/EntryOptionPlugin.d.ts +2 -2
- package/dist/lib/EnvironmentPlugin.d.ts +1 -1
- package/dist/lib/HookWebpackError.d.ts +2 -2
- package/dist/lib/IgnoreWarningsPlugin.d.ts +1 -1
- package/dist/lib/LoaderOptionsPlugin.d.ts +2 -2
- package/dist/lib/LoaderTargetPlugin.d.ts +2 -2
- package/dist/lib/WebpackError.d.ts +3 -3
- package/dist/lib/cache/MemoryCachePlugin.d.ts +1 -1
- package/dist/lib/cache/getLazyHashedEtag.d.ts +1 -1
- package/dist/lib/cache/mergeEtags.d.ts +1 -1
- package/dist/loader-runner/ModuleError.d.ts +1 -1
- package/dist/loader-runner/index.d.ts +3 -3
- package/dist/loader-runner/loadLoader.d.ts +2 -2
- package/dist/loader-runner/service.d.ts +8 -8
- package/dist/loader-runner/utils.d.ts +3 -3
- package/dist/loader-runner/worker.d.ts +3 -3
- package/dist/logging/createConsoleLogger.d.ts +4 -4
- package/dist/moduleFederationDefaultRuntime.js +1 -1
- package/dist/node/NodeEnvironmentPlugin.d.ts +2 -2
- package/dist/node/NodeTemplatePlugin.d.ts +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +3 -3
- package/dist/node/nodeConsole.d.ts +2 -2
- package/dist/rspack.d.ts +6 -15
- package/dist/rspackOptionsApply.d.ts +1 -1
- package/dist/sharing/ConsumeSharedPlugin.d.ts +3 -3
- package/dist/sharing/ProvideSharedPlugin.d.ts +4 -4
- package/dist/sharing/SharePlugin.d.ts +1 -1
- package/dist/sharing/ShareRuntimePlugin.d.ts +3 -3
- package/dist/stats/DefaultStatsFactoryPlugin.d.ts +15 -15
- package/dist/stats/DefaultStatsPresetPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPrinterPlugin.d.ts +1 -1
- package/dist/stats/StatsFactory.d.ts +5 -5
- package/dist/stats/StatsPrinter.d.ts +3 -3
- package/dist/stats/statsFactoryUtils.d.ts +5 -5
- package/dist/swc.d.ts +2 -2
- package/dist/taps/compilation.d.ts +2 -2
- package/dist/taps/compiler.d.ts +1 -1
- package/dist/taps/contextModuleFactory.d.ts +1 -1
- package/dist/taps/index.d.ts +6 -6
- package/dist/taps/javascriptModules.d.ts +1 -1
- package/dist/taps/normalModuleFactory.d.ts +1 -1
- package/dist/taps/types.d.ts +3 -3
- package/dist/trace/index.d.ts +4 -4
- package/dist/trace/traceHookPlugin.d.ts +1 -1
- package/dist/util/SplitChunkSize.d.ts +1 -1
- package/dist/util/createHash.d.ts +1 -1
- package/dist/util/createReadonlyMap.d.ts +1 -1
- package/dist/util/fs.d.ts +14 -14
- package/dist/util/hash/wasm-hash.d.ts +1 -1
- package/dist/util/identifier.d.ts +1 -1
- package/dist/util/index.d.ts +1 -2
- package/dist/util/source.d.ts +2 -2
- package/dist/util/validateConfig.d.ts +1 -1
- package/dist/worker.js +111 -111
- package/hot/dev-server.js +64 -64
- package/hot/emitter.js +11 -11
- package/hot/lazy-compilation-node.js +41 -41
- package/hot/lazy-compilation-web.js +52 -52
- package/hot/log-apply-result.js +36 -36
- package/hot/log.js +30 -30
- package/hot/only-dev-server.js +92 -92
- package/hot/poll.js +31 -31
- package/hot/signal.js +53 -53
- package/module.d.ts +215 -215
- package/package.json +4 -4
package/dist/worker.js
CHANGED
|
@@ -29,10 +29,10 @@ var __webpack_modules__ = {
|
|
|
29
29
|
__webpack_require__.d(__webpack_exports__, {
|
|
30
30
|
ks: ()=>cleverMerge
|
|
31
31
|
});
|
|
32
|
-
let DYNAMIC_INFO = Symbol(
|
|
32
|
+
let DYNAMIC_INFO = Symbol("cleverMerge dynamic info"), mergeCache = new WeakMap(), DELETE = Symbol("DELETE"), cachedCleverMerge = (first, second)=>{
|
|
33
33
|
if (void 0 === second) return first;
|
|
34
|
-
if (void 0 === first ||
|
|
35
|
-
if (
|
|
34
|
+
if (void 0 === first || "object" != typeof second || null === second) return second;
|
|
35
|
+
if ("object" != typeof first || null === first) return first;
|
|
36
36
|
let innerCache = mergeCache.get(first);
|
|
37
37
|
void 0 === innerCache && (innerCache = new WeakMap(), mergeCache.set(first, innerCache));
|
|
38
38
|
let prevMerge = innerCache.get(second);
|
|
@@ -55,18 +55,18 @@ var __webpack_modules__ = {
|
|
|
55
55
|
};
|
|
56
56
|
return info.set(p, newEntry), newEntry;
|
|
57
57
|
};
|
|
58
|
-
for (let key of Object.keys(obj))if (key.startsWith(
|
|
58
|
+
for (let key of Object.keys(obj))if (key.startsWith("by")) {
|
|
59
59
|
let byObj = obj[key];
|
|
60
|
-
if (
|
|
60
|
+
if ("object" == typeof byObj) for (let byValue of Object.keys(byObj)){
|
|
61
61
|
let obj = byObj[byValue];
|
|
62
62
|
for (let key1 of Object.keys(obj)){
|
|
63
63
|
let entry = getInfo(key1);
|
|
64
64
|
if (void 0 === entry.byProperty) entry.byProperty = key;
|
|
65
65
|
else if (entry.byProperty !== key) throw Error(`${key} and ${entry.byProperty} for a single property is not supported`);
|
|
66
|
-
if (entry.byValues.set(byValue, obj[key1]),
|
|
66
|
+
if (entry.byValues.set(byValue, obj[key1]), "default" === byValue) for (let otherByValue of Object.keys(byObj))entry.byValues.has(otherByValue) || entry.byValues.set(otherByValue, void 0);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
else if (
|
|
69
|
+
else if ("function" == typeof byObj) if (void 0 === dynamicInfo) dynamicInfo = {
|
|
70
70
|
byProperty: key,
|
|
71
71
|
fn: byObj
|
|
72
72
|
};
|
|
@@ -91,7 +91,7 @@ var __webpack_modules__ = {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
return void 0 !== dynamicInfo && (obj[dynamicInfo.byProperty] = dynamicInfo.fn), obj;
|
|
94
|
-
}, getValueType = (value)=>void 0 === value ? 0 : value === DELETE ? 4 : Array.isArray(value) ? -1 !== value.lastIndexOf(
|
|
94
|
+
}, getValueType = (value)=>void 0 === value ? 0 : value === DELETE ? 4 : Array.isArray(value) ? -1 !== value.lastIndexOf("...") ? 2 : 1 : "object" != typeof value || null === value || value.constructor && value.constructor !== Object ? 1 : 3, cleverMerge = (first, second)=>void 0 === second ? first : void 0 === first || "object" != typeof second || null === second ? second : "object" != typeof first || null === first ? first : _cleverMerge(first, second, !1), _cleverMerge = (first, second, internalCaching = !1)=>{
|
|
95
95
|
let firstObject = internalCaching ? cachedParseObject(first) : parseObject(first), { static: firstInfo, dynamic: firstDynamicInfo } = firstObject, secondObj = second;
|
|
96
96
|
if (void 0 !== firstDynamicInfo) {
|
|
97
97
|
let { byProperty, fn } = firstDynamicInfo, fnInfo = fn[DYNAMIC_INFO];
|
|
@@ -152,7 +152,7 @@ var __webpack_modules__ = {
|
|
|
152
152
|
if (Array.from(firstEntry.byValues.values()).every((value)=>{
|
|
153
153
|
let type = getValueType(value);
|
|
154
154
|
return 1 === type || 4 === type;
|
|
155
|
-
}) ? newBase = mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching) : (newBase = firstEntry.base, intermediateByValues.has(
|
|
155
|
+
}) ? newBase = mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching) : (newBase = firstEntry.base, intermediateByValues.has("default") || intermediateByValues.set("default", secondEntry.base)), !secondEntry.byProperty) return {
|
|
156
156
|
base: newBase,
|
|
157
157
|
byProperty: firstEntry.byProperty,
|
|
158
158
|
byValues: intermediateByValues
|
|
@@ -170,7 +170,7 @@ var __webpack_modules__ = {
|
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
}, getFromByValues = (byValues, key)=>
|
|
173
|
+
}, getFromByValues = (byValues, key)=>"default" !== key && byValues.has(key) ? byValues.get(key) : byValues.get("default"), mergeSingleValue = (a, b, internalCaching)=>{
|
|
174
174
|
let bType = getValueType(b), aType = getValueType(a);
|
|
175
175
|
switch(bType){
|
|
176
176
|
case 4:
|
|
@@ -185,21 +185,21 @@ var __webpack_modules__ = {
|
|
|
185
185
|
case 0:
|
|
186
186
|
return b;
|
|
187
187
|
case 4:
|
|
188
|
-
return b.filter((item)=>
|
|
188
|
+
return b.filter((item)=>"..." !== item);
|
|
189
189
|
case 2:
|
|
190
190
|
{
|
|
191
191
|
let newArray = [];
|
|
192
|
-
for (let item of b)if (
|
|
192
|
+
for (let item of b)if ("..." === item) for (let item of a)newArray.push(item);
|
|
193
193
|
else newArray.push(item);
|
|
194
194
|
return newArray;
|
|
195
195
|
}
|
|
196
196
|
case 3:
|
|
197
|
-
return b.map((item)=>
|
|
197
|
+
return b.map((item)=>"..." === item ? a : item);
|
|
198
198
|
default:
|
|
199
|
-
throw Error(
|
|
199
|
+
throw Error("Not implemented");
|
|
200
200
|
}
|
|
201
201
|
default:
|
|
202
|
-
throw Error(
|
|
202
|
+
throw Error("Not implemented");
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
},
|
|
@@ -219,25 +219,25 @@ var __webpack_modules__ = {
|
|
|
219
219
|
}
|
|
220
220
|
Object.defineProperty(WebpackError.prototype, external_node_util_.inspect.custom, {
|
|
221
221
|
value: function() {
|
|
222
|
-
return this.stack + (this.details ? `\n${this.details}` :
|
|
222
|
+
return this.stack + (this.details ? `\n${this.details}` : "");
|
|
223
223
|
},
|
|
224
224
|
enumerable: !1,
|
|
225
225
|
configurable: !0
|
|
226
226
|
});
|
|
227
227
|
let lib_WebpackError = WebpackError, CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/;
|
|
228
228
|
function createMessage(method) {
|
|
229
|
-
return `Abstract method${method ? ` ${method}` :
|
|
229
|
+
return `Abstract method${method ? ` ${method}` : ""}. Must be overridden.`;
|
|
230
230
|
}
|
|
231
231
|
class Message extends Error {
|
|
232
232
|
constructor(){
|
|
233
233
|
super(), this.stack = void 0, Error.captureStackTrace(this);
|
|
234
|
-
const match = this.stack.split(
|
|
234
|
+
const match = this.stack.split("\n")[3].match(CURRENT_METHOD_REGEXP);
|
|
235
235
|
this.message = match?.[1] ? createMessage(match[1]) : createMessage();
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
class AbstractMethodError extends lib_WebpackError {
|
|
239
239
|
constructor(){
|
|
240
|
-
super(new Message().message), this.name =
|
|
240
|
+
super(new Message().message), this.name = "AbstractMethodError";
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
class Hash {
|
|
@@ -264,7 +264,7 @@ var __webpack_modules__ = {
|
|
|
264
264
|
this.buffered = 0, this.exports.init();
|
|
265
265
|
}
|
|
266
266
|
update(data, encoding) {
|
|
267
|
-
if (
|
|
267
|
+
if ("string" == typeof data) {
|
|
268
268
|
let normalizedData = data;
|
|
269
269
|
for(; normalizedData.length > MAX_SHORT_STRING;)this._updateWithShortString(normalizedData.slice(0, MAX_SHORT_STRING), encoding), normalizedData = normalizedData.slice(MAX_SHORT_STRING);
|
|
270
270
|
return this._updateWithShortString(normalizedData, encoding), this;
|
|
@@ -273,7 +273,7 @@ var __webpack_modules__ = {
|
|
|
273
273
|
}
|
|
274
274
|
_updateWithShortString(data, encoding) {
|
|
275
275
|
let endPos, { exports: exports1, buffered, mem, chunkSize } = this;
|
|
276
|
-
if (data.length < 70) if (encoding &&
|
|
276
|
+
if (data.length < 70) if (encoding && "utf-8" !== encoding && "utf8" !== encoding) if ("latin1" === encoding) {
|
|
277
277
|
endPos = buffered;
|
|
278
278
|
for(let i = 0; i < data.length; i++){
|
|
279
279
|
let cc = data.charCodeAt(i);
|
|
@@ -320,8 +320,8 @@ var __webpack_modules__ = {
|
|
|
320
320
|
digest(type) {
|
|
321
321
|
let { exports: exports1, buffered, mem, digestSize } = this;
|
|
322
322
|
exports1.final(buffered), this.instancesPool.push(this);
|
|
323
|
-
let hex = mem.toString(
|
|
324
|
-
return
|
|
323
|
+
let hex = mem.toString("latin1", 0, digestSize);
|
|
324
|
+
return "hex" === type ? hex : "binary" !== type && type ? Buffer.from(hex, "hex").toString(type) : Buffer.from(hex, "hex");
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
let wasm_hash = (wasmModule, instancesPool, chunkSize, digestSize)=>{
|
|
@@ -337,10 +337,10 @@ var __webpack_modules__ = {
|
|
|
337
337
|
hashKey;
|
|
338
338
|
buffer;
|
|
339
339
|
constructor(hashOrFactory, hashKey){
|
|
340
|
-
super(), this.hashKey = hashKey,
|
|
340
|
+
super(), this.hashKey = hashKey, "function" == typeof hashOrFactory ? (this.hashFactory = hashOrFactory, this.hash = void 0) : (this.hashFactory = void 0, this.hash = hashOrFactory), this.buffer = "";
|
|
341
341
|
}
|
|
342
342
|
update(data, inputEncoding) {
|
|
343
|
-
return void 0 !== inputEncoding ||
|
|
343
|
+
return void 0 !== inputEncoding || "string" != typeof data || data.length > 2000 ? (void 0 === this.hash && (this.hash = this.hashFactory()), this.buffer.length > 0 && (this.hash.update(Buffer.from(this.buffer)), this.buffer = ""), Buffer.isBuffer(data) ? this.hash.update(data) : this.hash.update(data, inputEncoding)) : (this.buffer += data, this.buffer.length > 2000 && (void 0 === this.hash && (this.hash = this.hashFactory()), this.hash.update(Buffer.from(this.buffer)), this.buffer = "")), this;
|
|
344
344
|
}
|
|
345
345
|
digest(encoding) {
|
|
346
346
|
let digestCache, buffer = this.buffer;
|
|
@@ -348,25 +348,25 @@ var __webpack_modules__ = {
|
|
|
348
348
|
let cacheKey = `${this.hashKey}-${encoding}`;
|
|
349
349
|
void 0 === (digestCache = digestCaches[cacheKey]) && (digestCache = digestCaches[cacheKey] = new Map());
|
|
350
350
|
let cacheEntry = digestCache.get(buffer);
|
|
351
|
-
if (void 0 !== cacheEntry) return encoding ? cacheEntry : Buffer.from(cacheEntry,
|
|
351
|
+
if (void 0 !== cacheEntry) return encoding ? cacheEntry : Buffer.from(cacheEntry, "hex");
|
|
352
352
|
this.hash = this.hashFactory();
|
|
353
353
|
}
|
|
354
354
|
buffer.length > 0 && this.hash.update(Buffer.from(buffer));
|
|
355
355
|
let result = encoding ? this.hash.digest(encoding) : this.hash.digest();
|
|
356
|
-
return void 0 !== digestCache &&
|
|
356
|
+
return void 0 !== digestCache && "string" == typeof result && digestCache.set(buffer, result), result;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
class DebugHash extends Hash {
|
|
360
360
|
string;
|
|
361
361
|
constructor(){
|
|
362
|
-
super(), this.string =
|
|
362
|
+
super(), this.string = "";
|
|
363
363
|
}
|
|
364
364
|
update(data) {
|
|
365
365
|
let normalizedData;
|
|
366
|
-
return (normalizedData = Buffer.isBuffer(data) ? data.toString(
|
|
366
|
+
return (normalizedData = Buffer.isBuffer(data) ? data.toString("utf-8") : data).startsWith("debug-digest-") && (normalizedData = Buffer.from(normalizedData.slice(13), "hex").toString()), this.string += `[${normalizedData}](${Error().stack?.split("\n", 3)[2]})\n`, this;
|
|
367
367
|
}
|
|
368
368
|
digest(encoding) {
|
|
369
|
-
let result = `debug-digest-${Buffer.from(this.string).toString(
|
|
369
|
+
let result = `debug-digest-${Buffer.from(this.string).toString("hex")}`;
|
|
370
370
|
return encoding ? result : Buffer.from(result);
|
|
371
371
|
}
|
|
372
372
|
}
|
|
@@ -383,31 +383,31 @@ var __webpack_modules__ = {
|
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
let createHash_createHash = (algorithm)=>{
|
|
386
|
-
if (
|
|
386
|
+
if ("function" == typeof algorithm) return new BulkUpdateDecorator(()=>new algorithm());
|
|
387
387
|
switch(algorithm){
|
|
388
|
-
case
|
|
388
|
+
case "debug":
|
|
389
389
|
return new DebugHash();
|
|
390
|
-
case
|
|
390
|
+
case "xxhash64":
|
|
391
391
|
return new WasmHashAdapter((()=>{
|
|
392
392
|
if (!createXxhash64) {
|
|
393
|
-
let xxhash64 = new WebAssembly.Module(Buffer.from(
|
|
393
|
+
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"));
|
|
394
394
|
createXxhash64 = wasm_hash.bind(null, xxhash64, [], 32, 16);
|
|
395
395
|
}
|
|
396
396
|
return createXxhash64();
|
|
397
397
|
})());
|
|
398
|
-
case
|
|
398
|
+
case "md4":
|
|
399
399
|
return new WasmHashAdapter((()=>{
|
|
400
400
|
if (!createMd4) {
|
|
401
|
-
let md4 = new WebAssembly.Module(Buffer.from(
|
|
401
|
+
let md4 = new WebAssembly.Module(Buffer.from("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", "base64"));
|
|
402
402
|
createMd4 = wasm_hash.bind(null, md4, [], 64, 32);
|
|
403
403
|
}
|
|
404
404
|
return createMd4();
|
|
405
405
|
})());
|
|
406
|
-
case
|
|
406
|
+
case "native-md4":
|
|
407
407
|
return new BulkUpdateDecorator(()=>{
|
|
408
408
|
let { createHash } = __webpack_require__("node:crypto");
|
|
409
|
-
return createHash(
|
|
410
|
-
},
|
|
409
|
+
return createHash("md4");
|
|
410
|
+
}, "md4");
|
|
411
411
|
default:
|
|
412
412
|
return new BulkUpdateDecorator(()=>{
|
|
413
413
|
let { createHash } = __webpack_require__("node:crypto");
|
|
@@ -472,15 +472,15 @@ for(var __rspack_i in (()=>{
|
|
|
472
472
|
var binding_ = __webpack_require__("@rspack/binding"), createHash = __webpack_require__("./src/util/createHash.ts");
|
|
473
473
|
let external_node_path_namespaceObject = require("node:path");
|
|
474
474
|
var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject);
|
|
475
|
-
let WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, relativePathToRequest = (relativePath)=>
|
|
476
|
-
if (
|
|
477
|
-
if (maybeAbsolutePath.length > 1 &&
|
|
478
|
-
let querySplitPos = maybeAbsolutePath.indexOf(
|
|
475
|
+
let WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, relativePathToRequest = (relativePath)=>"" === relativePath ? "./." : ".." === relativePath ? "../." : relativePath.startsWith("../") ? relativePath : `./${relativePath}`, absoluteToRequest = (context, maybeAbsolutePath)=>{
|
|
476
|
+
if ("/" === maybeAbsolutePath[0]) {
|
|
477
|
+
if (maybeAbsolutePath.length > 1 && "/" === maybeAbsolutePath[maybeAbsolutePath.length - 1]) return maybeAbsolutePath;
|
|
478
|
+
let querySplitPos = maybeAbsolutePath.indexOf("?"), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
479
479
|
return resource = relativePathToRequest(external_node_path_default().posix.relative(context, resource)), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
|
|
480
480
|
}
|
|
481
481
|
if (WINDOWS_ABS_PATH_REGEXP.test(maybeAbsolutePath)) {
|
|
482
|
-
let querySplitPos = maybeAbsolutePath.indexOf(
|
|
483
|
-
return resource = external_node_path_default().win32.relative(context, resource), WINDOWS_ABS_PATH_REGEXP.test(resource) || (resource = relativePathToRequest(resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP,
|
|
482
|
+
let querySplitPos = maybeAbsolutePath.indexOf("?"), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
483
|
+
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);
|
|
484
484
|
}
|
|
485
485
|
return maybeAbsolutePath;
|
|
486
486
|
}, makeCacheable = (realFn)=>{
|
|
@@ -538,25 +538,25 @@ for(var __rspack_i in (()=>{
|
|
|
538
538
|
};
|
|
539
539
|
}, cachedFn;
|
|
540
540
|
};
|
|
541
|
-
makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join(
|
|
542
|
-
let contextify = makeCacheableWithContext((context, request)=>request.split(
|
|
541
|
+
makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join(""));
|
|
542
|
+
let contextify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>absoluteToRequest(context, r)).join("!")), absolutify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>{
|
|
543
543
|
var context1, relativePath;
|
|
544
|
-
return context1 = context, (relativePath = r).startsWith(
|
|
545
|
-
}).join(
|
|
544
|
+
return context1 = context, (relativePath = r).startsWith("./") || relativePath.startsWith("../") ? external_node_path_default().join(context1, relativePath) : relativePath;
|
|
545
|
+
}).join("!")), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/;
|
|
546
546
|
makeCacheable((str)=>{
|
|
547
547
|
let match = PATH_QUERY_FRAGMENT_REGEXP.exec(str);
|
|
548
548
|
return {
|
|
549
549
|
resource: str,
|
|
550
|
-
path: match[1].replace(/\u200b(.)/g,
|
|
551
|
-
query: match[2] ? match[2].replace(/\u200b(.)/g,
|
|
552
|
-
fragment: match[3] ||
|
|
550
|
+
path: match[1].replace(/\u200b(.)/g, "$1"),
|
|
551
|
+
query: match[2] ? match[2].replace(/\u200b(.)/g, "$1") : "",
|
|
552
|
+
fragment: match[3] || ""
|
|
553
553
|
};
|
|
554
554
|
}), makeCacheable((str)=>{
|
|
555
555
|
let match = PATH_QUERY_REGEXP.exec(str);
|
|
556
556
|
return {
|
|
557
557
|
resource: str,
|
|
558
|
-
path: match[1].replace(/\u200b(.)/g,
|
|
559
|
-
query: match[2] ? match[2].replace(/\u200b(.)/g,
|
|
558
|
+
path: match[1].replace(/\u200b(.)/g, "$1"),
|
|
559
|
+
query: match[2] ? match[2].replace(/\u200b(.)/g, "$1") : ""
|
|
560
560
|
};
|
|
561
561
|
});
|
|
562
562
|
let memoize = (fn)=>{
|
|
@@ -564,11 +564,11 @@ for(var __rspack_i in (()=>{
|
|
|
564
564
|
return ()=>(cache || (result = callback(), cache = !0, callback = void 0), result);
|
|
565
565
|
}, LoaderLoadingError = class extends Error {
|
|
566
566
|
constructor(message){
|
|
567
|
-
super(message), this.name =
|
|
567
|
+
super(message), this.name = "LoaderRunnerError", Error.captureStackTrace(this, this.constructor);
|
|
568
568
|
}
|
|
569
569
|
};
|
|
570
570
|
function loadLoader(loader, compiler, callback) {
|
|
571
|
-
if (
|
|
571
|
+
if ("module" === loader.type) try {
|
|
572
572
|
void 0 === url && (url = __webpack_require__("node:url")), import(url.pathToFileURL(loader.path).toString()).then((module)=>{
|
|
573
573
|
handleResult(loader, module, callback);
|
|
574
574
|
}, callback);
|
|
@@ -581,30 +581,30 @@ for(var __rspack_i in (()=>{
|
|
|
581
581
|
try {
|
|
582
582
|
module = require(loader.path);
|
|
583
583
|
} catch (e) {
|
|
584
|
-
if (e instanceof Error &&
|
|
584
|
+
if (e instanceof Error && "EMFILE" === e.code) return void setImmediate(loadLoader.bind(null, loader, compiler, callback));
|
|
585
585
|
return callback(e);
|
|
586
586
|
}
|
|
587
587
|
return handleResult(loader, module, callback);
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
function handleResult(loader, module, callback) {
|
|
591
|
-
return
|
|
591
|
+
return "function" != typeof module && "object" != typeof module ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (export function or es6 module)`)) : (loader.normal = "function" == typeof module ? module : module.default, loader.pitch = module.pitch, loader.raw = module.raw, loader.pitch || (loader.noPitch = !0), "function" != typeof loader.normal && "function" != typeof loader.pitch) ? callback(new LoaderLoadingError(`Module '${loader.path}' is not a loader (must have normal or pitch function)`)) : void callback();
|
|
592
592
|
}
|
|
593
593
|
function isWorkerResponseMessage(message) {
|
|
594
|
-
return
|
|
594
|
+
return "response" === message.type;
|
|
595
595
|
}
|
|
596
596
|
function serializeError(error) {
|
|
597
|
-
if (error instanceof Error || error &&
|
|
597
|
+
if (error instanceof Error || error && "object" == typeof error && "message" in error) return {
|
|
598
598
|
...error,
|
|
599
599
|
name: error.name,
|
|
600
600
|
stack: error.stack,
|
|
601
601
|
message: error.message
|
|
602
602
|
};
|
|
603
|
-
if (
|
|
604
|
-
name:
|
|
603
|
+
if ("string" == typeof error) return {
|
|
604
|
+
name: "Error",
|
|
605
605
|
message: error
|
|
606
606
|
};
|
|
607
|
-
throw Error(
|
|
607
|
+
throw Error("Failed to serialize error, only string, Error instances and objects with a message property are supported");
|
|
608
608
|
}
|
|
609
609
|
let decoder = new TextDecoder();
|
|
610
610
|
(0, external_node_util_.promisify)(loadLoader);
|
|
@@ -613,14 +613,14 @@ for(var __rspack_i in (()=>{
|
|
|
613
613
|
context.async = function() {
|
|
614
614
|
if (isDone) {
|
|
615
615
|
if (reportedError) return;
|
|
616
|
-
throw Error(
|
|
616
|
+
throw Error("async(): The callback was already called.");
|
|
617
617
|
}
|
|
618
618
|
return isSync = !1, innerCallback;
|
|
619
619
|
};
|
|
620
620
|
let innerCallback = (err, ...args)=>{
|
|
621
621
|
if (isDone) {
|
|
622
622
|
if (reportedError) return;
|
|
623
|
-
throw Error(
|
|
623
|
+
throw Error("callback(): The callback was already called.");
|
|
624
624
|
}
|
|
625
625
|
isDone = !0, isSync = !1;
|
|
626
626
|
try {
|
|
@@ -634,7 +634,7 @@ for(var __rspack_i in (()=>{
|
|
|
634
634
|
let result = fn.apply(context, args);
|
|
635
635
|
if (isSync) {
|
|
636
636
|
if (isDone = !0, void 0 === result) return void callback(null, []);
|
|
637
|
-
if (result &&
|
|
637
|
+
if (result && "object" == typeof result && "function" == typeof result.then) return void result.then((r)=>{
|
|
638
638
|
callback(null, [
|
|
639
639
|
r
|
|
640
640
|
]);
|
|
@@ -645,15 +645,15 @@ for(var __rspack_i in (()=>{
|
|
|
645
645
|
return;
|
|
646
646
|
}
|
|
647
647
|
} catch (e) {
|
|
648
|
-
if (
|
|
648
|
+
if ("hideStack" in e && e.hideStack && (e.hideStack = "true"), isError) throw e;
|
|
649
649
|
if (isDone) return void (e instanceof Error ? console.error(e.stack) : console.error(e));
|
|
650
650
|
isDone = !0, reportedError = !0, callback(e, []);
|
|
651
651
|
}
|
|
652
652
|
}), loadLoaderAsync = (0, external_node_util_.promisify)(loadLoader);
|
|
653
653
|
async function loaderImpl({ args, loaderContext, loaderState }, sendRequest, waitForPendingRequest) {
|
|
654
654
|
let resourcePath = loaderContext.resourcePath, contextDirectory = resourcePath ? function(path) {
|
|
655
|
-
if (
|
|
656
|
-
let i = path.lastIndexOf(
|
|
655
|
+
if ("/" === path) return "/";
|
|
656
|
+
let i = path.lastIndexOf("/"), j = path.lastIndexOf("\\"), i2 = path.indexOf("/"), j2 = path.indexOf("\\"), idx = i > j ? i : j, idx2 = i > j ? i2 : j2;
|
|
657
657
|
return idx < 0 ? path : idx === idx2 ? path.slice(0, idx + 1) : path.slice(0, idx);
|
|
658
658
|
}(resourcePath) : null, pendingDependencyRequest = [];
|
|
659
659
|
loaderContext.parallel = !0, loaderContext.dependency = loaderContext.addDependency = function(file) {
|
|
@@ -694,76 +694,76 @@ for(var __rspack_i in (()=>{
|
|
|
694
694
|
}, loaderContext.getLogger = function(name) {
|
|
695
695
|
return {
|
|
696
696
|
error (...args) {
|
|
697
|
-
sendRequest("GetLogger",
|
|
697
|
+
sendRequest("GetLogger", "error", name, args);
|
|
698
698
|
},
|
|
699
699
|
warn (...args) {
|
|
700
|
-
sendRequest("GetLogger",
|
|
700
|
+
sendRequest("GetLogger", "warn", name, args);
|
|
701
701
|
},
|
|
702
702
|
info (...args) {
|
|
703
|
-
sendRequest("GetLogger",
|
|
703
|
+
sendRequest("GetLogger", "info", name, args);
|
|
704
704
|
},
|
|
705
705
|
log (...args) {
|
|
706
|
-
sendRequest("GetLogger",
|
|
706
|
+
sendRequest("GetLogger", "log", name, args);
|
|
707
707
|
},
|
|
708
708
|
debug (...args) {
|
|
709
|
-
sendRequest("GetLogger",
|
|
709
|
+
sendRequest("GetLogger", "debug", name, args);
|
|
710
710
|
},
|
|
711
711
|
assert (assertion, ...args) {
|
|
712
|
-
assertion || sendRequest("GetLogger",
|
|
712
|
+
assertion || sendRequest("GetLogger", "error", name, args);
|
|
713
713
|
},
|
|
714
714
|
trace () {
|
|
715
|
-
sendRequest("GetLogger",
|
|
716
|
-
|
|
715
|
+
sendRequest("GetLogger", "trace", name, [
|
|
716
|
+
"Trace"
|
|
717
717
|
]);
|
|
718
718
|
},
|
|
719
719
|
clear () {
|
|
720
|
-
sendRequest("GetLogger",
|
|
720
|
+
sendRequest("GetLogger", "clear", name);
|
|
721
721
|
},
|
|
722
722
|
status (...args) {
|
|
723
|
-
sendRequest("GetLogger",
|
|
723
|
+
sendRequest("GetLogger", "status", name, args);
|
|
724
724
|
},
|
|
725
725
|
group (...args) {
|
|
726
|
-
sendRequest("GetLogger",
|
|
726
|
+
sendRequest("GetLogger", "group", name, args);
|
|
727
727
|
},
|
|
728
728
|
groupCollapsed (...args) {
|
|
729
|
-
sendRequest("GetLogger",
|
|
729
|
+
sendRequest("GetLogger", "groupCollapsed", name, args);
|
|
730
730
|
},
|
|
731
731
|
groupEnd (...args) {
|
|
732
|
-
sendRequest("GetLogger",
|
|
732
|
+
sendRequest("GetLogger", "groupEnd", name, args);
|
|
733
733
|
},
|
|
734
734
|
profile (label) {
|
|
735
|
-
sendRequest("GetLogger",
|
|
735
|
+
sendRequest("GetLogger", "profile", name, [
|
|
736
736
|
label
|
|
737
737
|
]);
|
|
738
738
|
},
|
|
739
739
|
profileEnd (label) {
|
|
740
|
-
sendRequest("GetLogger",
|
|
740
|
+
sendRequest("GetLogger", "profileEnd", name, [
|
|
741
741
|
label
|
|
742
742
|
]);
|
|
743
743
|
},
|
|
744
744
|
time (label) {
|
|
745
|
-
sendRequest("GetLogger",
|
|
745
|
+
sendRequest("GetLogger", "time", name, [
|
|
746
746
|
label
|
|
747
747
|
]);
|
|
748
748
|
},
|
|
749
749
|
timeEnd (label) {
|
|
750
|
-
sendRequest("GetLogger",
|
|
750
|
+
sendRequest("GetLogger", "timeEnd", name, [
|
|
751
751
|
label
|
|
752
752
|
]);
|
|
753
753
|
},
|
|
754
754
|
timeLog (label, ...args) {
|
|
755
|
-
sendRequest("GetLogger",
|
|
755
|
+
sendRequest("GetLogger", "timeLog", name, [
|
|
756
756
|
label,
|
|
757
757
|
...args
|
|
758
758
|
]);
|
|
759
759
|
},
|
|
760
760
|
timeAggregate (label) {
|
|
761
|
-
sendRequest("GetLogger",
|
|
761
|
+
sendRequest("GetLogger", "timeAggregate", name, [
|
|
762
762
|
label
|
|
763
763
|
]);
|
|
764
764
|
},
|
|
765
765
|
timeAggregateEnd (label) {
|
|
766
|
-
sendRequest("GetLogger",
|
|
766
|
+
sendRequest("GetLogger", "timeAggregateEnd", name, [
|
|
767
767
|
label
|
|
768
768
|
]);
|
|
769
769
|
}
|
|
@@ -825,29 +825,29 @@ for(var __rspack_i in (()=>{
|
|
|
825
825
|
}, (err)=>{
|
|
826
826
|
callback(err);
|
|
827
827
|
});
|
|
828
|
-
}, loaderContext.fs = __webpack_require__("node:fs"), Object.defineProperty(loaderContext,
|
|
828
|
+
}, loaderContext.fs = __webpack_require__("node:fs"), Object.defineProperty(loaderContext, "request", {
|
|
829
829
|
enumerable: !0,
|
|
830
|
-
get: ()=>loaderContext.loaders.map((o)=>o.request).concat(loaderContext.resource ||
|
|
831
|
-
}), Object.defineProperty(loaderContext,
|
|
830
|
+
get: ()=>loaderContext.loaders.map((o)=>o.request).concat(loaderContext.resource || "").join("!")
|
|
831
|
+
}), Object.defineProperty(loaderContext, "remainingRequest", {
|
|
832
832
|
enumerable: !0,
|
|
833
|
-
get: ()=>loaderContext.loaderIndex >= loaderContext.loaders.length - 1 && !loaderContext.resource ?
|
|
834
|
-
}), Object.defineProperty(loaderContext,
|
|
833
|
+
get: ()=>loaderContext.loaderIndex >= loaderContext.loaders.length - 1 && !loaderContext.resource ? "" : loaderContext.loaders.slice(loaderContext.loaderIndex + 1).map((o)=>o.request).concat(loaderContext.resource || "").join("!")
|
|
834
|
+
}), Object.defineProperty(loaderContext, "currentRequest", {
|
|
835
835
|
enumerable: !0,
|
|
836
|
-
get: ()=>loaderContext.loaders.slice(loaderContext.loaderIndex).map((o)=>o.request).concat(loaderContext.resource ||
|
|
837
|
-
}), Object.defineProperty(loaderContext,
|
|
836
|
+
get: ()=>loaderContext.loaders.slice(loaderContext.loaderIndex).map((o)=>o.request).concat(loaderContext.resource || "").join("!")
|
|
837
|
+
}), Object.defineProperty(loaderContext, "previousRequest", {
|
|
838
838
|
enumerable: !0,
|
|
839
|
-
get: ()=>loaderContext.loaders.slice(0, loaderContext.loaderIndex).map((o)=>o.request).join(
|
|
840
|
-
}), Object.defineProperty(loaderContext,
|
|
839
|
+
get: ()=>loaderContext.loaders.slice(0, loaderContext.loaderIndex).map((o)=>o.request).join("!")
|
|
840
|
+
}), Object.defineProperty(loaderContext, "query", {
|
|
841
841
|
enumerable: !0,
|
|
842
842
|
get: ()=>{
|
|
843
843
|
let entry = loaderContext.loaders[loaderContext.loaderIndex];
|
|
844
|
-
return entry.options &&
|
|
844
|
+
return entry.options && "object" == typeof entry.options ? entry.options : entry.query;
|
|
845
845
|
}
|
|
846
846
|
}), loaderContext.getOptions = function() {
|
|
847
847
|
let loader = function(loaderContext, index = loaderContext.loaderIndex) {
|
|
848
848
|
return loaderContext.loaders?.length && index < loaderContext.loaders.length && index >= 0 && loaderContext.loaders[index] ? loaderContext.loaders[index] : null;
|
|
849
849
|
}(loaderContext), options = loader?.options;
|
|
850
|
-
if (
|
|
850
|
+
if ("string" == typeof options) if (options.startsWith("{") && options.endsWith("}")) try {
|
|
851
851
|
options = JSON.parse(options);
|
|
852
852
|
} catch (e) {
|
|
853
853
|
throw Error(`JSON parsing failed for loader's string options: ${e.message}`);
|
|
@@ -856,14 +856,14 @@ for(var __rspack_i in (()=>{
|
|
|
856
856
|
return null == options && (options = {}), options;
|
|
857
857
|
}, loaderContext.cacheable = function(flag) {
|
|
858
858
|
!1 === flag && sendRequest("SetCacheable", !1);
|
|
859
|
-
}, Object.defineProperty(loaderContext,
|
|
859
|
+
}, Object.defineProperty(loaderContext, "data", {
|
|
860
860
|
enumerable: !0,
|
|
861
861
|
get: ()=>loaderContext.loaders[loaderContext.loaderIndex].loaderItem.data,
|
|
862
862
|
set: (value)=>{
|
|
863
863
|
loaderContext.loaders[loaderContext.loaderIndex].loaderItem.data = value;
|
|
864
864
|
}
|
|
865
865
|
});
|
|
866
|
-
let shouldYieldToMainThread = (currentLoaderObject)=>!!(!currentLoaderObject?.parallel || currentLoaderObject?.request.startsWith(
|
|
866
|
+
let shouldYieldToMainThread = (currentLoaderObject)=>!!(!currentLoaderObject?.parallel || currentLoaderObject?.request.startsWith("builtin:"));
|
|
867
867
|
switch(loaderState){
|
|
868
868
|
case binding_.JsLoaderState.Pitching:
|
|
869
869
|
for(; loaderContext.loaderIndex < loaderContext.loaders.length;){
|
|
@@ -896,8 +896,8 @@ for(var __rspack_i in (()=>{
|
|
|
896
896
|
if (!raw && args[0] instanceof Uint8Array) {
|
|
897
897
|
var buf;
|
|
898
898
|
let isShared, str;
|
|
899
|
-
args[0] = (isShared = (buf = args[0]).buffer instanceof SharedArrayBuffer || buf.buffer.constructor?.name ===
|
|
900
|
-
} else raw &&
|
|
899
|
+
args[0] = (isShared = (buf = args[0]).buffer instanceof SharedArrayBuffer || buf.buffer.constructor?.name === "SharedArrayBuffer", 0xfeff === (str = decoder.decode(isShared ? Buffer.from(buf) : buf)).charCodeAt(0) ? str.slice(1) : str);
|
|
900
|
+
} else raw && "string" == typeof args[0] && (args[0] = Buffer.from(args[0], "utf-8"));
|
|
901
901
|
raw && args[0] instanceof Uint8Array && !Buffer.isBuffer(args[0]) && (args[0] = Buffer.from(args[0].buffer));
|
|
902
902
|
}(args, !!currentLoaderObject.raw), args = await utils_runSyncOrAsync(fn, loaderContext, args) || []);
|
|
903
903
|
}
|
|
@@ -914,7 +914,7 @@ for(var __rspack_i in (()=>{
|
|
|
914
914
|
let { id, data } = workerMessage, callback = responseCallbacks[id];
|
|
915
915
|
if (callback) delete responseCallbacks[id], callback(null, data);
|
|
916
916
|
else throw Error(`No callback found for response with id ${id}`);
|
|
917
|
-
} else if (
|
|
917
|
+
} else if ("response-error" === workerMessage.type) {
|
|
918
918
|
let { id, error } = workerMessage, callback = responseCallbacks[id];
|
|
919
919
|
if (callback) delete responseCallbacks[id], callback(error, void 0);
|
|
920
920
|
else throw Error(`No callback found for response with id ${id}`);
|
|
@@ -923,11 +923,11 @@ for(var __rspack_i in (()=>{
|
|
|
923
923
|
let loader_runner_worker = function(workerOptions) {
|
|
924
924
|
var workerPort, workerSyncPort, sendRequest, workerSyncPort1;
|
|
925
925
|
let sendRequest1, workerData = workerOptions.workerData;
|
|
926
|
-
delete workerOptions.workerData, workerData.workerPort.on(
|
|
926
|
+
delete workerOptions.workerData, workerData.workerPort.on("message", handleIncomingResponses);
|
|
927
927
|
let sendRequest2 = (workerPort = workerData.workerPort, workerSyncPort = workerData.workerSyncPort, (sendRequest1 = (requestType, ...args)=>{
|
|
928
928
|
let id = nextId++;
|
|
929
929
|
workerPort.postMessage({
|
|
930
|
-
type:
|
|
930
|
+
type: "request",
|
|
931
931
|
id,
|
|
932
932
|
requestType,
|
|
933
933
|
data: args
|
|
@@ -941,14 +941,14 @@ for(var __rspack_i in (()=>{
|
|
|
941
941
|
}).sync = (workerSyncPort1 = workerSyncPort, (requestType, ...args)=>{
|
|
942
942
|
let id = nextId++, sharedBuffer = new SharedArrayBuffer(8), sharedBufferView = new Int32Array(sharedBuffer);
|
|
943
943
|
workerSyncPort1.postMessage({
|
|
944
|
-
type:
|
|
944
|
+
type: "request-sync",
|
|
945
945
|
id,
|
|
946
946
|
requestType,
|
|
947
947
|
data: args,
|
|
948
948
|
sharedBuffer
|
|
949
949
|
});
|
|
950
950
|
let status = Atomics.wait(sharedBufferView, 0, 0);
|
|
951
|
-
if (
|
|
951
|
+
if ("ok" !== status && "not-equal" !== status) throw Error(`Internal error: Atomics.wait() failed: ${status}`);
|
|
952
952
|
let { message } = (0, external_node_worker_threads_namespaceObject.receiveMessageOnPort)(workerSyncPort1);
|
|
953
953
|
if (id !== message.id) throw Error(`Unexpected response id: ${message.id}, expected: ${id}`);
|
|
954
954
|
if (isWorkerResponseMessage(message)) return message.data;
|
|
@@ -958,12 +958,12 @@ for(var __rspack_i in (()=>{
|
|
|
958
958
|
]).map((request)=>request.id)));
|
|
959
959
|
loaderImpl(workerOptions, sendRequest2, waitFor).then(async (data)=>{
|
|
960
960
|
workerData.workerPort.postMessage({
|
|
961
|
-
type:
|
|
961
|
+
type: "done",
|
|
962
962
|
data
|
|
963
963
|
});
|
|
964
964
|
}).catch(async (err)=>{
|
|
965
965
|
workerData.workerPort.postMessage({
|
|
966
|
-
type:
|
|
966
|
+
type: "done-error",
|
|
967
967
|
error: serializeError(err)
|
|
968
968
|
});
|
|
969
969
|
});
|