@ohos-ports/rspack-core 2.2.2-beta.0 → 2.3.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/compiled/@rspack/lite-tapable/dist/index.d.ts +20 -6
- package/compiled/@rspack/lite-tapable/package.json +1 -1
- package/compiled/http-proxy-middleware/index.d.ts +10 -10
- package/compiled/http-proxy-middleware/package.json +1 -1
- package/compiled/open/package.json +1 -1
- package/compiled/tinypool/README.md +4 -4
- package/compiled/tinypool/dist/index.d.ts +3 -2
- package/compiled/tinypool/dist/index.js +3 -3
- package/compiled/tinypool/package.json +1 -1
- package/compiled/watchpack/index.js +276 -49
- package/compiled/watchpack/package.json +1 -1
- package/compiled/watchpack/types/DirectoryWatcher.d.ts +24 -0
- package/compiled/watchpack/types/index.d.ts +1 -1
- package/compiled/watchpack/types/watchEventSource.d.ts +9 -0
- package/compiled/webpack-sources/index.d.ts +61 -0
- package/compiled/webpack-sources/index.js +858 -224
- package/compiled/webpack-sources/package.json +8 -1
- package/compiled/webpack-sources/types/CachedSource.d.ts +192 -0
- package/compiled/webpack-sources/types/CompatSource.d.ts +87 -0
- package/compiled/webpack-sources/types/ConcatSource.d.ts +75 -0
- package/compiled/webpack-sources/types/OriginalSource.d.ts +87 -0
- package/compiled/webpack-sources/types/PrefixSource.d.ts +59 -0
- package/compiled/webpack-sources/types/RawSource.d.ts +75 -0
- package/compiled/webpack-sources/types/ReplaceSource.d.ts +107 -0
- package/compiled/webpack-sources/types/SizeOnlySource.d.ts +24 -0
- package/compiled/webpack-sources/types/Source.d.ts +189 -0
- package/compiled/webpack-sources/types/SourceMapSource.d.ts +136 -0
- package/compiled/webpack-sources/types/helpers/createMappingsSerializer.d.ts +60 -0
- package/compiled/webpack-sources/types/helpers/getFromStreamChunks.d.ts +16 -0
- package/compiled/webpack-sources/types/helpers/getGeneratedSourceInfo.d.ts +31 -0
- package/compiled/webpack-sources/types/helpers/getName.d.ts +15 -0
- package/compiled/webpack-sources/types/helpers/getSource.d.ts +15 -0
- package/compiled/webpack-sources/types/helpers/readMappings.d.ts +19 -0
- package/compiled/webpack-sources/types/helpers/scopes.d.ts +119 -0
- package/compiled/webpack-sources/types/helpers/splitIntoLines.d.ts +6 -0
- package/compiled/webpack-sources/types/helpers/splitIntoPotentialTokens.d.ts +37 -0
- package/compiled/webpack-sources/types/helpers/streamAndGetSourceAndMap.d.ts +39 -0
- package/compiled/webpack-sources/types/helpers/streamChunks.d.ts +56 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfCombinedSourceMap.d.ts +42 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfRawSource.d.ts +16 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfSourceMap.d.ts +19 -0
- package/compiled/webpack-sources/types/helpers/stringBufferUtils.d.ts +55 -0
- package/compiled/webpack-sources/types/index.d.ts +50 -0
- package/dist/BuildInfo.d.ts +13 -4
- package/dist/Chunk.d.ts +3 -3
- package/dist/ChunkGraph.d.ts +2 -2
- package/dist/Chunks.d.ts +2 -2
- package/dist/CodeGenerationResults.d.ts +6 -1
- package/dist/Compilation.d.ts +16 -53
- package/dist/Compiler.d.ts +9 -10
- package/dist/ConcatenatedModule.d.ts +5 -1
- package/dist/ContextModule.d.ts +3 -1
- package/dist/Diagnostics.d.ts +2 -6
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/ExternalModule.d.ts +7 -6
- package/dist/FileSystem.d.ts +3 -1
- package/dist/FileSystemDependencies.d.ts +15 -0
- package/dist/FileSystemInfo.d.ts +1 -0
- package/dist/Module.d.ts +19 -11
- package/dist/ModuleGraph.d.ts +6 -6
- package/dist/ModuleGraphConnection.d.ts +9 -3
- package/dist/Modules.d.ts +3 -0
- package/dist/NativeWatchFileSystem.d.ts +20 -8
- package/dist/NormalModule.d.ts +14 -6
- package/dist/NormalModuleFactory.d.ts +2 -1
- package/dist/Resolver.d.ts +10 -2
- package/dist/ResolverFactory.d.ts +1 -1
- package/dist/RspackError.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +4 -3
- package/dist/RuntimeModule.d.ts +1 -1
- package/dist/RuntimeTemplate.d.ts +1 -0
- package/dist/Stats.d.ts +1 -1
- package/dist/builtin-loader/lightningcss/target.d.ts +1 -1
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +2 -2
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +2 -2
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +5 -4
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +5 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +2 -2
- package/dist/builtin-plugin/ImportedByDeferModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/InlineExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RslibPlugin.d.ts +4 -4
- package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +3 -2
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/URLPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/index.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/utils.d.ts +4 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +2 -2
- package/dist/builtin-plugin/index.d.ts +1 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +3 -3
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +1 -1
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +1 -1
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +3 -2
- package/dist/config/normalization.d.ts +5 -8
- package/dist/config/target.d.ts +2 -0
- package/dist/config/types.d.ts +104 -19
- package/dist/container/ContainerPlugin.d.ts +1 -1
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/container/ModuleFederationManifestPlugin.d.ts +1 -1
- package/dist/container/ModuleFederationPluginV1.d.ts +5 -1
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/cssExtractHmr.js +1 -1
- package/dist/cssExtractLoader.js +7 -5
- package/dist/exports.d.ts +7 -7
- package/dist/index.js +1845 -1070
- package/dist/lib/Cache.d.ts +3 -0
- package/dist/lib/DllReferencePlugin.d.ts +1 -1
- package/dist/lib/WebpackError.d.ts +1 -1
- package/dist/loader-runner/codeFilter.d.ts +9 -0
- package/dist/loader-runner/dependencies.d.ts +5 -4
- package/dist/loader-runner/index.d.ts +3 -2
- package/dist/loader-runner/service.d.ts +6 -5
- package/dist/loader-runner/worker.d.ts +5 -2
- package/dist/l~0.js +34 -0
- package/dist/l~3.js +34 -0
- package/dist/node/NodeWatchFileSystem.d.ts +7 -4
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +1 -1
- package/dist/sharing/ConsumeSharedPlugin.d.ts +1 -1
- package/dist/sharing/ProvideSharedPlugin.d.ts +1 -1
- package/dist/sharing/SharePlugin.d.ts +13 -1
- package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
- package/dist/sharing/SharedContainerPlugin.d.ts +1 -1
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +2 -2
- package/dist/sources.d.ts +3 -0
- package/dist/stats/StatsFactory.d.ts +4 -2
- package/dist/stats/StatsPrinter.d.ts +5 -5
- package/dist/stats/statsFactoryUtils.d.ts +12 -6
- package/dist/swc.d.ts +1 -1
- package/dist/taps/compilation.d.ts +1 -1
- package/dist/taps/types.d.ts +1 -1
- package/dist/util/SplitChunkSize.d.ts +1 -1
- package/dist/util/bindingHelpers.d.ts +9 -0
- package/dist/util/createModule.d.ts +3 -0
- package/dist/util/fs.d.ts +22 -16
- package/dist/util/resolveLayerExternals.d.ts +1 -0
- package/dist/util/source.d.ts +13 -4
- package/dist/util/symbols.d.ts +10 -0
- package/dist/util/watchTimeInfo.d.ts +11 -0
- package/dist/worker.js +386 -353
- package/hot/lazy-compilation-node.js +1 -1
- package/hot/lazy-compilation-web.js +1 -1
- package/package.json +8 -32
- package/compiled/webpack-sources/types.d.ts +0 -500
- package/dist/612~0.js +0 -32
- package/dist/612~3.js +0 -32
- package/dist/loader-runner/cache.d.ts +0 -18
- package/dist/util/MergeCaller.d.ts +0 -10
- package/dist/util/fake.d.ts +0 -11
package/dist/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
let _computedKey, _computedKey1, _computedKey2, createMd4, createXxhash64, service_pool, loadLoader_url, ArrayQueue_computedKey;
|
|
1
|
+
let _computedKey, _computedKey1, _computedKey2, FileSystemDependencies_computedKey, FileSystemDependencies_computedKey1, FileSystemDependencies_computedKey2, Compilation_computedKey, Compilation_computedKey1, createMd4, createXxhash64, service_pool, loadLoader_url, ArrayQueue_computedKey;
|
|
2
|
+
import { rspackRequire, moduleFactories, definePropertyGetters, makeNamespaceObject, compatGetDefaultExport } from "./l~0.js";
|
|
2
3
|
import node_util, { inspect, promisify } from "node:util";
|
|
3
4
|
import { createRequire, createRequire as __rspack_createRequire } from "node:module";
|
|
4
5
|
import node_path, { isAbsolute, join, relative, resolve as external_node_path_resolve, sep } from "node:path";
|
|
5
6
|
import node_fs, { readFileSync } from "node:fs";
|
|
6
7
|
import node_querystring from "node:querystring";
|
|
8
|
+
import { MessageChannel } from "node:worker_threads";
|
|
7
9
|
import { EventEmitter } from "node:events";
|
|
8
|
-
import { __webpack_require__ } from "./612~0.js";
|
|
9
10
|
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
10
11
|
import * as __rspack_external_node_util_ac04460e from "node:util";
|
|
11
|
-
|
|
12
|
-
"../../node_modules/.pnpm/enhanced-resolve@5.
|
|
13
|
-
let firstCallback, firstResult, { nextTick } =
|
|
12
|
+
moduleFactories.add({
|
|
13
|
+
"../../node_modules/.pnpm/enhanced-resolve@5.26.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module) {
|
|
14
|
+
let firstCallback, firstResult, { nextTick } = __rspack_createRequire_require("process"), dirname = (path)=>{
|
|
14
15
|
let idx = path.length - 1;
|
|
15
16
|
for(; idx >= 0;){
|
|
16
17
|
let char = path.charCodeAt(idx);
|
|
@@ -280,9 +281,6 @@ __webpack_require__.add({
|
|
|
280
281
|
"node:https" (module) {
|
|
281
282
|
module.exports = __rspack_createRequire_require("node:https");
|
|
282
283
|
},
|
|
283
|
-
"node:os" (module) {
|
|
284
|
-
module.exports = __rspack_createRequire_require("node:os");
|
|
285
|
-
},
|
|
286
284
|
"node:url" (module) {
|
|
287
285
|
module.exports = __rspack_createRequire_require("node:url");
|
|
288
286
|
},
|
|
@@ -291,17 +289,14 @@ __webpack_require__.add({
|
|
|
291
289
|
},
|
|
292
290
|
"node:zlib" (module) {
|
|
293
291
|
module.exports = __rspack_createRequire_require("node:zlib");
|
|
294
|
-
},
|
|
295
|
-
process (module) {
|
|
296
|
-
module.exports = __rspack_createRequire_require("process");
|
|
297
292
|
}
|
|
298
293
|
});
|
|
299
294
|
var RuntimeGlobals, key, StatsErrorCode, browserslistTargetHandler_namespaceObject = {};
|
|
300
|
-
|
|
295
|
+
makeNamespaceObject(browserslistTargetHandler_namespaceObject), definePropertyGetters(browserslistTargetHandler_namespaceObject, {
|
|
301
296
|
resolve: ()=>browserslistTargetHandler_resolve
|
|
302
297
|
});
|
|
303
298
|
var exports_namespaceObject = {};
|
|
304
|
-
|
|
299
|
+
makeNamespaceObject(exports_namespaceObject), definePropertyGetters(exports_namespaceObject, {
|
|
305
300
|
AsyncDependenciesBlock: ()=>binding_.AsyncDependenciesBlock,
|
|
306
301
|
BannerPlugin: ()=>BannerPlugin,
|
|
307
302
|
CaseSensitivePlugin: ()=>CaseSensitivePlugin,
|
|
@@ -309,8 +304,8 @@ __webpack_require__.r(exports_namespaceObject), __webpack_require__.d(exports_na
|
|
|
309
304
|
CircularDependencyRspackPlugin: ()=>CircularDependencyRspackPlugin,
|
|
310
305
|
Compilation: ()=>Compilation,
|
|
311
306
|
Compiler: ()=>Compiler,
|
|
312
|
-
ConcatenatedModule: ()=>
|
|
313
|
-
ContextModule: ()=>
|
|
307
|
+
ConcatenatedModule: ()=>ConcatenatedModule,
|
|
308
|
+
ContextModule: ()=>ContextModule,
|
|
314
309
|
ContextReplacementPlugin: ()=>ContextReplacementPlugin,
|
|
315
310
|
CopyRspackPlugin: ()=>CopyRspackPlugin,
|
|
316
311
|
CssExtractRspackPlugin: ()=>CssExtractRspackPlugin,
|
|
@@ -333,13 +328,13 @@ __webpack_require__.r(exports_namespaceObject), __webpack_require__.d(exports_na
|
|
|
333
328
|
LightningCssMinimizerRspackPlugin: ()=>LightningCssMinimizerRspackPlugin,
|
|
334
329
|
LoaderOptionsPlugin: ()=>LoaderOptionsPlugin,
|
|
335
330
|
LoaderTargetPlugin: ()=>LoaderTargetPlugin,
|
|
336
|
-
Module: ()=>
|
|
331
|
+
Module: ()=>Module_Module,
|
|
337
332
|
ModuleFilenameHelpers: ()=>ModuleFilenameHelpers_namespaceObject,
|
|
338
333
|
ModuleGraphConnection: ()=>ModuleGraphConnection,
|
|
339
334
|
MultiCompiler: ()=>MultiCompiler,
|
|
340
335
|
MultiStats: ()=>MultiStats,
|
|
341
336
|
NoEmitOnErrorsPlugin: ()=>NoEmitOnErrorsPlugin,
|
|
342
|
-
NormalModule: ()=>
|
|
337
|
+
NormalModule: ()=>NormalModule,
|
|
343
338
|
NormalModuleReplacementPlugin: ()=>NormalModuleReplacementPlugin,
|
|
344
339
|
ProgressPlugin: ()=>ProgressPlugin,
|
|
345
340
|
ProvidePlugin: ()=>ProvidePlugin,
|
|
@@ -369,7 +364,7 @@ __webpack_require__.r(exports_namespaceObject), __webpack_require__.d(exports_na
|
|
|
369
364
|
optimize: ()=>optimize,
|
|
370
365
|
rspackVersion: ()=>exports_rspackVersion,
|
|
371
366
|
sharing: ()=>sharing,
|
|
372
|
-
sources: ()=>
|
|
367
|
+
sources: ()=>sources_namespaceObject,
|
|
373
368
|
util: ()=>util,
|
|
374
369
|
version: ()=>exports_version,
|
|
375
370
|
wasm: ()=>exports_wasm,
|
|
@@ -377,6 +372,12 @@ __webpack_require__.r(exports_namespaceObject), __webpack_require__.d(exports_na
|
|
|
377
372
|
webworker: ()=>webworker
|
|
378
373
|
});
|
|
379
374
|
var ModuleFilenameHelpers_namespaceObject = {};
|
|
375
|
+
makeNamespaceObject(ModuleFilenameHelpers_namespaceObject), definePropertyGetters(ModuleFilenameHelpers_namespaceObject, {
|
|
376
|
+
asRegExp: ()=>asRegExp,
|
|
377
|
+
matchObject: ()=>matchObject,
|
|
378
|
+
matchPart: ()=>matchPart
|
|
379
|
+
});
|
|
380
|
+
var sources_namespaceObject = {};
|
|
380
381
|
function _define_property(obj, key, value) {
|
|
381
382
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
382
383
|
value: value,
|
|
@@ -385,10 +386,18 @@ function _define_property(obj, key, value) {
|
|
|
385
386
|
writable: !0
|
|
386
387
|
}) : obj[key] = value, obj;
|
|
387
388
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
389
|
+
makeNamespaceObject(sources_namespaceObject), definePropertyGetters(sources_namespaceObject, {
|
|
390
|
+
CachedSource: ()=>index_js_namespaceObject.CachedSource,
|
|
391
|
+
CompatSource: ()=>index_js_namespaceObject.CompatSource,
|
|
392
|
+
ConcatSource: ()=>RspackConcatSource,
|
|
393
|
+
OriginalSource: ()=>index_js_namespaceObject.OriginalSource,
|
|
394
|
+
PrefixSource: ()=>index_js_namespaceObject.PrefixSource,
|
|
395
|
+
RawSource: ()=>index_js_namespaceObject.RawSource,
|
|
396
|
+
ReplaceSource: ()=>RspackReplaceSource,
|
|
397
|
+
SizeOnlySource: ()=>index_js_namespaceObject.SizeOnlySource,
|
|
398
|
+
Source: ()=>index_js_namespaceObject.Source,
|
|
399
|
+
SourceMapSource: ()=>index_js_namespaceObject.SourceMapSource,
|
|
400
|
+
util: ()=>index_js_namespaceObject.util
|
|
392
401
|
}), !function() {
|
|
393
402
|
let { node, bun, deno } = process.versions;
|
|
394
403
|
if (!node || bun || deno) return;
|
|
@@ -500,12 +509,22 @@ class HookBase {
|
|
|
500
509
|
}
|
|
501
510
|
this.taps[i] = item;
|
|
502
511
|
}
|
|
512
|
+
_tapsInAllStages() {
|
|
513
|
+
let cached = this._allStageTaps;
|
|
514
|
+
if (void 0 !== cached && cached.source === this.taps && cached.length === this.taps.length) return cached.taps;
|
|
515
|
+
let taps = this.queryStageRange(allStageRange).tapsInRange;
|
|
516
|
+
return this._allStageTaps = {
|
|
517
|
+
source: this.taps,
|
|
518
|
+
length: this.taps.length,
|
|
519
|
+
taps
|
|
520
|
+
}, taps;
|
|
521
|
+
}
|
|
503
522
|
_prepareArgs(args) {
|
|
504
523
|
let len = this.args.length;
|
|
505
524
|
return args.length < len ? (args.length = len, args.fill(void 0, args.length, len)) : (args.length > len && (args.length = len), args);
|
|
506
525
|
}
|
|
507
526
|
constructor(args = [], name){
|
|
508
|
-
_define_property(this, "args", void 0), _define_property(this, "name", void 0), _define_property(this, "taps", void 0), _define_property(this, "interceptors", void 0), this.args = args, this.name = name, this.taps = [], this.interceptors = [];
|
|
527
|
+
_define_property(this, "args", void 0), _define_property(this, "name", void 0), _define_property(this, "taps", void 0), _define_property(this, "interceptors", void 0), _define_property(this, "_allStageTaps", void 0), this.args = args, this.name = name, this.taps = [], this.interceptors = [], this._allStageTaps = void 0;
|
|
509
528
|
}
|
|
510
529
|
}
|
|
511
530
|
let allStageRange = [
|
|
@@ -550,7 +569,13 @@ class SyncHook extends HookBase {
|
|
|
550
569
|
1 / 0 === to && (this._runDoneInterceptors(), cb(null));
|
|
551
570
|
}
|
|
552
571
|
call(...args) {
|
|
553
|
-
return this.callStageRange(this.queryStageRange(allStageRange), ...args);
|
|
572
|
+
if (this.interceptors.length > 0) return this.callStageRange(this.queryStageRange(allStageRange), ...args);
|
|
573
|
+
let taps = this._tapsInAllStages(), args2 = this._prepareArgs(args);
|
|
574
|
+
try {
|
|
575
|
+
for(let i = 0; i < taps.length; i++)taps[i].fn(...args2);
|
|
576
|
+
} catch (e) {
|
|
577
|
+
if (e) throw e;
|
|
578
|
+
}
|
|
554
579
|
}
|
|
555
580
|
callStageRange(queried, ...args) {
|
|
556
581
|
let result, error;
|
|
@@ -582,7 +607,16 @@ class SyncBailHook extends HookBase {
|
|
|
582
607
|
1 / 0 === to && (this._runDoneInterceptors(), cb(null));
|
|
583
608
|
}
|
|
584
609
|
call(...args) {
|
|
585
|
-
return this.callStageRange(this.queryStageRange(allStageRange), ...args);
|
|
610
|
+
if (this.interceptors.length > 0) return this.callStageRange(this.queryStageRange(allStageRange), ...args);
|
|
611
|
+
let taps = this._tapsInAllStages(), args2 = this._prepareArgs(args);
|
|
612
|
+
try {
|
|
613
|
+
for(let i = 0; i < taps.length; i++){
|
|
614
|
+
let r = taps[i].fn(...args2);
|
|
615
|
+
if (void 0 !== r) return r;
|
|
616
|
+
}
|
|
617
|
+
} catch (e) {
|
|
618
|
+
if (e) throw e;
|
|
619
|
+
}
|
|
586
620
|
}
|
|
587
621
|
callStageRange(queried, ...args) {
|
|
588
622
|
let result, error;
|
|
@@ -613,7 +647,18 @@ class SyncWaterfallHook extends HookBase {
|
|
|
613
647
|
1 / 0 === to && (this._runDoneInterceptors(), cb(null, args2[0]));
|
|
614
648
|
}
|
|
615
649
|
call(...args) {
|
|
616
|
-
return this.callStageRange(this.queryStageRange(allStageRange), ...args);
|
|
650
|
+
if (this.interceptors.length > 0) return this.callStageRange(this.queryStageRange(allStageRange), ...args);
|
|
651
|
+
let taps = this._tapsInAllStages(), args2 = this._prepareArgs(args);
|
|
652
|
+
try {
|
|
653
|
+
for(let i = 0; i < taps.length; i++){
|
|
654
|
+
let r = taps[i].fn(...args2);
|
|
655
|
+
void 0 !== r && (args2[0] = r);
|
|
656
|
+
}
|
|
657
|
+
} catch (e) {
|
|
658
|
+
if (e) throw e;
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
return args2[0];
|
|
617
662
|
}
|
|
618
663
|
callStageRange(queried, ...args) {
|
|
619
664
|
let result, error;
|
|
@@ -860,8 +905,8 @@ class MultiHook {
|
|
|
860
905
|
_define_property(this, "hooks", void 0), _define_property(this, "name", void 0), this.hooks = hooks, this.name = name;
|
|
861
906
|
}
|
|
862
907
|
}
|
|
863
|
-
let binding_ =
|
|
864
|
-
var binding__default =
|
|
908
|
+
let binding_ = rspackRequire("@ohos-ports/rspack-binding");
|
|
909
|
+
var binding__default = compatGetDefaultExport(binding_), AsyncDependenciesBlock = binding_.AsyncDependenciesBlock, Dependency = binding_.Dependency, EntryDependency = binding_.EntryDependency;
|
|
865
910
|
Object.defineProperty(binding_.Chunk.prototype, 'files', {
|
|
866
911
|
enumerable: !0,
|
|
867
912
|
configurable: !0,
|
|
@@ -1327,6 +1372,9 @@ class RuntimeTemplate {
|
|
|
1327
1372
|
supportTemplateLiteral() {
|
|
1328
1373
|
return !!this.#environment.templateLiteral;
|
|
1329
1374
|
}
|
|
1375
|
+
supportsTopLevelAwait() {
|
|
1376
|
+
return !!this.#environment.topLevelAwait;
|
|
1377
|
+
}
|
|
1330
1378
|
supportNodePrefixForCoreModules() {
|
|
1331
1379
|
return !!this.#environment.nodePrefixForCoreModules;
|
|
1332
1380
|
}
|
|
@@ -1570,6 +1618,7 @@ class StatsFactory {
|
|
|
1570
1618
|
hooks;
|
|
1571
1619
|
_caches;
|
|
1572
1620
|
_inCreate;
|
|
1621
|
+
_itemTypes;
|
|
1573
1622
|
constructor(){
|
|
1574
1623
|
this.hooks = Object.freeze({
|
|
1575
1624
|
extract: new HookMap(()=>new SyncBailHook([
|
|
@@ -1626,7 +1675,14 @@ class StatsFactory {
|
|
|
1626
1675
|
});
|
|
1627
1676
|
let hooks = this.hooks, caches = {};
|
|
1628
1677
|
for (let key of Object.keys(hooks))caches[key] = new Map();
|
|
1629
|
-
this._caches = caches, this._inCreate = !1;
|
|
1678
|
+
this._caches = caches, this._inCreate = !1, this._itemTypes = new Map();
|
|
1679
|
+
}
|
|
1680
|
+
_getItemTypes(type) {
|
|
1681
|
+
let itemTypes = this._itemTypes.get(type);
|
|
1682
|
+
return void 0 === itemTypes && (itemTypes = {
|
|
1683
|
+
itemType: `${type}[]`,
|
|
1684
|
+
innerTypeByItemName: new Map()
|
|
1685
|
+
}, this._itemTypes.set(type, itemTypes)), itemTypes;
|
|
1630
1686
|
}
|
|
1631
1687
|
_getAllLevelHooks(hookMap, cache, type) {
|
|
1632
1688
|
let cacheEntry = cache.get(type);
|
|
@@ -1677,13 +1733,16 @@ class StatsFactory {
|
|
|
1677
1733
|
if (Array.isArray(data)) {
|
|
1678
1734
|
let items = this._forEachLevelFilter(this.hooks.filter, this._caches.filter, type, data, (h, r, idx, i)=>h.call(r, context, idx, i), !0), comparators = [];
|
|
1679
1735
|
this._forEachLevel(this.hooks.sort, this._caches.sort, type, (h)=>h.call(comparators, context)), comparators.length > 0 && items.sort(concatComparators(...comparators));
|
|
1680
|
-
let
|
|
1736
|
+
let items2 = this._forEachLevelFilter(this.hooks.filterSorted, this._caches.filterSorted, type, items, (h, r, idx, i)=>h.call(r, context, idx, i), !1), itemTypes = this._getItemTypes(type), resultItems = items2.map((item, i)=>{
|
|
1681
1737
|
let itemContext = {
|
|
1682
1738
|
...context,
|
|
1683
1739
|
_index: i
|
|
1684
|
-
}, itemName = this._forEachLevel(this.hooks.getItemName, this._caches.getItemName,
|
|
1685
|
-
|
|
1686
|
-
|
|
1740
|
+
}, itemName = this._forEachLevel(this.hooks.getItemName, this._caches.getItemName, itemTypes.itemType, (h)=>h.call(item, itemContext)), innerType = itemTypes.itemType;
|
|
1741
|
+
if (itemName) {
|
|
1742
|
+
itemContext[itemName] = item;
|
|
1743
|
+
let namedType = itemTypes.innerTypeByItemName.get(itemName);
|
|
1744
|
+
void 0 === namedType && (namedType = `${itemTypes.itemType}.${itemName}`, itemTypes.innerTypeByItemName.set(itemName, namedType)), innerType = namedType;
|
|
1745
|
+
}
|
|
1687
1746
|
return (this._forEachLevel(this.hooks.getItemFactory, this._caches.getItemFactory, innerType, (h)=>h.call(item, itemContext)) || this).create(innerType, item, itemContext);
|
|
1688
1747
|
}), comparators2 = [];
|
|
1689
1748
|
this._forEachLevel(this.hooks.sortResults, this._caches.sortResults, type, (h)=>h.call(comparators2, context)), comparators2.length > 0 && resultItems.sort(concatComparators(...comparators2));
|
|
@@ -1917,72 +1976,181 @@ function createReadonlyMap(obj) {
|
|
|
1917
1976
|
}
|
|
1918
1977
|
};
|
|
1919
1978
|
}
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1979
|
+
function _to_property_key(arg) {
|
|
1980
|
+
var key = function(input, hint) {
|
|
1981
|
+
if ("object" !== _type_of(input) || null === input) return input;
|
|
1982
|
+
var prim = input[Symbol.toPrimitive];
|
|
1983
|
+
if (void 0 !== prim) {
|
|
1984
|
+
var res = prim.call(input, hint || "default");
|
|
1985
|
+
if ("object" !== _type_of(res)) return res;
|
|
1986
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
1987
|
+
}
|
|
1988
|
+
return ("string" === hint ? String : Number)(input);
|
|
1989
|
+
}(arg, "string");
|
|
1990
|
+
return "symbol" === _type_of(key) ? key : String(key);
|
|
1991
|
+
}
|
|
1992
|
+
function _type_of(obj) {
|
|
1993
|
+
return obj && "u" > typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
1994
|
+
}
|
|
1995
|
+
_computedKey = _to_property_key(Symbol.iterator), _computedKey1 = _to_property_key(Symbol.toStringTag), _computedKey2 = _to_property_key(node_util.inspect.custom);
|
|
1996
|
+
class ModulesWrapper {
|
|
1997
|
+
#inner;
|
|
1998
|
+
constructor(inner){
|
|
1999
|
+
this.#inner = inner;
|
|
1925
2000
|
}
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
2001
|
+
get size() {
|
|
2002
|
+
return this.#inner.size();
|
|
2003
|
+
}
|
|
2004
|
+
has(value) {
|
|
2005
|
+
return this.#inner.has(value);
|
|
2006
|
+
}
|
|
2007
|
+
keys() {
|
|
2008
|
+
return this.values();
|
|
2009
|
+
}
|
|
2010
|
+
values() {
|
|
2011
|
+
return this.#inner.values().values();
|
|
2012
|
+
}
|
|
2013
|
+
*entries() {
|
|
2014
|
+
for (let value of this.#inner.values())yield [
|
|
2015
|
+
value,
|
|
2016
|
+
value
|
|
2017
|
+
];
|
|
1932
2018
|
}
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
for(let i = 0; i < data.length; i++)this.callArgs.push(data[i]);
|
|
2019
|
+
*[_computedKey]() {
|
|
2020
|
+
yield* this.#inner.values();
|
|
1936
2021
|
}
|
|
2022
|
+
forEach(callback, thisArg) {
|
|
2023
|
+
if ('function' != typeof callback) throw TypeError('callback must be a function');
|
|
2024
|
+
for (let value of this.#inner.values())callback.call(thisArg, value, value, this);
|
|
2025
|
+
}
|
|
2026
|
+
get [_computedKey1]() {
|
|
2027
|
+
return 'Set';
|
|
2028
|
+
}
|
|
2029
|
+
[_computedKey2]() {
|
|
2030
|
+
return new Set(this.values());
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
for (let name of [
|
|
2034
|
+
'union',
|
|
2035
|
+
'intersection',
|
|
2036
|
+
'difference',
|
|
2037
|
+
'symmetricDifference',
|
|
2038
|
+
'isSubsetOf',
|
|
2039
|
+
'isSupersetOf',
|
|
2040
|
+
'isDisjointFrom'
|
|
2041
|
+
]){
|
|
2042
|
+
let method = Reflect.get(Set.prototype, name);
|
|
2043
|
+
'function' == typeof method && Object.defineProperty(ModulesWrapper.prototype, name, {
|
|
2044
|
+
configurable: !0,
|
|
2045
|
+
writable: !0,
|
|
2046
|
+
value (other) {
|
|
2047
|
+
return method.call(new Set(this.values()), other);
|
|
2048
|
+
}
|
|
2049
|
+
});
|
|
1937
2050
|
}
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
2051
|
+
let index_js_namespaceObject = __rspack_createRequire_require("../compiled/webpack-sources/index.js"), sourceCacheSymbol = Symbol.for('rspack.originalSource'), nativeSources = new WeakMap(), toBindingSource = Symbol('rspack.toBindingSource'), sourceMapOverrides = new WeakMap();
|
|
2052
|
+
function toSourceGraph(source) {
|
|
2053
|
+
let native = nativeSources.get(source);
|
|
2054
|
+
return native ? {
|
|
2055
|
+
kind: 'native',
|
|
2056
|
+
handle: native
|
|
2057
|
+
} : source[toBindingSource]?.call(source) ?? serializeSource(source);
|
|
2058
|
+
}
|
|
2059
|
+
function serializeSource(source) {
|
|
2060
|
+
let content = source.source();
|
|
2061
|
+
if (Buffer.isBuffer(content)) return {
|
|
2062
|
+
kind: 'raw',
|
|
2063
|
+
content
|
|
1945
2064
|
};
|
|
2065
|
+
let map = source.map?.({
|
|
2066
|
+
columns: !0
|
|
2067
|
+
});
|
|
1946
2068
|
return {
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
has: hasDep,
|
|
1951
|
-
add: (dep)=>{
|
|
1952
|
-
deletedDeps.delete(dep), addDepsCaller.push(dep);
|
|
1953
|
-
},
|
|
1954
|
-
addAll: (deps)=>{
|
|
1955
|
-
for (let dep of deps)deletedDeps.delete(dep), addDepsCaller.push(dep);
|
|
1956
|
-
},
|
|
1957
|
-
delete: (dep)=>{
|
|
1958
|
-
let hadDep = hasDep(dep);
|
|
1959
|
-
return hadDep && deletedDeps.add(dep), hadDep;
|
|
1960
|
-
},
|
|
1961
|
-
keys: ()=>getAllDeps().keys(),
|
|
1962
|
-
values: ()=>getAllDeps().values(),
|
|
1963
|
-
entries: ()=>getAllDeps().entries(),
|
|
1964
|
-
get size () {
|
|
1965
|
-
return getAllDeps().size;
|
|
1966
|
-
}
|
|
2069
|
+
kind: 'raw',
|
|
2070
|
+
content,
|
|
2071
|
+
map: map ? JSON.stringify(map) : void 0
|
|
1967
2072
|
};
|
|
1968
2073
|
}
|
|
1969
|
-
|
|
2074
|
+
function replaceSourceMap(source, value) {
|
|
2075
|
+
return !!Object.getOwnPropertyDescriptor(source, '_sourceMapAsString')?.configurable && (Object.defineProperty(source, '_sourceMapAsString', {
|
|
2076
|
+
value,
|
|
2077
|
+
writable: !0,
|
|
2078
|
+
configurable: !0,
|
|
2079
|
+
enumerable: !0
|
|
2080
|
+
}), delete source[sourceCacheSymbol], !0);
|
|
2081
|
+
}
|
|
2082
|
+
function setSourceMap(value) {
|
|
2083
|
+
if (!replaceSourceMap(this, value)) {
|
|
2084
|
+
if (Object.isFrozen(this)) throw TypeError("Cannot assign to read only property '_sourceMapAsString'");
|
|
2085
|
+
sourceMapOverrides.set(this, {
|
|
2086
|
+
value
|
|
2087
|
+
});
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
function getSourceMap() {
|
|
2091
|
+
let override = sourceMapOverrides.get(this);
|
|
2092
|
+
if (override) return override.value;
|
|
2093
|
+
let cache = this[sourceCacheSymbol];
|
|
2094
|
+
if (!cache) return this._sourceMapAsString;
|
|
2095
|
+
let map = cache.map, json = 'string' == typeof map ? map : map();
|
|
2096
|
+
return cache.map = json, replaceSourceMap(this, json), json;
|
|
2097
|
+
}
|
|
2098
|
+
function clearSourceCache(options, visited) {
|
|
2099
|
+
'function' == typeof this[sourceCacheSymbol]?.map && (options = {
|
|
2100
|
+
...options,
|
|
2101
|
+
maps: !1
|
|
2102
|
+
}), index_js_namespaceObject.SourceMapSource.prototype.clearCache.call(this, options, visited);
|
|
2103
|
+
}
|
|
2104
|
+
class RspackConcatSource extends index_js_namespaceObject.ConcatSource {
|
|
2105
|
+
[toBindingSource]() {
|
|
2106
|
+
return Object.getPrototypeOf(this) !== RspackConcatSource.prototype ? null : {
|
|
2107
|
+
kind: 'concat',
|
|
2108
|
+
children: this.getChildren().map(toSourceGraph)
|
|
2109
|
+
};
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
class RspackReplaceSource extends index_js_namespaceObject.ReplaceSource {
|
|
2113
|
+
[toBindingSource]() {
|
|
2114
|
+
return Object.getPrototypeOf(this) !== RspackReplaceSource.prototype ? null : {
|
|
2115
|
+
kind: 'replace',
|
|
2116
|
+
original: toSourceGraph(this.original()),
|
|
2117
|
+
replacements: this.getReplacements(),
|
|
2118
|
+
fallback: ()=>serializeSource(this)
|
|
2119
|
+
};
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
1970
2122
|
class SourceAdapter {
|
|
1971
|
-
static fromBinding(
|
|
1972
|
-
|
|
2123
|
+
static fromBinding(cache, nativeSource) {
|
|
2124
|
+
let source;
|
|
2125
|
+
if (cache.map) if ('string' == typeof cache.map) source = new index_js_namespaceObject.SourceMapSource(cache.source, 'inmemory://from rust', cache.map);
|
|
2126
|
+
else {
|
|
2127
|
+
let sourceMapSource = new index_js_namespaceObject.SourceMapSource(cache.source, 'inmemory://from rust');
|
|
2128
|
+
sourceMapSource._hasSourceMap = !0, Object.defineProperties(sourceMapSource, {
|
|
2129
|
+
[sourceCacheSymbol]: {
|
|
2130
|
+
value: cache,
|
|
2131
|
+
configurable: !0
|
|
2132
|
+
},
|
|
2133
|
+
clearCache: {
|
|
2134
|
+
value: clearSourceCache,
|
|
2135
|
+
writable: !0,
|
|
2136
|
+
configurable: !0
|
|
2137
|
+
},
|
|
2138
|
+
_sourceMapAsString: {
|
|
2139
|
+
get: getSourceMap,
|
|
2140
|
+
set: setSourceMap,
|
|
2141
|
+
configurable: !0,
|
|
2142
|
+
enumerable: !0
|
|
2143
|
+
}
|
|
2144
|
+
}), source = sourceMapSource;
|
|
2145
|
+
}
|
|
2146
|
+
else source = new index_js_namespaceObject.RawSource(cache.source);
|
|
2147
|
+
return nativeSource && nativeSources.set(source, nativeSource), source;
|
|
1973
2148
|
}
|
|
1974
2149
|
static toBinding(source) {
|
|
1975
|
-
let
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
};
|
|
1980
|
-
let map = source.map?.({
|
|
1981
|
-
columns: !0
|
|
1982
|
-
});
|
|
1983
|
-
return {
|
|
1984
|
-
source: content,
|
|
1985
|
-
map: map ? JSON.stringify(map) : void 0
|
|
2150
|
+
let graph = toSourceGraph(source);
|
|
2151
|
+
return 'raw' === graph.kind || 'native' === graph.kind ? graph : {
|
|
2152
|
+
kind: 'native',
|
|
2153
|
+
handle: binding__default().JsNativeSource.fromSource(graph)
|
|
1986
2154
|
};
|
|
1987
2155
|
}
|
|
1988
2156
|
}
|
|
@@ -2077,9 +2245,10 @@ Object.defineProperty(binding_.Chunks.prototype, 'entries', {
|
|
|
2077
2245
|
return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
|
|
2078
2246
|
}
|
|
2079
2247
|
});
|
|
2080
|
-
let
|
|
2248
|
+
let proxies = new WeakMap();
|
|
2081
2249
|
function createDiagnosticArray(adm) {
|
|
2082
|
-
|
|
2250
|
+
let cached = proxies.get(adm);
|
|
2251
|
+
if (cached) return cached;
|
|
2083
2252
|
let array = [];
|
|
2084
2253
|
array[node_util.inspect.custom] = ()=>adm.values();
|
|
2085
2254
|
let splice = function(index, deleteCount, ...newItems) {
|
|
@@ -2126,22 +2295,129 @@ function createDiagnosticArray(adm) {
|
|
|
2126
2295
|
return 'symbol' == typeof name || Number.isNaN(Number.parseInt(name, 10)) ? target[name] = value : adm.set(Number.parseInt(name, 10), value), !0;
|
|
2127
2296
|
}
|
|
2128
2297
|
});
|
|
2129
|
-
return adm
|
|
2298
|
+
return proxies.set(adm, proxy), proxy;
|
|
2130
2299
|
}
|
|
2131
|
-
function
|
|
2300
|
+
function FileSystemDependencies_to_property_key(arg) {
|
|
2132
2301
|
var key = function(input, hint) {
|
|
2133
|
-
if ("object" !==
|
|
2302
|
+
if ("object" !== FileSystemDependencies_type_of(input) || null === input) return input;
|
|
2134
2303
|
var prim = input[Symbol.toPrimitive];
|
|
2135
2304
|
if (void 0 !== prim) {
|
|
2136
2305
|
var res = prim.call(input, hint || "default");
|
|
2137
|
-
if ("object" !==
|
|
2306
|
+
if ("object" !== FileSystemDependencies_type_of(res)) return res;
|
|
2138
2307
|
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
2139
2308
|
}
|
|
2140
2309
|
return ("string" === hint ? String : Number)(input);
|
|
2141
2310
|
}(arg, "string");
|
|
2142
|
-
return "symbol" ===
|
|
2311
|
+
return "symbol" === FileSystemDependencies_type_of(key) ? key : String(key);
|
|
2143
2312
|
}
|
|
2144
|
-
function
|
|
2313
|
+
function FileSystemDependencies_type_of(obj) {
|
|
2314
|
+
return obj && "u" > typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
2315
|
+
}
|
|
2316
|
+
let wrappers = new WeakMap();
|
|
2317
|
+
FileSystemDependencies_computedKey = FileSystemDependencies_to_property_key(Symbol.iterator), FileSystemDependencies_computedKey1 = FileSystemDependencies_to_property_key(Symbol.toStringTag), FileSystemDependencies_computedKey2 = FileSystemDependencies_to_property_key(node_util.inspect.custom);
|
|
2318
|
+
class FileSystemDependenciesWrapper {
|
|
2319
|
+
#inner;
|
|
2320
|
+
#pendingAdditions = new Set();
|
|
2321
|
+
#pendingDeletions = new Set();
|
|
2322
|
+
#flushScheduled = !1;
|
|
2323
|
+
constructor(inner){
|
|
2324
|
+
this.#inner = inner;
|
|
2325
|
+
}
|
|
2326
|
+
#scheduleFlush() {
|
|
2327
|
+
this.#flushScheduled || (this.#flushScheduled = !0, queueMicrotask(()=>{
|
|
2328
|
+
this.#flushScheduled = !1, this.#flush();
|
|
2329
|
+
}));
|
|
2330
|
+
}
|
|
2331
|
+
#flush() {
|
|
2332
|
+
if (0 === this.#pendingAdditions.size && 0 === this.#pendingDeletions.size) return;
|
|
2333
|
+
let additions = Array.from(this.#pendingAdditions), deletions = Array.from(this.#pendingDeletions);
|
|
2334
|
+
this.#pendingAdditions.clear(), this.#pendingDeletions.clear(), this.#inner.update(additions, deletions);
|
|
2335
|
+
}
|
|
2336
|
+
#getValues() {
|
|
2337
|
+
return this.#flush(), this.#inner.values();
|
|
2338
|
+
}
|
|
2339
|
+
get size() {
|
|
2340
|
+
return this.#flush(), this.#inner.size();
|
|
2341
|
+
}
|
|
2342
|
+
has(value) {
|
|
2343
|
+
return 'string' == typeof value && (this.#flush(), this.#inner.has(value));
|
|
2344
|
+
}
|
|
2345
|
+
add(value) {
|
|
2346
|
+
return this.#pendingDeletions.delete(value), this.#pendingAdditions.add(value), this.#scheduleFlush(), this;
|
|
2347
|
+
}
|
|
2348
|
+
addAll(deps) {
|
|
2349
|
+
for (let value of deps)this.add(value);
|
|
2350
|
+
}
|
|
2351
|
+
delete(value) {
|
|
2352
|
+
return !('string' != typeof value || this.#pendingDeletions.has(value)) && (!!this.#pendingAdditions.has(value) || !!this.#inner.has(value)) && (this.#pendingDeletions.add(value), this.#scheduleFlush(), !0);
|
|
2353
|
+
}
|
|
2354
|
+
clear() {
|
|
2355
|
+
this.#flush(), this.#inner.clear();
|
|
2356
|
+
}
|
|
2357
|
+
keys() {
|
|
2358
|
+
return this.values();
|
|
2359
|
+
}
|
|
2360
|
+
values() {
|
|
2361
|
+
return this.#getValues().values();
|
|
2362
|
+
}
|
|
2363
|
+
entries() {
|
|
2364
|
+
return this.#getValues().map((value)=>[
|
|
2365
|
+
value,
|
|
2366
|
+
value
|
|
2367
|
+
]).values();
|
|
2368
|
+
}
|
|
2369
|
+
*[FileSystemDependencies_computedKey]() {
|
|
2370
|
+
yield* this.#getValues();
|
|
2371
|
+
}
|
|
2372
|
+
forEach(callback, thisArg) {
|
|
2373
|
+
for (let value of this.#getValues())callback.call(thisArg, value, value, this);
|
|
2374
|
+
}
|
|
2375
|
+
get [FileSystemDependencies_computedKey1]() {
|
|
2376
|
+
return 'Set';
|
|
2377
|
+
}
|
|
2378
|
+
[FileSystemDependencies_computedKey2]() {
|
|
2379
|
+
return new Set(this.values());
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
for (let name of [
|
|
2383
|
+
'union',
|
|
2384
|
+
'intersection',
|
|
2385
|
+
'difference',
|
|
2386
|
+
'symmetricDifference',
|
|
2387
|
+
'isSubsetOf',
|
|
2388
|
+
'isSupersetOf',
|
|
2389
|
+
'isDisjointFrom'
|
|
2390
|
+
]){
|
|
2391
|
+
let method = Reflect.get(Set.prototype, name);
|
|
2392
|
+
'function' == typeof method && Object.defineProperty(FileSystemDependenciesWrapper.prototype, name, {
|
|
2393
|
+
configurable: !0,
|
|
2394
|
+
writable: !0,
|
|
2395
|
+
value (other) {
|
|
2396
|
+
return method.call(new Set(this.values()), other);
|
|
2397
|
+
}
|
|
2398
|
+
});
|
|
2399
|
+
}
|
|
2400
|
+
function createFileSystemDependencies(binding) {
|
|
2401
|
+
let cached = wrappers.get(binding);
|
|
2402
|
+
if (cached) return cached;
|
|
2403
|
+
let wrapper = new FileSystemDependenciesWrapper(binding);
|
|
2404
|
+
return wrappers.set(binding, wrapper), wrapper;
|
|
2405
|
+
}
|
|
2406
|
+
let MODULE_BUILD_INFO_SYMBOL = Symbol.for('rspack.module.buildInfo'), COMPILATION_HOOKS_MAP_SYMBOL = Symbol.for('rspack.compilation.hooksMap'), BUILD_INFO_ASSETS_SYMBOL = Symbol.for('rspack.buildInfo.assets'), BUILD_INFO_FILE_DEPENDENCIES_SYMBOL = Symbol.for('rspack.buildInfo.fileDependencies'), BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL = Symbol.for('rspack.buildInfo.contextDependencies'), BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL = Symbol.for('rspack.buildInfo.missingDependencies'), BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL = Symbol.for('rspack.buildInfo.buildDependencies'), COMMIT_CUSTOM_FIELDS_SYMBOL = Symbol.for('rspack.buildInfo.commitCustomFields'), CIRCULAR_CONNECTION_SYMBOL = Symbol.for('rspack.moduleGraphConnection.circularConnection'), TRANSITIVE_ONLY_SYMBOL = Symbol.for('rspack.moduleGraphConnection.transitiveOnly');
|
|
2407
|
+
function Compilation_to_property_key(arg) {
|
|
2408
|
+
var key = function(input, hint) {
|
|
2409
|
+
if ("object" !== Compilation_type_of(input) || null === input) return input;
|
|
2410
|
+
var prim = input[Symbol.toPrimitive];
|
|
2411
|
+
if (void 0 !== prim) {
|
|
2412
|
+
var res = prim.call(input, hint || "default");
|
|
2413
|
+
if ("object" !== Compilation_type_of(res)) return res;
|
|
2414
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
2415
|
+
}
|
|
2416
|
+
return ("string" === hint ? String : Number)(input);
|
|
2417
|
+
}(arg, "string");
|
|
2418
|
+
return "symbol" === Compilation_type_of(key) ? key : String(key);
|
|
2419
|
+
}
|
|
2420
|
+
function Compilation_type_of(obj) {
|
|
2145
2421
|
return obj && "u" > typeof Symbol && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
2146
2422
|
}
|
|
2147
2423
|
function normalizePathData(data = {}) {
|
|
@@ -2160,19 +2436,25 @@ function normalizePathData(data = {}) {
|
|
|
2160
2436
|
}
|
|
2161
2437
|
return pathData;
|
|
2162
2438
|
}
|
|
2163
|
-
let
|
|
2439
|
+
let logEntryTraceDescriptor = Object.getOwnPropertyDescriptor({
|
|
2440
|
+
get trace () {
|
|
2441
|
+
return cutOffLoaderExecution(Error('Trace').stack).split('\n').slice(3);
|
|
2442
|
+
}
|
|
2443
|
+
}, 'trace'), logEntryNoTraceDescriptor = Object.getOwnPropertyDescriptor({
|
|
2444
|
+
get trace () {}
|
|
2445
|
+
}, 'trace'), checkCompilation = (compilation)=>{
|
|
2164
2446
|
if (!(compilation instanceof Compilation)) throw TypeError('The \'compilation\' argument must be an instance of Compilation. This usually occurs when multiple versions of "@rspack/core" are used, or when the code in "@rspack/core" is executed multiple times.');
|
|
2165
2447
|
}, getOrCreateCompilationHooks = (compilation, key, createHooks)=>{
|
|
2166
|
-
let compilationHooksMap = compilation[
|
|
2448
|
+
let compilationHooksMap = compilation[COMPILATION_HOOKS_MAP_SYMBOL], hooks = compilationHooksMap.get(key);
|
|
2167
2449
|
return void 0 === hooks && (hooks = createHooks(), compilationHooksMap.set(key, hooks)), hooks;
|
|
2168
2450
|
};
|
|
2169
|
-
_computedKey = _to_property_key(binding__default().COMPILATION_HOOKS_MAP_SYMBOL);
|
|
2170
2451
|
class Compilation {
|
|
2171
2452
|
#inner;
|
|
2172
2453
|
#shutdown;
|
|
2173
2454
|
#errors;
|
|
2174
2455
|
#warnings;
|
|
2175
2456
|
#chunks;
|
|
2457
|
+
#modules;
|
|
2176
2458
|
#assetsProxy;
|
|
2177
2459
|
hooks;
|
|
2178
2460
|
name;
|
|
@@ -2193,13 +2475,21 @@ class Compilation {
|
|
|
2193
2475
|
createSnapshot: ()=>null
|
|
2194
2476
|
};
|
|
2195
2477
|
needAdditionalPass;
|
|
2478
|
+
#fileSystemDependencies;
|
|
2196
2479
|
#addIncludeDispatcher;
|
|
2197
2480
|
#addEntryDispatcher;
|
|
2198
|
-
[
|
|
2481
|
+
[COMPILATION_HOOKS_MAP_SYMBOL];
|
|
2199
2482
|
constructor(compiler, inner){
|
|
2200
2483
|
var name, stage, getArgs;
|
|
2201
2484
|
let errorMessage, getOptions;
|
|
2202
|
-
this.#inner = inner
|
|
2485
|
+
this.#inner = inner;
|
|
2486
|
+
let fileSystemDependencies = this.#fileSystemDependencies = {
|
|
2487
|
+
fileDependencies: inner.fileDependencies,
|
|
2488
|
+
contextDependencies: inner.contextDependencies,
|
|
2489
|
+
missingDependencies: inner.missingDependencies,
|
|
2490
|
+
buildDependencies: inner.buildDependencies
|
|
2491
|
+
};
|
|
2492
|
+
this.fileDependencies = createFileSystemDependencies(fileSystemDependencies.fileDependencies), this.contextDependencies = createFileSystemDependencies(fileSystemDependencies.contextDependencies), this.missingDependencies = createFileSystemDependencies(fileSystemDependencies.missingDependencies), this.buildDependencies = createFileSystemDependencies(fileSystemDependencies.buildDependencies), this.#shutdown = !1;
|
|
2203
2493
|
let processAssetsHook = new AsyncSeriesHook([
|
|
2204
2494
|
'assets'
|
|
2205
2495
|
]);
|
|
@@ -2329,7 +2619,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2329
2619
|
}
|
|
2330
2620
|
return value;
|
|
2331
2621
|
}
|
|
2332
|
-
}), this.compiler = compiler, this.resolverFactory = compiler.resolverFactory, this.inputFileSystem = compiler.inputFileSystem, this.options = compiler.options, this.outputOptions = compiler.options.output, this.runtimeTemplate = new RuntimeTemplate(this, this.outputOptions), this.logging = new Map(), this.childrenCounters = {}, this.children = [], this.needAdditionalPass = !1, this.chunkGraph = inner.chunkGraph, this.moduleGraph = ModuleGraph.__from_binding(inner.moduleGraph), this.#addIncludeDispatcher = new AddEntryItemDispatcher(inner.addInclude.bind(inner)), this.#addEntryDispatcher = new AddEntryItemDispatcher(inner.addEntry.bind(inner)), this[
|
|
2622
|
+
}), this.compiler = compiler, this.resolverFactory = compiler.resolverFactory, this.inputFileSystem = compiler.inputFileSystem, this.options = compiler.options, this.outputOptions = compiler.options.output, this.runtimeTemplate = new RuntimeTemplate(this, this.outputOptions), this.logging = new Map(), this.childrenCounters = {}, this.children = [], this.needAdditionalPass = !1, this.chunkGraph = inner.chunkGraph, this.moduleGraph = ModuleGraph.__from_binding(inner.moduleGraph), this.#addIncludeDispatcher = new AddEntryItemDispatcher(inner.addInclude.bind(inner)), this.#addEntryDispatcher = new AddEntryItemDispatcher(inner.addEntry.bind(inner)), this[COMPILATION_HOOKS_MAP_SYMBOL] = new WeakMap();
|
|
2333
2623
|
}
|
|
2334
2624
|
get hash() {
|
|
2335
2625
|
return this.#inner.hash;
|
|
@@ -2360,7 +2650,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2360
2650
|
});
|
|
2361
2651
|
}
|
|
2362
2652
|
get modules() {
|
|
2363
|
-
return new
|
|
2653
|
+
return this.#modules || (this.#modules = new ModulesWrapper(this.#inner.modules)), this.#modules;
|
|
2364
2654
|
}
|
|
2365
2655
|
get builtModules() {
|
|
2366
2656
|
return new Set(this.#inner.builtModules);
|
|
@@ -2500,19 +2790,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2500
2790
|
let logEntry = {
|
|
2501
2791
|
time: Date.now(),
|
|
2502
2792
|
type,
|
|
2503
|
-
args
|
|
2504
|
-
get trace () {
|
|
2505
|
-
switch(type){
|
|
2506
|
-
case LogType.warn:
|
|
2507
|
-
case LogType.error:
|
|
2508
|
-
case LogType.trace:
|
|
2509
|
-
return cutOffLoaderExecution(Error('Trace').stack).split('\n').slice(3);
|
|
2510
|
-
default:
|
|
2511
|
-
return;
|
|
2512
|
-
}
|
|
2513
|
-
}
|
|
2793
|
+
args
|
|
2514
2794
|
};
|
|
2515
|
-
void 0 === this.hooks.log.call(logName, logEntry) && (logEntry.type === LogType.profileEnd && 'function' == typeof console.profileEnd && console.profileEnd(`[${logName}] ${logEntry.args[0]}`), void 0 === logEntries && void 0 === (logEntries = this.logging.get(logName)) && (logEntries = [], this.logging.set(logName, logEntries)), logEntries.push(logEntry), logEntry.type === LogType.profile && 'function' == typeof console.profile && console.profile(`[${logName}] ${logEntry.args[0]}`));
|
|
2795
|
+
Object.defineProperty(logEntry, 'trace', type === LogType.warn || type === LogType.error || type === LogType.trace ? logEntryTraceDescriptor : logEntryNoTraceDescriptor), void 0 === this.hooks.log.call(logName, logEntry) && (logEntry.type === LogType.profileEnd && 'function' == typeof console.profileEnd && console.profileEnd(`[${logName}] ${logEntry.args[0]}`), void 0 === logEntries && void 0 === (logEntries = this.logging.get(logName)) && (logEntries = [], this.logging.set(logName, logEntries)), logEntries.push(logEntry), logEntry.type === LogType.profile && 'function' == typeof console.profile && console.profile(`[${logName}] ${logEntry.args[0]}`));
|
|
2516
2796
|
}, (childName)=>{
|
|
2517
2797
|
let normalizedChildName = childName;
|
|
2518
2798
|
return 'function' == typeof logName ? 'function' == typeof normalizedChildName ? this.getLogger(()=>{
|
|
@@ -2528,28 +2808,28 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2528
2808
|
}) : this.getLogger(`${logName}/${normalizedChildName}`);
|
|
2529
2809
|
});
|
|
2530
2810
|
}
|
|
2531
|
-
fileDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().fileDependencies, (d)=>this.#inner.addFileDependencies(d));
|
|
2532
2811
|
get __internal__addedFileDependencies() {
|
|
2533
|
-
return this.#
|
|
2812
|
+
return this.#fileSystemDependencies.fileDependencies.added;
|
|
2534
2813
|
}
|
|
2535
2814
|
get __internal__removedFileDependencies() {
|
|
2536
|
-
return this.#
|
|
2815
|
+
return this.#fileSystemDependencies.fileDependencies.removed;
|
|
2537
2816
|
}
|
|
2538
2817
|
get __internal__addedContextDependencies() {
|
|
2539
|
-
return this.#
|
|
2818
|
+
return this.#fileSystemDependencies.contextDependencies.added;
|
|
2540
2819
|
}
|
|
2541
2820
|
get __internal__removedContextDependencies() {
|
|
2542
|
-
return this.#
|
|
2821
|
+
return this.#fileSystemDependencies.contextDependencies.removed;
|
|
2543
2822
|
}
|
|
2544
2823
|
get __internal__addedMissingDependencies() {
|
|
2545
|
-
return this.#
|
|
2824
|
+
return this.#fileSystemDependencies.missingDependencies.added;
|
|
2546
2825
|
}
|
|
2547
2826
|
get __internal__removedMissingDependencies() {
|
|
2548
|
-
return this.#
|
|
2827
|
+
return this.#fileSystemDependencies.missingDependencies.removed;
|
|
2549
2828
|
}
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2829
|
+
fileDependencies;
|
|
2830
|
+
contextDependencies;
|
|
2831
|
+
missingDependencies;
|
|
2832
|
+
buildDependencies;
|
|
2553
2833
|
getStats() {
|
|
2554
2834
|
return new Stats(this);
|
|
2555
2835
|
}
|
|
@@ -2590,7 +2870,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2590
2870
|
}
|
|
2591
2871
|
__internal__getAssetSource(filename) {
|
|
2592
2872
|
let rawSource = this.#inner.getAssetSource(filename);
|
|
2593
|
-
if (rawSource) return SourceAdapter.fromBinding(rawSource);
|
|
2873
|
+
if (rawSource) return SourceAdapter.fromBinding(rawSource, this.#inner.getAssetNativeSource(filename));
|
|
2594
2874
|
}
|
|
2595
2875
|
__internal__setAssetSource(filename, source) {
|
|
2596
2876
|
this.#inner.setAssetSource(filename, SourceAdapter.toBinding(source));
|
|
@@ -2676,7 +2956,7 @@ class EntryData {
|
|
|
2676
2956
|
this.dependencies = binding.dependencies, this.includeDependencies = binding.includeDependencies, this.options = binding.options;
|
|
2677
2957
|
}
|
|
2678
2958
|
}
|
|
2679
|
-
|
|
2959
|
+
Compilation_computedKey = Compilation_to_property_key(Symbol.iterator), Compilation_computedKey1 = Compilation_to_property_key(Symbol.toStringTag);
|
|
2680
2960
|
class Entries {
|
|
2681
2961
|
#data;
|
|
2682
2962
|
constructor(data){
|
|
@@ -2703,10 +2983,10 @@ class Entries {
|
|
|
2703
2983
|
values() {
|
|
2704
2984
|
return this.#data.values().map(EntryData.__from_binding)[Symbol.iterator]();
|
|
2705
2985
|
}
|
|
2706
|
-
[
|
|
2986
|
+
[Compilation_computedKey]() {
|
|
2707
2987
|
return this.entries();
|
|
2708
2988
|
}
|
|
2709
|
-
[
|
|
2989
|
+
[Compilation_computedKey1] = 'Map';
|
|
2710
2990
|
has(key) {
|
|
2711
2991
|
return this.#data.has(key);
|
|
2712
2992
|
}
|
|
@@ -2904,43 +3184,7 @@ let ContextReplacementPlugin = base_create(binding_.BuiltinPluginName.ContextRep
|
|
|
2904
3184
|
cssIndex && splitChunks.defaultSizeTypes.splice(cssIndex, 1);
|
|
2905
3185
|
}
|
|
2906
3186
|
return options;
|
|
2907
|
-
}), CssHttpExternalsRspackPlugin = base_create(binding_.BuiltinPluginName.CssHttpExternalsRspackPlugin, ()=>void 0), CssModulesPlugin = base_create(binding_.BuiltinPluginName.CssModulesPlugin, ()=>{}, 'compilation');
|
|
2908
|
-
Object.defineProperty(binding__default().NormalModule.prototype, 'identifier', {
|
|
2909
|
-
enumerable: !0,
|
|
2910
|
-
configurable: !0,
|
|
2911
|
-
value () {
|
|
2912
|
-
return this[binding__default().MODULE_IDENTIFIER_SYMBOL];
|
|
2913
|
-
}
|
|
2914
|
-
}), Object.defineProperty(binding__default().NormalModule.prototype, 'originalSource', {
|
|
2915
|
-
enumerable: !0,
|
|
2916
|
-
configurable: !0,
|
|
2917
|
-
value () {
|
|
2918
|
-
let originalSource = this._originalSource();
|
|
2919
|
-
return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
|
|
2920
|
-
}
|
|
2921
|
-
}), Object.defineProperty(binding__default().NormalModule.prototype, 'emitFile', {
|
|
2922
|
-
enumerable: !0,
|
|
2923
|
-
configurable: !0,
|
|
2924
|
-
value (filename, source, assetInfo) {
|
|
2925
|
-
return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
|
|
2926
|
-
}
|
|
2927
|
-
}), Object.defineProperty(binding__default().NormalModule, 'getCompilationHooks', {
|
|
2928
|
-
enumerable: !0,
|
|
2929
|
-
configurable: !0,
|
|
2930
|
-
value (compilation) {
|
|
2931
|
-
if (!(binding__default().COMPILATION_HOOKS_MAP_SYMBOL in compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
|
|
2932
|
-
return getOrCreateCompilationHooks(compilation, compilation, ()=>({
|
|
2933
|
-
loader: new SyncHook([
|
|
2934
|
-
'loaderContext',
|
|
2935
|
-
'module'
|
|
2936
|
-
]),
|
|
2937
|
-
readResource: new HookMap(()=>new AsyncSeriesBailHook([
|
|
2938
|
-
'loaderContext'
|
|
2939
|
-
]))
|
|
2940
|
-
}));
|
|
2941
|
-
}
|
|
2942
|
-
});
|
|
2943
|
-
let utils_PLUGIN_NAME = 'css-extract-rspack-plugin', utils_pluginSymbol = Symbol.for(utils_PLUGIN_NAME), DEFAULT_FILENAME = '[name].css', LOADER_PATH = join(import.meta.dirname, 'cssExtractLoader.js');
|
|
3187
|
+
}), CssHttpExternalsRspackPlugin = base_create(binding_.BuiltinPluginName.CssHttpExternalsRspackPlugin, ()=>void 0), CssModulesPlugin = base_create(binding_.BuiltinPluginName.CssModulesPlugin, ()=>{}, 'compilation'), utils_PLUGIN_NAME = 'css-extract-rspack-plugin', utils_pluginSymbol = Symbol.for(utils_PLUGIN_NAME), DEFAULT_FILENAME = '[name].css', LOADER_PATH = join(import.meta.dirname, 'cssExtractLoader.js');
|
|
2944
3188
|
class CssExtractRspackPlugin {
|
|
2945
3189
|
static pluginName = utils_PLUGIN_NAME;
|
|
2946
3190
|
static loader = LOADER_PATH;
|
|
@@ -2950,11 +3194,9 @@ class CssExtractRspackPlugin {
|
|
|
2950
3194
|
}
|
|
2951
3195
|
apply(compiler) {
|
|
2952
3196
|
compiler.hooks.thisCompilation.tap(utils_PLUGIN_NAME, (compilation)=>{
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
};
|
|
2957
|
-
});
|
|
3197
|
+
compilation[utils_pluginSymbol] = {
|
|
3198
|
+
runtime: !1 !== this.options.runtime
|
|
3199
|
+
};
|
|
2958
3200
|
});
|
|
2959
3201
|
let { splitChunks } = compiler.options.optimization;
|
|
2960
3202
|
splitChunks && splitChunks.defaultSizeTypes.includes('...') && splitChunks.defaultSizeTypes.push('css/mini-extract'), compiler.options.output.pathinfo && void 0 === this.options.pathinfo && (this.options.pathinfo = !0), compiler.__internal__registerBuiltinPlugin({
|
|
@@ -3139,6 +3381,8 @@ class SplitChunksPlugin extends RspackBuiltinPlugin {
|
|
|
3139
3381
|
}
|
|
3140
3382
|
function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler, enableNameBatch = !1) {
|
|
3141
3383
|
if (!sc) return;
|
|
3384
|
+
let { dedupDepth } = sc;
|
|
3385
|
+
if (void 0 !== dedupDepth && (!Number.isInteger(dedupDepth) || dedupDepth < 0 || dedupDepth > 0xffffffff)) throw Error(`Invalid Rspack configuration: "optimization.splitChunks.dedupDepth" must be an integer between 0 and 4294967295, get \`${dedupDepth}\`.`);
|
|
3142
3386
|
function getName(name) {
|
|
3143
3387
|
if ('function' == typeof name) {
|
|
3144
3388
|
var name1;
|
|
@@ -3163,7 +3407,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler, enableNameBatch
|
|
|
3163
3407
|
function getChunks(chunks) {
|
|
3164
3408
|
return 'function' == typeof chunks ? (chunk)=>chunks(chunk) : chunks;
|
|
3165
3409
|
}
|
|
3166
|
-
let { name, chunks, defaultSizeTypes, cacheGroups = {}, fallbackCacheGroup, minSize, minSizeReduction, enforceSizeThreshold, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = sc;
|
|
3410
|
+
let { name, chunks, defaultSizeTypes, cacheGroups = {}, fallbackCacheGroup, minSize, minSizeReduction, minRemainingSize, enforceSizeThreshold, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = sc;
|
|
3167
3411
|
return {
|
|
3168
3412
|
...getName(name),
|
|
3169
3413
|
chunks: getChunks(chunks),
|
|
@@ -3172,7 +3416,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler, enableNameBatch
|
|
|
3172
3416
|
'unknown'
|
|
3173
3417
|
],
|
|
3174
3418
|
cacheGroups: Object.entries(cacheGroups).filter(([_key, group])=>!1 !== group).map(([key, group])=>{
|
|
3175
|
-
let { test, name, chunks, minSize, minSizeReduction, enforceSizeThreshold, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = group;
|
|
3419
|
+
let { test, name, chunks, minSize, minSizeReduction, minRemainingSize, enforceSizeThreshold, maxSize, maxAsyncSize, maxInitialSize, ...passThrough } = group;
|
|
3176
3420
|
return {
|
|
3177
3421
|
key,
|
|
3178
3422
|
test: 'function' == typeof test ? (ctx)=>{
|
|
@@ -3186,6 +3430,7 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler, enableNameBatch
|
|
|
3186
3430
|
chunks: getChunks(chunks),
|
|
3187
3431
|
minSize: JsSplitChunkSizes.__to_binding(minSize),
|
|
3188
3432
|
minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
|
|
3433
|
+
minRemainingSize: JsSplitChunkSizes.__to_binding(minRemainingSize),
|
|
3189
3434
|
enforceSizeThreshold: JsSplitChunkSizes.__to_binding(enforceSizeThreshold),
|
|
3190
3435
|
maxSize: JsSplitChunkSizes.__to_binding(maxSize),
|
|
3191
3436
|
maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
|
|
@@ -3199,11 +3444,13 @@ function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler, enableNameBatch
|
|
|
3199
3444
|
},
|
|
3200
3445
|
minSize: JsSplitChunkSizes.__to_binding(minSize),
|
|
3201
3446
|
minSizeReduction: JsSplitChunkSizes.__to_binding(minSizeReduction),
|
|
3447
|
+
minRemainingSize: JsSplitChunkSizes.__to_binding(minRemainingSize),
|
|
3202
3448
|
enforceSizeThreshold: JsSplitChunkSizes.__to_binding(enforceSizeThreshold),
|
|
3203
3449
|
maxSize: JsSplitChunkSizes.__to_binding(maxSize),
|
|
3204
3450
|
maxAsyncSize: JsSplitChunkSizes.__to_binding(maxAsyncSize),
|
|
3205
3451
|
maxInitialSize: JsSplitChunkSizes.__to_binding(maxInitialSize),
|
|
3206
|
-
...passThrough
|
|
3452
|
+
...passThrough,
|
|
3453
|
+
dedupDepth: dedupDepth ?? +('development' !== compiler.options.mode && 'none' !== compiler.options.mode)
|
|
3207
3454
|
};
|
|
3208
3455
|
}
|
|
3209
3456
|
let EnableLibraryPlugin_enabledTypes = new WeakMap(), EnableLibraryPlugin_getEnabledTypes = (compiler)=>{
|
|
@@ -3233,7 +3480,7 @@ class EnableLibraryPlugin extends RspackBuiltinPlugin {
|
|
|
3233
3480
|
}
|
|
3234
3481
|
let EnableWasmLoadingPlugin = base_create(binding_.BuiltinPluginName.EnableWasmLoadingPlugin, (type)=>type), EnsureChunkConditionsPlugin = base_create(binding_.BuiltinPluginName.EnsureChunkConditionsPlugin, ()=>{}), RemoveDuplicateModulesPlugin_RemoveDuplicateModulesPlugin = base_create(binding_.BuiltinPluginName.RemoveDuplicateModulesPlugin, ()=>({}));
|
|
3235
3482
|
function applyLimits(options, logger) {
|
|
3236
|
-
if (options.optimization.concatenateModules = !1, options.
|
|
3483
|
+
if (options.optimization.concatenateModules = !1, options.output.chunkFormat = !1, options.output.module = !0, options.output.chunkLoading && 'import' !== options.output.chunkLoading && (options.output.chunkLoading = 'import'), void 0 === options.output.chunkLoading && (options.output.chunkLoading = 'import'), logger && 'string' == typeof options.devtool) {
|
|
3237
3484
|
let fallbackDevtool, previousDevtool = options.devtool;
|
|
3238
3485
|
'eval' === previousDevtool ? fallbackDevtool = !1 : previousDevtool.startsWith('eval-') && previousDevtool.includes('source-map') && (fallbackDevtool = previousDevtool.slice(5)), void 0 !== fallbackDevtool && (options.devtool = fallbackDevtool, logger.warn(`\`devtool: "${previousDevtool}"\` is not supported with \`library.type: "modern-module"\` because its modules are rendered as top-level code. Rspack has changed \`devtool\` to \`${JSON.stringify(fallbackDevtool)}\`.`));
|
|
3239
3486
|
}
|
|
@@ -3264,15 +3511,21 @@ let unsupported = (name, issue)=>{
|
|
|
3264
3511
|
function deprecate(message) {
|
|
3265
3512
|
warnedMessages.has(message) || (warnedMessages.add(message), console.warn(`[Rspack Deprecation] ${message}`));
|
|
3266
3513
|
}
|
|
3267
|
-
let WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g,
|
|
3514
|
+
let WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, getWindowsDosDevicePathPrefixLength = (identifier)=>{
|
|
3515
|
+
if (identifier.length >= 4 && 92 === identifier.charCodeAt(0) && 92 === identifier.charCodeAt(1) && 92 === identifier.charCodeAt(3)) {
|
|
3516
|
+
let namespace = identifier.charCodeAt(2);
|
|
3517
|
+
if (63 === namespace || 46 === namespace) return 4;
|
|
3518
|
+
}
|
|
3519
|
+
return 0;
|
|
3520
|
+
}, isWindowsAbsolutePath = (identifier)=>WINDOWS_ABS_PATH_REGEXP.test(identifier) || 0 !== getWindowsDosDevicePathPrefixLength(identifier), getQuerySplitPosition = (identifier)=>identifier.indexOf('?', getWindowsDosDevicePathPrefixLength(identifier)), relativePathToRequest = (relativePath)=>'' === relativePath ? './.' : '..' === relativePath ? '../.' : relativePath.startsWith('../') ? relativePath : `./${relativePath}`, absoluteToRequest = (context, maybeAbsolutePath)=>{
|
|
3268
3521
|
if ('/' === maybeAbsolutePath[0]) {
|
|
3269
3522
|
if (maybeAbsolutePath.length > 1 && '/' === maybeAbsolutePath[maybeAbsolutePath.length - 1]) return maybeAbsolutePath;
|
|
3270
|
-
let querySplitPos = maybeAbsolutePath
|
|
3523
|
+
let querySplitPos = getQuerySplitPosition(maybeAbsolutePath), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
3271
3524
|
return resource = relativePathToRequest(node_path.posix.relative(context, resource)), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
|
|
3272
3525
|
}
|
|
3273
|
-
if (
|
|
3274
|
-
let querySplitPos = maybeAbsolutePath
|
|
3275
|
-
return resource = node_path.win32.relative(context, resource)
|
|
3526
|
+
if (isWindowsAbsolutePath(maybeAbsolutePath)) {
|
|
3527
|
+
let querySplitPos = getQuerySplitPosition(maybeAbsolutePath), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
3528
|
+
return isWindowsAbsolutePath(resource = node_path.win32.relative(context, resource)) || (resource = relativePathToRequest(resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, '/'))), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
|
|
3276
3529
|
}
|
|
3277
3530
|
return maybeAbsolutePath;
|
|
3278
3531
|
}, makeCacheable = (realFn)=>{
|
|
@@ -3330,14 +3583,15 @@ let WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])
|
|
|
3330
3583
|
};
|
|
3331
3584
|
}, cachedFn;
|
|
3332
3585
|
}, 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)=>r.startsWith('./') || r.startsWith('../') ? node_path.join(context, r) : r).join('!')), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/, parseResource = makeCacheable(function(str) {
|
|
3333
|
-
|
|
3586
|
+
let prefixLength = getWindowsDosDevicePathPrefixLength(str), resource = str.slice(prefixLength);
|
|
3587
|
+
if (!resource.includes('?') && !resource.includes('#') && !resource.includes('\u200b')) return {
|
|
3334
3588
|
path: str,
|
|
3335
3589
|
query: '',
|
|
3336
3590
|
fragment: ''
|
|
3337
3591
|
};
|
|
3338
|
-
let match = PATH_QUERY_FRAGMENT_REGEXP.exec(
|
|
3592
|
+
let match = PATH_QUERY_FRAGMENT_REGEXP.exec(resource);
|
|
3339
3593
|
return match ? {
|
|
3340
|
-
path: match[1].replace(/\u200b(.)/g, '$1'),
|
|
3594
|
+
path: str.slice(0, prefixLength) + match[1].replace(/\u200b(.)/g, '$1'),
|
|
3341
3595
|
query: match[2] ? match[2].replace(/\u200b(.)/g, '$1') : '',
|
|
3342
3596
|
fragment: match[3] || ''
|
|
3343
3597
|
} : {
|
|
@@ -3346,16 +3600,16 @@ let WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])
|
|
|
3346
3600
|
fragment: ''
|
|
3347
3601
|
};
|
|
3348
3602
|
}), parseResourceWithoutFragment = makeCacheable((str)=>{
|
|
3349
|
-
let match = PATH_QUERY_REGEXP.exec(str);
|
|
3603
|
+
let prefixLength = getWindowsDosDevicePathPrefixLength(str), match = PATH_QUERY_REGEXP.exec(str.slice(prefixLength));
|
|
3350
3604
|
return {
|
|
3351
|
-
path: match[1].replace(/\u200b(.)/g, '$1'),
|
|
3605
|
+
path: str.slice(0, prefixLength) + match[1].replace(/\u200b(.)/g, '$1'),
|
|
3352
3606
|
query: match[2] ? match[2].replace(/\u200b(.)/g, '$1') : ''
|
|
3353
3607
|
};
|
|
3354
3608
|
});
|
|
3355
3609
|
function isStatsColorSupported() {
|
|
3356
3610
|
if ("u" < typeof process) return !1;
|
|
3357
3611
|
let env = process.env ?? {}, argv = process.argv ?? [];
|
|
3358
|
-
return !('NO_COLOR' in env || argv.includes('--no-color')) && ('FORCE_COLOR' in env || argv.includes('--color') || 'win32' === process.platform || process.stdout?.isTTY && 'dumb' !== env.TERM ||
|
|
3612
|
+
return !('NO_COLOR' in env || argv.includes('--no-color')) && ('FORCE_COLOR' in env || argv.includes('--color') || 'win32' === process.platform || process.stdout?.isTTY && 'dumb' !== env.TERM || !!env.CI && 'false' !== env.CI);
|
|
3359
3613
|
}
|
|
3360
3614
|
function encodeVersion(version) {
|
|
3361
3615
|
let [major, minor = 0, patch = 0] = version.split('-')[0].split('.').map((v)=>parseInt(v, 10));
|
|
@@ -3494,7 +3748,7 @@ function createRawModuleRuleUses(uses, path, options) {
|
|
|
3494
3748
|
...uses
|
|
3495
3749
|
].map(normalizeRuleSetUseItem) : [
|
|
3496
3750
|
normalizeRuleSetUseItem(uses)
|
|
3497
|
-
], path1 = path, options1 = options, uses1.length ? uses1.filter(
|
|
3751
|
+
], path1 = path, options1 = options, uses1.length ? uses1.filter((use)=>!!use).map((use, index)=>{
|
|
3498
3752
|
let o, fingerprintOptions = use.options, isBuiltin = !1;
|
|
3499
3753
|
if (use.loader.startsWith(BUILTIN_LOADER_PREFIX)) {
|
|
3500
3754
|
let temp = function(identifier, o, options) {
|
|
@@ -3539,7 +3793,9 @@ function createRawModuleRuleUses(uses, path, options) {
|
|
|
3539
3793
|
})(o, options);
|
|
3540
3794
|
if (identifier.startsWith(`${BUILTIN_LOADER_PREFIX}lightningcss-loader`)) {
|
|
3541
3795
|
let options1;
|
|
3542
|
-
return 'object' == typeof (options1 =
|
|
3796
|
+
return 'object' == typeof (options1 = 'object' == typeof o && null !== o ? {
|
|
3797
|
+
...o
|
|
3798
|
+
} : o ?? {}) && ('string' == typeof options1.targets ? options1.targets = [
|
|
3543
3799
|
options1.targets
|
|
3544
3800
|
] : 'object' != typeof options1.targets || Array.isArray(options1.targets) ? void 0 === options1.targets && options.compiler.target?.targets && (options1.targets = defaultTargetsFromRspackTargets(options.compiler.target.targets)) : options1.targets = encodeTargets(options1.targets), options1.include && 'object' == typeof options1.include && (options1.include = toFeatures(options1.include)), options1.exclude && 'object' == typeof options1.exclude && (options1.exclude = toFeatures(options1.exclude))), options1;
|
|
3545
3801
|
}
|
|
@@ -3548,16 +3804,22 @@ function createRawModuleRuleUses(uses, path, options) {
|
|
|
3548
3804
|
fingerprintOptions = temp, o = isNil(temp) ? void 0 : 'string' == typeof temp ? temp : JSON.stringify(temp, null, 2), isBuiltin = !0;
|
|
3549
3805
|
}
|
|
3550
3806
|
return {
|
|
3551
|
-
loader: function(use, path, compiler, isBuiltin) {
|
|
3807
|
+
loader: function(use, path, compiler, isBuiltin, normalizedOptions) {
|
|
3552
3808
|
let obj = parseResource(use.loader), ident = use.ident;
|
|
3553
3809
|
null === use.options || void 0 === use.options || ('string' == typeof use.options ? obj.query = `?${use.options}` : use.ident ? obj.query = `??${ident = use.ident}` : 'object' == typeof use.options && use.options.ident ? obj.query = `??${ident = use.options.ident}` : 'object' == typeof use.options ? obj.query = `??${ident = path}` : obj.query = `?${JSON.stringify(use.options)}`);
|
|
3554
3810
|
let parallelism = use.parallel;
|
|
3555
3811
|
if (parallelism && (!use.options || 'object' != typeof use.options)) throw Error(`\`Rule.use.parallel\` requires \`Rule.use.options\` to be an object.\nHowever the received value is \`${use.options}\` under option path \`${path}\`\nInternally, parallelism is provided by passing \`Rule.use.ident\` to the loader as an identifier to ident the parallelism option\nYou can either replace the \`Rule.use.loader\` with \`Rule.use.options = {}\` or remove \`Rule.use.parallel\`.`);
|
|
3556
|
-
return use.options && 'object' == typeof use.options && (ident || (ident = '[[missing ident]]'), compiler.__internal__ruleSet.references.set(ident, use.options), compiler.__internal__ruleSet.references.set(`${ident}$$parallelism`, parallelism), isBuiltin && compiler.__internal__ruleSet.builtinReferences.set(ident,
|
|
3557
|
-
}(use, `${path1}[${index}]`, options1.compiler, isBuiltin),
|
|
3812
|
+
return use.options && 'object' == typeof use.options && (ident || (ident = '[[missing ident]]'), compiler.__internal__ruleSet.references.set(ident, use.options), compiler.__internal__ruleSet.references.set(`${ident}$$parallelism`, parallelism), isBuiltin && compiler.__internal__ruleSet.builtinReferences.set(ident, normalizedOptions)), obj.path + obj.query + obj.fragment;
|
|
3813
|
+
}(use, `${path1}[${index}]`, options1.compiler, isBuiltin, fingerprintOptions),
|
|
3558
3814
|
options: o,
|
|
3559
3815
|
cache: use.cache ?? !1,
|
|
3560
|
-
optionsCacheKey: use.cache ? JSON.stringify(fingerprintOptions) ?? '' : ''
|
|
3816
|
+
optionsCacheKey: use.cache ? JSON.stringify(fingerprintOptions) ?? '' : '',
|
|
3817
|
+
codeFilter: function(codeFilter, path) {
|
|
3818
|
+
if (void 0 !== codeFilter) {
|
|
3819
|
+
if ('string' == typeof codeFilter || codeFilter instanceof RegExp) return codeFilter;
|
|
3820
|
+
throw Error(`Expected a string or RegExp at \`${path}\`.`);
|
|
3821
|
+
}
|
|
3822
|
+
}(use.codeFilter, `${path1}[${index}].codeFilter`)
|
|
3561
3823
|
};
|
|
3562
3824
|
}) : [];
|
|
3563
3825
|
}
|
|
@@ -3594,7 +3856,7 @@ function getRawResolve(resolve) {
|
|
|
3594
3856
|
if (void 0 === tsConfig) return tsConfig;
|
|
3595
3857
|
let { configFile, references } = tsConfig;
|
|
3596
3858
|
return {
|
|
3597
|
-
configFile,
|
|
3859
|
+
configFile: node_path.resolve(configFile),
|
|
3598
3860
|
referencesType: 'auto' === references ? 'auto' : references ? 'manual' : 'disabled',
|
|
3599
3861
|
references: 'auto' === references ? void 0 : references
|
|
3600
3862
|
};
|
|
@@ -3629,6 +3891,7 @@ let getRawModuleRule = (rule, path, options, upperType)=>{
|
|
|
3629
3891
|
compiler: options.compiler
|
|
3630
3892
|
}) ?? [], `${path}.use`, options));
|
|
3631
3893
|
let rawModuleRule = {
|
|
3894
|
+
as: rule.as,
|
|
3632
3895
|
test: rule.test ? getRawRuleSetCondition(rule.test) : void 0,
|
|
3633
3896
|
include: rule.include ? getRawRuleSetCondition(rule.include) : void 0,
|
|
3634
3897
|
exclude: rule.exclude ? getRawRuleSetCondition(rule.exclude) : void 0,
|
|
@@ -3784,6 +4047,7 @@ function getRawJavascriptParserOptions(parser) {
|
|
|
3784
4047
|
return importMeta;
|
|
3785
4048
|
}(parser.importMeta),
|
|
3786
4049
|
url: parser.url?.toString(),
|
|
4050
|
+
dynamicUrl: parser.dynamicUrl,
|
|
3787
4051
|
exprContextCritical: parser.exprContextCritical,
|
|
3788
4052
|
unknownContextCritical: parser.unknownContextCritical,
|
|
3789
4053
|
wrappedContextCritical: parser.wrappedContextCritical,
|
|
@@ -3857,6 +4121,7 @@ function getRawGeneratorOptions(generator, type) {
|
|
|
3857
4121
|
type: 'css',
|
|
3858
4122
|
css: {
|
|
3859
4123
|
exportsOnly: (options1 = generator).exportsOnly,
|
|
4124
|
+
runtimePublicPath: options1.runtimePublicPath,
|
|
3860
4125
|
esModule: options1.esModule
|
|
3861
4126
|
}
|
|
3862
4127
|
};
|
|
@@ -3920,60 +4185,256 @@ function getRawCssAutoOrModuleGeneratorOptions(options) {
|
|
|
3920
4185
|
localIdentHashSalt: options.localIdentHashSalt,
|
|
3921
4186
|
exportsConvention: options.exportsConvention,
|
|
3922
4187
|
exportsOnly: options.exportsOnly,
|
|
4188
|
+
runtimePublicPath: options.runtimePublicPath,
|
|
3923
4189
|
esModule: options.esModule
|
|
3924
4190
|
};
|
|
3925
4191
|
}
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
4192
|
+
let DYNAMIC_INFO = Symbol('cleverMerge dynamic info'), mergeCache = new WeakMap(), DELETE = Symbol('DELETE'), cachedCleverMerge = (first, second)=>{
|
|
4193
|
+
if (void 0 === second) return first;
|
|
4194
|
+
if (void 0 === first || 'object' != typeof second || null === second) return second;
|
|
4195
|
+
if ('object' != typeof first || null === first) return first;
|
|
4196
|
+
let innerCache = mergeCache.get(first);
|
|
4197
|
+
void 0 === innerCache && (innerCache = new WeakMap(), mergeCache.set(first, innerCache));
|
|
4198
|
+
let prevMerge = innerCache.get(second);
|
|
4199
|
+
if (void 0 !== prevMerge) return prevMerge;
|
|
4200
|
+
let newMerge = _cleverMerge(first, second, !0);
|
|
4201
|
+
return innerCache.set(second, newMerge), newMerge;
|
|
4202
|
+
}, parseCache = new WeakMap(), cachedParseObject = (obj)=>{
|
|
4203
|
+
let entry = parseCache.get(obj);
|
|
4204
|
+
if (void 0 !== entry) return entry;
|
|
4205
|
+
let result = parseObject(obj);
|
|
4206
|
+
return parseCache.set(obj, result), result;
|
|
4207
|
+
}, parseObject = (obj)=>{
|
|
4208
|
+
let dynamicInfo, info = new Map(), getInfo = (p)=>{
|
|
4209
|
+
let entry = info.get(p);
|
|
4210
|
+
if (void 0 !== entry) return entry;
|
|
4211
|
+
let newEntry = {
|
|
4212
|
+
base: void 0,
|
|
4213
|
+
byProperty: void 0,
|
|
4214
|
+
byValues: new Map()
|
|
3944
4215
|
};
|
|
3945
|
-
return
|
|
3946
|
-
}
|
|
3947
|
-
#processResolveResult = (text)=>{
|
|
3948
|
-
if (!text) return;
|
|
3949
|
-
let resolveRequest = this.#resolveRequestCache.get(text);
|
|
3950
|
-
return resolveRequest || (resolveRequest = JSON.parse(text), this.#resolveRequestCache.set(text, resolveRequest)), Object.assign({}, resolveRequest);
|
|
4216
|
+
return info.set(p, newEntry), newEntry;
|
|
3951
4217
|
};
|
|
3952
|
-
|
|
3953
|
-
|
|
4218
|
+
for (let key of Object.keys(obj))if (key.startsWith('by')) {
|
|
4219
|
+
let byObj = obj[key];
|
|
4220
|
+
if ('object' == typeof byObj) for (let byValue of Object.keys(byObj)){
|
|
4221
|
+
let obj = byObj[byValue];
|
|
4222
|
+
for (let key1 of Object.keys(obj)){
|
|
4223
|
+
let entry = getInfo(key1);
|
|
4224
|
+
if (void 0 === entry.byProperty) entry.byProperty = key;
|
|
4225
|
+
else if (entry.byProperty !== key) throw Error(`${key} and ${entry.byProperty} for a single property is not supported`);
|
|
4226
|
+
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);
|
|
4227
|
+
}
|
|
4228
|
+
}
|
|
4229
|
+
else if ('function' == typeof byObj) if (void 0 === dynamicInfo) dynamicInfo = {
|
|
4230
|
+
byProperty: key,
|
|
4231
|
+
fn: byObj
|
|
4232
|
+
};
|
|
4233
|
+
else throw Error(`${key} and ${dynamicInfo.byProperty} when both are functions is not supported`);
|
|
4234
|
+
else getInfo(key).base = obj[key];
|
|
4235
|
+
} else getInfo(key).base = obj[key];
|
|
4236
|
+
return {
|
|
4237
|
+
static: info,
|
|
4238
|
+
dynamic: dynamicInfo
|
|
4239
|
+
};
|
|
4240
|
+
}, cleverMerge_serializeObject = (info, dynamicInfo)=>{
|
|
4241
|
+
let obj = {};
|
|
4242
|
+
for (let entry of info.values())if (void 0 !== entry.byProperty) {
|
|
4243
|
+
let byObj = obj[entry.byProperty] = obj[entry.byProperty] || {};
|
|
4244
|
+
for (let byValue of entry.byValues.keys())byObj[byValue] = byObj[byValue] || {};
|
|
3954
4245
|
}
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
let
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
4246
|
+
for (let [key, entry] of info)if (void 0 !== entry.base && (obj[key] = entry.base), void 0 !== entry.byProperty) {
|
|
4247
|
+
let byObj = obj[entry.byProperty] = obj[entry.byProperty] || {};
|
|
4248
|
+
for (let byValue of Object.keys(byObj)){
|
|
4249
|
+
let value = getFromByValues(entry.byValues, byValue);
|
|
4250
|
+
void 0 !== value && (byObj[byValue][key] = value);
|
|
4251
|
+
}
|
|
4252
|
+
}
|
|
4253
|
+
return void 0 !== dynamicInfo && (obj[dynamicInfo.byProperty] = dynamicInfo.fn), obj;
|
|
4254
|
+
}, 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)=>{
|
|
4255
|
+
let firstObject = internalCaching ? cachedParseObject(first) : parseObject(first), { static: firstInfo, dynamic: firstDynamicInfo } = firstObject, secondObj = second;
|
|
4256
|
+
if (void 0 !== firstDynamicInfo) {
|
|
4257
|
+
let { fn } = firstDynamicInfo, { byProperty } = firstDynamicInfo, fnInfo = fn[DYNAMIC_INFO];
|
|
4258
|
+
fnInfo && (secondObj = internalCaching ? cachedCleverMerge(fnInfo[1], second) : cleverMerge(fnInfo[1], second), fn = fnInfo[0]);
|
|
4259
|
+
let newFn = (...args)=>{
|
|
4260
|
+
let fnResult = fn(...args);
|
|
4261
|
+
return internalCaching ? cachedCleverMerge(fnResult, secondObj) : cleverMerge(fnResult, secondObj);
|
|
4262
|
+
};
|
|
4263
|
+
return newFn[DYNAMIC_INFO] = [
|
|
4264
|
+
fn,
|
|
4265
|
+
secondObj
|
|
4266
|
+
], cleverMerge_serializeObject(firstObject.static, {
|
|
4267
|
+
byProperty,
|
|
4268
|
+
fn: newFn
|
|
4269
|
+
});
|
|
4270
|
+
}
|
|
4271
|
+
let { static: secondInfo, dynamic: secondDynamicInfo } = internalCaching ? cachedParseObject(second) : parseObject(second), resultInfo = new Map();
|
|
4272
|
+
for (let [key, firstEntry] of firstInfo){
|
|
4273
|
+
let secondEntry = secondInfo.get(key), entry = void 0 !== secondEntry ? mergeEntries(firstEntry, secondEntry, internalCaching) : firstEntry;
|
|
4274
|
+
resultInfo.set(key, entry);
|
|
4275
|
+
}
|
|
4276
|
+
for (let [key, secondEntry] of secondInfo)firstInfo.has(key) || resultInfo.set(key, secondEntry);
|
|
4277
|
+
return cleverMerge_serializeObject(resultInfo, secondDynamicInfo);
|
|
4278
|
+
}, mergeEntries = (firstEntry, secondEntry, internalCaching)=>{
|
|
4279
|
+
switch(getValueType(secondEntry.base)){
|
|
4280
|
+
case 1:
|
|
4281
|
+
case 4:
|
|
4282
|
+
return secondEntry;
|
|
4283
|
+
case 0:
|
|
4284
|
+
{
|
|
4285
|
+
if (!firstEntry.byProperty) return {
|
|
4286
|
+
base: firstEntry.base,
|
|
4287
|
+
byProperty: secondEntry.byProperty,
|
|
4288
|
+
byValues: secondEntry.byValues
|
|
4289
|
+
};
|
|
4290
|
+
if (firstEntry.byProperty !== secondEntry.byProperty) throw Error(`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`);
|
|
4291
|
+
let newByValues = new Map(firstEntry.byValues);
|
|
4292
|
+
for (let [key, value] of secondEntry.byValues){
|
|
4293
|
+
let firstValue = getFromByValues(firstEntry.byValues, key);
|
|
4294
|
+
newByValues.set(key, mergeSingleValue(firstValue, value, internalCaching));
|
|
4295
|
+
}
|
|
4296
|
+
return {
|
|
4297
|
+
base: firstEntry.base,
|
|
4298
|
+
byProperty: firstEntry.byProperty,
|
|
4299
|
+
byValues: newByValues
|
|
4300
|
+
};
|
|
4301
|
+
}
|
|
4302
|
+
default:
|
|
4303
|
+
{
|
|
4304
|
+
let newBase;
|
|
4305
|
+
if (!firstEntry.byProperty) return {
|
|
4306
|
+
base: mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching),
|
|
4307
|
+
byProperty: secondEntry.byProperty,
|
|
4308
|
+
byValues: secondEntry.byValues
|
|
4309
|
+
};
|
|
4310
|
+
let intermediateByValues = new Map(firstEntry.byValues);
|
|
4311
|
+
for (let [key, value] of intermediateByValues)intermediateByValues.set(key, mergeSingleValue(value, secondEntry.base, internalCaching));
|
|
4312
|
+
if (Array.from(firstEntry.byValues.values()).every((value)=>{
|
|
4313
|
+
let type = getValueType(value);
|
|
4314
|
+
return 1 === type || 4 === type;
|
|
4315
|
+
}) ? newBase = mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching) : (newBase = firstEntry.base, intermediateByValues.has('default') || intermediateByValues.set('default', secondEntry.base)), !secondEntry.byProperty) return {
|
|
4316
|
+
base: newBase,
|
|
4317
|
+
byProperty: firstEntry.byProperty,
|
|
4318
|
+
byValues: intermediateByValues
|
|
4319
|
+
};
|
|
4320
|
+
if (firstEntry.byProperty !== secondEntry.byProperty) throw Error(`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`);
|
|
4321
|
+
let newByValues = new Map(intermediateByValues);
|
|
4322
|
+
for (let [key, value] of secondEntry.byValues){
|
|
4323
|
+
let firstValue = getFromByValues(intermediateByValues, key);
|
|
4324
|
+
newByValues.set(key, mergeSingleValue(firstValue, value, internalCaching));
|
|
4325
|
+
}
|
|
4326
|
+
return {
|
|
4327
|
+
base: newBase,
|
|
4328
|
+
byProperty: firstEntry.byProperty,
|
|
4329
|
+
byValues: newByValues
|
|
4330
|
+
};
|
|
4331
|
+
}
|
|
4332
|
+
}
|
|
4333
|
+
}, getFromByValues = (byValues, key)=>'default' !== key && byValues.has(key) ? byValues.get(key) : byValues.get('default'), mergeSingleValue = (a, b, internalCaching)=>{
|
|
4334
|
+
let bType = getValueType(b), aType = getValueType(a);
|
|
4335
|
+
switch(bType){
|
|
4336
|
+
case 4:
|
|
4337
|
+
case 1:
|
|
4338
|
+
return b;
|
|
4339
|
+
case 3:
|
|
4340
|
+
return 3 !== aType ? b : internalCaching ? cachedCleverMerge(a, b) : cleverMerge(a, b);
|
|
4341
|
+
case 0:
|
|
4342
|
+
return a;
|
|
4343
|
+
case 2:
|
|
4344
|
+
switch(1 !== aType ? aType : Array.isArray(a) ? 2 : 3){
|
|
4345
|
+
case 0:
|
|
4346
|
+
return b;
|
|
4347
|
+
case 4:
|
|
4348
|
+
return b.filter((item)=>'...' !== item);
|
|
4349
|
+
case 2:
|
|
4350
|
+
{
|
|
4351
|
+
let newArray = [];
|
|
4352
|
+
for (let item of b)if ('...' === item) for (let item of a)newArray.push(item);
|
|
4353
|
+
else newArray.push(item);
|
|
4354
|
+
return newArray;
|
|
4355
|
+
}
|
|
4356
|
+
case 3:
|
|
4357
|
+
return b.map((item)=>'...' === item ? a : item);
|
|
4358
|
+
default:
|
|
4359
|
+
throw Error('Not implemented');
|
|
4360
|
+
}
|
|
4361
|
+
default:
|
|
4362
|
+
throw Error('Not implemented');
|
|
4363
|
+
}
|
|
4364
|
+
}, resolveLayerExternals = (item, layer)=>{
|
|
4365
|
+
if ('object' != typeof item || null === item || !('byLayer' in item)) return item;
|
|
4366
|
+
let { byLayer, ...remaining } = item;
|
|
4367
|
+
if (void 0 === byLayer) return remaining;
|
|
4368
|
+
if ('object' == typeof byLayer) {
|
|
4369
|
+
let key = String(layer);
|
|
4370
|
+
return Object.hasOwn(byLayer, key) ? mergeExternalObjects(remaining, byLayer[key]) : Object.hasOwn(byLayer, 'default') ? mergeExternalObjects(remaining, byLayer.default) : remaining;
|
|
4371
|
+
}
|
|
4372
|
+
return 'function' == typeof byLayer ? mergeExternalObjects(remaining, resolveLayerExternals(byLayer(layer), layer)) : item;
|
|
4373
|
+
};
|
|
4374
|
+
function mergeExternalObjects(base, overrides) {
|
|
4375
|
+
return 'object' != typeof overrides || null === overrides || overrides instanceof RegExp ? void 0 === overrides ? base : overrides : {
|
|
4376
|
+
...base,
|
|
4377
|
+
...Object.fromEntries(Object.entries(overrides).map(([request, value])=>[
|
|
4378
|
+
request,
|
|
4379
|
+
cachedCleverMerge({
|
|
4380
|
+
value: Object.hasOwn(base, request) ? base[request] : void 0
|
|
4381
|
+
}, {
|
|
4382
|
+
value
|
|
4383
|
+
}).value
|
|
4384
|
+
]))
|
|
4385
|
+
};
|
|
4386
|
+
}
|
|
4387
|
+
class ExternalsPlugin extends RspackBuiltinPlugin {
|
|
4388
|
+
type;
|
|
4389
|
+
externals;
|
|
4390
|
+
placeInInitial;
|
|
4391
|
+
fallbackType;
|
|
4392
|
+
name = binding_.BuiltinPluginName.ExternalsPlugin;
|
|
4393
|
+
#resolveRequestCache = new Map();
|
|
4394
|
+
constructor(type, externals, placeInInitial, fallbackType){
|
|
4395
|
+
super(), this.type = type, this.externals = externals, this.placeInInitial = placeInInitial, this.fallbackType = fallbackType;
|
|
4396
|
+
}
|
|
4397
|
+
raw() {
|
|
4398
|
+
let type = this.type, externals = this.externals, raw = {
|
|
4399
|
+
type,
|
|
4400
|
+
fallbackType: this.fallbackType,
|
|
4401
|
+
externals: (Array.isArray(externals) ? externals : [
|
|
4402
|
+
externals
|
|
4403
|
+
]).filter(Boolean).map((item)=>this.#getRawExternalItem(item)),
|
|
4404
|
+
placeInInitial: this.placeInInitial ?? !1
|
|
4405
|
+
};
|
|
4406
|
+
return createBuiltinPlugin(this.name, raw);
|
|
4407
|
+
}
|
|
4408
|
+
#processResolveResult = (text)=>{
|
|
4409
|
+
if (!text) return;
|
|
4410
|
+
let resolveRequest = this.#resolveRequestCache.get(text);
|
|
4411
|
+
return resolveRequest || (resolveRequest = JSON.parse(text), this.#resolveRequestCache.set(text, resolveRequest)), Object.assign({}, resolveRequest);
|
|
4412
|
+
};
|
|
4413
|
+
#processRequest(req) {
|
|
4414
|
+
return `${req.path.replace(/#/g, '\u200b#')}${req.query.replace(/#/g, '\u200b#')}${req.fragment}`;
|
|
4415
|
+
}
|
|
4416
|
+
#getRawExternalItem = (item)=>{
|
|
4417
|
+
if ('string' == typeof item || item instanceof RegExp) return item;
|
|
4418
|
+
if ('function' == typeof item) {
|
|
4419
|
+
let processResolveResult = this.#processResolveResult, processRequest = this.#processRequest;
|
|
4420
|
+
return async (ctx)=>new Promise((resolve, reject)=>{
|
|
4421
|
+
let data = ctx.data(), promise = item({
|
|
4422
|
+
request: data.request,
|
|
4423
|
+
dependencyType: data.dependencyType,
|
|
4424
|
+
context: data.context,
|
|
3964
4425
|
contextInfo: {
|
|
3965
4426
|
issuer: data.contextInfo.issuer,
|
|
3966
4427
|
issuerLayer: data.contextInfo.issuerLayer ?? null
|
|
3967
4428
|
},
|
|
3968
4429
|
getResolve: (options)=>{
|
|
3969
4430
|
let rawResolve = options ? getRawResolve(options) : void 0, resolve = ctx.getResolve(rawResolve);
|
|
3970
|
-
return (context, request, callback)
|
|
4431
|
+
return function(context, request, callback) {
|
|
3971
4432
|
if (!callback) return new Promise((promiseResolve, promiseReject)=>{
|
|
3972
4433
|
resolve(context, request, (error, text)=>{
|
|
3973
4434
|
if (error) promiseReject(error);
|
|
3974
4435
|
else {
|
|
3975
4436
|
let req = processResolveResult(text);
|
|
3976
|
-
promiseResolve(req ?
|
|
4437
|
+
promiseResolve(req ? processRequest(req) : void 0);
|
|
3977
4438
|
}
|
|
3978
4439
|
});
|
|
3979
4440
|
});
|
|
@@ -3981,7 +4442,7 @@ class ExternalsPlugin extends RspackBuiltinPlugin {
|
|
|
3981
4442
|
if (error) callback(error);
|
|
3982
4443
|
else {
|
|
3983
4444
|
let req = processResolveResult(text);
|
|
3984
|
-
callback(null, !!req &&
|
|
4445
|
+
callback(null, !!req && processRequest(req), req);
|
|
3985
4446
|
}
|
|
3986
4447
|
});
|
|
3987
4448
|
};
|
|
@@ -4001,13 +4462,42 @@ class ExternalsPlugin extends RspackBuiltinPlugin {
|
|
|
4001
4462
|
});
|
|
4002
4463
|
});
|
|
4003
4464
|
}
|
|
4004
|
-
if ('object' == typeof item)
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4465
|
+
if ('object' == typeof item) {
|
|
4466
|
+
let { byLayer } = item;
|
|
4467
|
+
if ('function' == typeof byLayer || byLayer && 'object' == typeof byLayer && Object.values(byLayer).some((branch)=>'object' != typeof branch || branch instanceof RegExp)) {
|
|
4468
|
+
let cache = new Map();
|
|
4469
|
+
return async (ctx)=>{
|
|
4470
|
+
let result, { request, contextInfo } = ctx.data(), layer = contextInfo.issuerLayer ?? null, raw = cache.get(layer);
|
|
4471
|
+
if (void 0 === raw && (raw = this.#getRawExternalItem(resolveLayerExternals(item, layer)), cache.set(layer, raw)), 'function' == typeof raw) return await raw(ctx);
|
|
4472
|
+
if ('string' == typeof raw) raw === request && (result = request);
|
|
4473
|
+
else if (raw instanceof RegExp) raw.lastIndex = 0, raw.test(request) && (result = request), raw.lastIndex = 0;
|
|
4474
|
+
else {
|
|
4475
|
+
let values = raw.byLayer?.[layer ?? 'null'] ?? raw.values;
|
|
4476
|
+
Object.hasOwn(values, request) && (result = values[request]);
|
|
4477
|
+
}
|
|
4478
|
+
return {
|
|
4479
|
+
result,
|
|
4480
|
+
externalType: void 0
|
|
4481
|
+
};
|
|
4482
|
+
};
|
|
4483
|
+
}
|
|
4484
|
+
return {
|
|
4485
|
+
values: getRawExternalObject(resolveLayerExternals(item, 'default')),
|
|
4486
|
+
byLayer: byLayer && Object.fromEntries(Object.keys(byLayer).map((layer)=>[
|
|
4487
|
+
layer,
|
|
4488
|
+
getRawExternalObject(resolveLayerExternals(item, layer))
|
|
4489
|
+
]))
|
|
4490
|
+
};
|
|
4491
|
+
}
|
|
4008
4492
|
throw TypeError(`Unexpected type of external item: ${typeof item}`);
|
|
4009
4493
|
};
|
|
4010
4494
|
}
|
|
4495
|
+
function getRawExternalObject(item) {
|
|
4496
|
+
return Object.fromEntries(Object.entries(item).map(([key, value])=>[
|
|
4497
|
+
key,
|
|
4498
|
+
getRawExternalItemValue(value)
|
|
4499
|
+
]));
|
|
4500
|
+
}
|
|
4011
4501
|
function getRawExternalItemValueFormFnResult(result) {
|
|
4012
4502
|
return void 0 === result ? result : getRawExternalItemValue(result);
|
|
4013
4503
|
}
|
|
@@ -4048,9 +4538,9 @@ let HttpExternalsRspackPlugin = base_create(binding_.BuiltinPluginName.HttpExter
|
|
|
4048
4538
|
}, memoizeFn = (fn)=>{
|
|
4049
4539
|
let cache = null;
|
|
4050
4540
|
return (...args)=>(cache || (cache = fn()), cache(...args));
|
|
4051
|
-
}, getHttp = memoize(()=>
|
|
4541
|
+
}, getHttp = memoize(()=>rspackRequire("node:http")), getHttps = memoize(()=>rspackRequire("node:https")), defaultHttpClientForNode = async (url, headers)=>{
|
|
4052
4542
|
let { res, body } = await function(url, options) {
|
|
4053
|
-
let send = 'https:' === new URL(url).protocol ? getHttps() : getHttp(), { createBrotliDecompress, createGunzip, createInflate } =
|
|
4543
|
+
let send = 'https:' === new URL(url).protocol ? getHttps() : getHttp(), { createBrotliDecompress, createGunzip, createInflate } = rspackRequire("node:zlib");
|
|
4054
4544
|
return new Promise((resolve, reject)=>{
|
|
4055
4545
|
send.get(url, options, (res)=>{
|
|
4056
4546
|
let contentEncoding = res.headers['content-encoding'], stream = res;
|
|
@@ -4090,6 +4580,7 @@ class HttpUriPlugin extends RspackBuiltinPlugin {
|
|
|
4090
4580
|
lockfileLocation,
|
|
4091
4581
|
cacheLocation,
|
|
4092
4582
|
upgrade: options.upgrade ?? !1,
|
|
4583
|
+
frozen: options.frozen ?? !1,
|
|
4093
4584
|
httpClient: options.httpClient ?? defaultHttpClientForNode
|
|
4094
4585
|
};
|
|
4095
4586
|
return createBuiltinPlugin(this.name, raw);
|
|
@@ -4242,7 +4733,7 @@ HtmlRspackPlugin.createHtmlTagObject = (tagName, attributes, innerHTML)=>({
|
|
|
4242
4733
|
])
|
|
4243
4734
|
}, hooks_compilationHooksMap.set(compilation, hooks)), hooks;
|
|
4244
4735
|
}, HtmlRspackPlugin.version = 5;
|
|
4245
|
-
let IgnorePlugin = base_create(binding_.BuiltinPluginName.IgnorePlugin, (options)=>options), InferAsyncModulesPlugin = base_create(binding_.BuiltinPluginName.InferAsyncModulesPlugin, ()=>{}, 'compilation'), InlineExportsPlugin = base_create(binding_.BuiltinPluginName.InlineExportsPlugin, ()=>{}, 'compilation'), JavascriptModulesPlugin_compilationHooksMap = new WeakMap();
|
|
4736
|
+
let IgnorePlugin = base_create(binding_.BuiltinPluginName.IgnorePlugin, (options)=>options), InferAsyncModulesPlugin = base_create(binding_.BuiltinPluginName.InferAsyncModulesPlugin, ()=>{}, 'compilation'), ImportedByDeferModulesPlugin = base_create(binding_.BuiltinPluginName.ImportedByDeferModulesPlugin, ()=>{}, 'compilation'), InlineExportsPlugin = base_create(binding_.BuiltinPluginName.InlineExportsPlugin, ()=>{}, 'compilation'), JavascriptModulesPlugin_compilationHooksMap = new WeakMap();
|
|
4246
4737
|
class JavascriptModulesPlugin extends RspackBuiltinPlugin {
|
|
4247
4738
|
name = binding_.BuiltinPluginName.JavascriptModulesPlugin;
|
|
4248
4739
|
affectedHooks = 'compilation';
|
|
@@ -4281,15 +4772,15 @@ Object.defineProperty(binding__default().KnownBuildInfo.prototype, node_util.ins
|
|
|
4281
4772
|
enumerable: !0,
|
|
4282
4773
|
configurable: !0,
|
|
4283
4774
|
get () {
|
|
4284
|
-
if (this[
|
|
4775
|
+
if (this[BUILD_INFO_ASSETS_SYMBOL][$assets]) return this[BUILD_INFO_ASSETS_SYMBOL][$assets];
|
|
4285
4776
|
let assets = new Proxy(Object.create(null), {
|
|
4286
|
-
ownKeys: ()=>this[
|
|
4777
|
+
ownKeys: ()=>this[BUILD_INFO_ASSETS_SYMBOL].keys(),
|
|
4287
4778
|
getOwnPropertyDescriptor: ()=>({
|
|
4288
4779
|
enumerable: !0,
|
|
4289
4780
|
configurable: !0
|
|
4290
4781
|
})
|
|
4291
4782
|
});
|
|
4292
|
-
return Object.defineProperty(this[
|
|
4783
|
+
return Object.defineProperty(this[BUILD_INFO_ASSETS_SYMBOL], $assets, {
|
|
4293
4784
|
enumerable: !1,
|
|
4294
4785
|
configurable: !0,
|
|
4295
4786
|
value: assets
|
|
@@ -4299,25 +4790,25 @@ Object.defineProperty(binding__default().KnownBuildInfo.prototype, node_util.ins
|
|
|
4299
4790
|
enumerable: !0,
|
|
4300
4791
|
configurable: !0,
|
|
4301
4792
|
get () {
|
|
4302
|
-
return new Set(this[
|
|
4793
|
+
return new Set(this[BUILD_INFO_FILE_DEPENDENCIES_SYMBOL]);
|
|
4303
4794
|
}
|
|
4304
4795
|
}), Object.defineProperty(binding__default().KnownBuildInfo.prototype, 'contextDependencies', {
|
|
4305
4796
|
enumerable: !0,
|
|
4306
4797
|
configurable: !0,
|
|
4307
4798
|
get () {
|
|
4308
|
-
return new Set(this[
|
|
4799
|
+
return new Set(this[BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL]);
|
|
4309
4800
|
}
|
|
4310
4801
|
}), Object.defineProperty(binding__default().KnownBuildInfo.prototype, 'missingDependencies', {
|
|
4311
4802
|
enumerable: !0,
|
|
4312
4803
|
configurable: !0,
|
|
4313
4804
|
get () {
|
|
4314
|
-
return new Set(this[
|
|
4805
|
+
return new Set(this[BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL]);
|
|
4315
4806
|
}
|
|
4316
4807
|
}), Object.defineProperty(binding__default().KnownBuildInfo.prototype, 'buildDependencies', {
|
|
4317
4808
|
enumerable: !0,
|
|
4318
4809
|
configurable: !0,
|
|
4319
4810
|
get () {
|
|
4320
|
-
return new Set(this[
|
|
4811
|
+
return new Set(this[BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL]);
|
|
4321
4812
|
}
|
|
4322
4813
|
});
|
|
4323
4814
|
let knownBuildInfoFields = new Set([
|
|
@@ -4326,7 +4817,302 @@ let knownBuildInfoFields = new Set([
|
|
|
4326
4817
|
'contextDependencies',
|
|
4327
4818
|
'missingDependencies',
|
|
4328
4819
|
'buildDependencies'
|
|
4329
|
-
])
|
|
4820
|
+
]), pickCustomBuildInfoFields = (buildInfo)=>{
|
|
4821
|
+
if (!buildInfo) return {};
|
|
4822
|
+
let custom = {};
|
|
4823
|
+
for (let key of Object.keys(buildInfo))knownBuildInfoFields.has(key) || (custom[key] = buildInfo[key]);
|
|
4824
|
+
return custom;
|
|
4825
|
+
};
|
|
4826
|
+
class ContextModuleFactoryBeforeResolveData {
|
|
4827
|
+
#inner;
|
|
4828
|
+
static __from_binding(binding) {
|
|
4829
|
+
return new ContextModuleFactoryBeforeResolveData(binding);
|
|
4830
|
+
}
|
|
4831
|
+
static __to_binding(data) {
|
|
4832
|
+
return data.#inner;
|
|
4833
|
+
}
|
|
4834
|
+
constructor(binding){
|
|
4835
|
+
this.#inner = binding, Object.defineProperties(this, {
|
|
4836
|
+
context: {
|
|
4837
|
+
enumerable: !0,
|
|
4838
|
+
get: ()=>binding.context,
|
|
4839
|
+
set (val) {
|
|
4840
|
+
binding.context = val;
|
|
4841
|
+
}
|
|
4842
|
+
},
|
|
4843
|
+
request: {
|
|
4844
|
+
enumerable: !0,
|
|
4845
|
+
get: ()=>binding.request,
|
|
4846
|
+
set (val) {
|
|
4847
|
+
binding.request = val;
|
|
4848
|
+
}
|
|
4849
|
+
},
|
|
4850
|
+
regExp: {
|
|
4851
|
+
enumerable: !0,
|
|
4852
|
+
get: ()=>binding.regExp,
|
|
4853
|
+
set (val) {
|
|
4854
|
+
binding.regExp = val;
|
|
4855
|
+
}
|
|
4856
|
+
},
|
|
4857
|
+
recursive: {
|
|
4858
|
+
enumerable: !0,
|
|
4859
|
+
get: ()=>binding.recursive,
|
|
4860
|
+
set (val) {
|
|
4861
|
+
binding.recursive = val;
|
|
4862
|
+
}
|
|
4863
|
+
}
|
|
4864
|
+
});
|
|
4865
|
+
}
|
|
4866
|
+
}
|
|
4867
|
+
class ContextModuleFactoryAfterResolveData {
|
|
4868
|
+
#inner;
|
|
4869
|
+
static __from_binding(binding) {
|
|
4870
|
+
return new ContextModuleFactoryAfterResolveData(binding);
|
|
4871
|
+
}
|
|
4872
|
+
static __to_binding(data) {
|
|
4873
|
+
return data.#inner;
|
|
4874
|
+
}
|
|
4875
|
+
constructor(binding){
|
|
4876
|
+
this.#inner = binding, Object.defineProperties(this, {
|
|
4877
|
+
resource: {
|
|
4878
|
+
enumerable: !0,
|
|
4879
|
+
get: ()=>binding.resource,
|
|
4880
|
+
set (val) {
|
|
4881
|
+
binding.resource = val;
|
|
4882
|
+
}
|
|
4883
|
+
},
|
|
4884
|
+
context: {
|
|
4885
|
+
enumerable: !0,
|
|
4886
|
+
get: ()=>binding.context,
|
|
4887
|
+
set (val) {
|
|
4888
|
+
binding.context = val;
|
|
4889
|
+
}
|
|
4890
|
+
},
|
|
4891
|
+
request: {
|
|
4892
|
+
enumerable: !0,
|
|
4893
|
+
get: ()=>binding.request,
|
|
4894
|
+
set (val) {
|
|
4895
|
+
binding.request = val;
|
|
4896
|
+
}
|
|
4897
|
+
},
|
|
4898
|
+
regExp: {
|
|
4899
|
+
enumerable: !0,
|
|
4900
|
+
get: ()=>binding.regExp,
|
|
4901
|
+
set (val) {
|
|
4902
|
+
binding.regExp = val;
|
|
4903
|
+
}
|
|
4904
|
+
},
|
|
4905
|
+
recursive: {
|
|
4906
|
+
enumerable: !0,
|
|
4907
|
+
get: ()=>binding.recursive,
|
|
4908
|
+
set (val) {
|
|
4909
|
+
binding.recursive = val;
|
|
4910
|
+
}
|
|
4911
|
+
},
|
|
4912
|
+
dependencies: {
|
|
4913
|
+
enumerable: !0,
|
|
4914
|
+
get: ()=>binding.dependencies
|
|
4915
|
+
}
|
|
4916
|
+
});
|
|
4917
|
+
}
|
|
4918
|
+
}
|
|
4919
|
+
let Module_Module = class Module {
|
|
4920
|
+
static #properties = {
|
|
4921
|
+
type: {
|
|
4922
|
+
enumerable: !0,
|
|
4923
|
+
configurable: !0,
|
|
4924
|
+
get () {
|
|
4925
|
+
return null === this.#type && (this.#type = binding__default().moduleGetType(this)), this.#type;
|
|
4926
|
+
},
|
|
4927
|
+
set (value) {
|
|
4928
|
+
this.#type = value;
|
|
4929
|
+
}
|
|
4930
|
+
},
|
|
4931
|
+
context: {
|
|
4932
|
+
enumerable: !0,
|
|
4933
|
+
configurable: !0,
|
|
4934
|
+
get () {
|
|
4935
|
+
return binding__default().moduleGetContext(this);
|
|
4936
|
+
}
|
|
4937
|
+
},
|
|
4938
|
+
layer: {
|
|
4939
|
+
enumerable: !0,
|
|
4940
|
+
configurable: !0,
|
|
4941
|
+
get () {
|
|
4942
|
+
return binding__default().moduleGetLayer(this);
|
|
4943
|
+
}
|
|
4944
|
+
},
|
|
4945
|
+
useSourceMap: {
|
|
4946
|
+
enumerable: !0,
|
|
4947
|
+
configurable: !0,
|
|
4948
|
+
get () {
|
|
4949
|
+
return binding__default().moduleGetUseSourceMap(this);
|
|
4950
|
+
}
|
|
4951
|
+
},
|
|
4952
|
+
useSimpleSourceMap: {
|
|
4953
|
+
enumerable: !0,
|
|
4954
|
+
configurable: !0,
|
|
4955
|
+
get () {
|
|
4956
|
+
return binding__default().moduleGetUseSimpleSourceMap(this);
|
|
4957
|
+
}
|
|
4958
|
+
},
|
|
4959
|
+
factoryMeta: {
|
|
4960
|
+
enumerable: !0,
|
|
4961
|
+
configurable: !0,
|
|
4962
|
+
get () {
|
|
4963
|
+
return binding__default().moduleGetFactoryMeta(this);
|
|
4964
|
+
},
|
|
4965
|
+
set (value) {
|
|
4966
|
+
binding__default().moduleSetFactoryMeta(this, value);
|
|
4967
|
+
}
|
|
4968
|
+
},
|
|
4969
|
+
buildInfo: {
|
|
4970
|
+
enumerable: !0,
|
|
4971
|
+
configurable: !0,
|
|
4972
|
+
get () {
|
|
4973
|
+
return binding__default().moduleGetBuildInfo(this);
|
|
4974
|
+
},
|
|
4975
|
+
set (value) {
|
|
4976
|
+
binding__default().moduleSetBuildInfo(this, value);
|
|
4977
|
+
}
|
|
4978
|
+
}
|
|
4979
|
+
};
|
|
4980
|
+
#identifier;
|
|
4981
|
+
#type = null;
|
|
4982
|
+
constructor(){
|
|
4983
|
+
Object.defineProperties(this, Module.#properties), this.buildMeta = {};
|
|
4984
|
+
}
|
|
4985
|
+
identifier() {
|
|
4986
|
+
return this.#identifier ??= binding__default().moduleGetIdentifier(this);
|
|
4987
|
+
}
|
|
4988
|
+
get blocks() {
|
|
4989
|
+
return binding__default().moduleGetBlocks(this);
|
|
4990
|
+
}
|
|
4991
|
+
get dependencies() {
|
|
4992
|
+
return binding__default().moduleGetDependencies(this);
|
|
4993
|
+
}
|
|
4994
|
+
readableIdentifier() {
|
|
4995
|
+
return binding__default().moduleGetReadableIdentifier(this);
|
|
4996
|
+
}
|
|
4997
|
+
originalSource() {
|
|
4998
|
+
let source = binding__default().moduleGetOriginalSource(this);
|
|
4999
|
+
return source ? SourceAdapter.fromBinding(source) : null;
|
|
5000
|
+
}
|
|
5001
|
+
nameForCondition() {
|
|
5002
|
+
return binding__default().moduleGetNameForCondition(this);
|
|
5003
|
+
}
|
|
5004
|
+
size(ty) {
|
|
5005
|
+
return binding__default().moduleSize(this, ty);
|
|
5006
|
+
}
|
|
5007
|
+
libIdent(options) {
|
|
5008
|
+
return binding__default().moduleLibIdent(this, options);
|
|
5009
|
+
}
|
|
5010
|
+
emitFile(filename, source, assetInfo) {
|
|
5011
|
+
binding__default().moduleEmitFile(this, filename, SourceAdapter.toBinding(source), assetInfo);
|
|
5012
|
+
}
|
|
5013
|
+
};
|
|
5014
|
+
class NormalModule extends Module_Module {
|
|
5015
|
+
#resource = null;
|
|
5016
|
+
#request = null;
|
|
5017
|
+
#userRequest = null;
|
|
5018
|
+
#rawRequest = null;
|
|
5019
|
+
#resourceResolveData = null;
|
|
5020
|
+
#loaders = null;
|
|
5021
|
+
static #properties = {
|
|
5022
|
+
resource: {
|
|
5023
|
+
enumerable: !0,
|
|
5024
|
+
configurable: !0,
|
|
5025
|
+
get () {
|
|
5026
|
+
return null === this.#resource && (this.#resource = binding__default().normalModuleGetResource(this)), this.#resource;
|
|
5027
|
+
},
|
|
5028
|
+
set (value) {
|
|
5029
|
+
this.#resource = value;
|
|
5030
|
+
}
|
|
5031
|
+
},
|
|
5032
|
+
request: {
|
|
5033
|
+
enumerable: !0,
|
|
5034
|
+
configurable: !0,
|
|
5035
|
+
get () {
|
|
5036
|
+
return null === this.#request && (this.#request = binding__default().normalModuleGetRequest(this)), this.#request;
|
|
5037
|
+
},
|
|
5038
|
+
set (value) {
|
|
5039
|
+
this.#request = value;
|
|
5040
|
+
}
|
|
5041
|
+
},
|
|
5042
|
+
userRequest: {
|
|
5043
|
+
enumerable: !0,
|
|
5044
|
+
configurable: !0,
|
|
5045
|
+
get () {
|
|
5046
|
+
return null === this.#userRequest && (this.#userRequest = binding__default().normalModuleGetUserRequest(this)), this.#userRequest;
|
|
5047
|
+
},
|
|
5048
|
+
set (value) {
|
|
5049
|
+
this.#userRequest = value;
|
|
5050
|
+
}
|
|
5051
|
+
},
|
|
5052
|
+
rawRequest: {
|
|
5053
|
+
enumerable: !0,
|
|
5054
|
+
configurable: !0,
|
|
5055
|
+
get () {
|
|
5056
|
+
return null === this.#rawRequest && (this.#rawRequest = binding__default().normalModuleGetRawRequest(this)), this.#rawRequest;
|
|
5057
|
+
},
|
|
5058
|
+
set (value) {
|
|
5059
|
+
this.#rawRequest = value;
|
|
5060
|
+
}
|
|
5061
|
+
},
|
|
5062
|
+
resourceResolveData: {
|
|
5063
|
+
enumerable: !0,
|
|
5064
|
+
configurable: !0,
|
|
5065
|
+
get () {
|
|
5066
|
+
return null === this.#resourceResolveData && (this.#resourceResolveData = binding__default().normalModuleGetResourceResolveData(this)), this.#resourceResolveData;
|
|
5067
|
+
},
|
|
5068
|
+
set (value) {
|
|
5069
|
+
this.#resourceResolveData = value;
|
|
5070
|
+
}
|
|
5071
|
+
},
|
|
5072
|
+
loaders: {
|
|
5073
|
+
enumerable: !0,
|
|
5074
|
+
configurable: !0,
|
|
5075
|
+
get () {
|
|
5076
|
+
return null === this.#loaders && (this.#loaders = binding__default().normalModuleGetLoaders(this)), this.#loaders;
|
|
5077
|
+
},
|
|
5078
|
+
set (value) {
|
|
5079
|
+
this.#loaders = value;
|
|
5080
|
+
}
|
|
5081
|
+
},
|
|
5082
|
+
matchResource: {
|
|
5083
|
+
enumerable: !0,
|
|
5084
|
+
configurable: !0,
|
|
5085
|
+
get () {
|
|
5086
|
+
return binding__default().normalModuleGetMatchResource(this);
|
|
5087
|
+
},
|
|
5088
|
+
set (value) {
|
|
5089
|
+
binding__default().normalModuleSetMatchResource(this, value);
|
|
5090
|
+
}
|
|
5091
|
+
},
|
|
5092
|
+
error: {
|
|
5093
|
+
enumerable: !0,
|
|
5094
|
+
configurable: !0,
|
|
5095
|
+
get () {
|
|
5096
|
+
return binding__default().normalModuleGetError(this);
|
|
5097
|
+
}
|
|
5098
|
+
}
|
|
5099
|
+
};
|
|
5100
|
+
constructor(){
|
|
5101
|
+
super(), Object.defineProperties(this, NormalModule.#properties);
|
|
5102
|
+
}
|
|
5103
|
+
static getCompilationHooks(compilation) {
|
|
5104
|
+
if (!(COMPILATION_HOOKS_MAP_SYMBOL in compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
|
|
5105
|
+
return getOrCreateCompilationHooks(compilation, compilation, ()=>({
|
|
5106
|
+
loader: new SyncHook([
|
|
5107
|
+
'loaderContext',
|
|
5108
|
+
'module'
|
|
5109
|
+
]),
|
|
5110
|
+
readResource: new HookMap(()=>new AsyncSeriesBailHook([
|
|
5111
|
+
'loaderContext'
|
|
5112
|
+
]))
|
|
5113
|
+
}));
|
|
5114
|
+
}
|
|
5115
|
+
}
|
|
4330
5116
|
class NonErrorEmittedError extends Error {
|
|
4331
5117
|
constructor(error){
|
|
4332
5118
|
super(), this.name = 'NonErrorEmittedError', this.message = `(Emitted value instead of an instance of Error) ${error}`;
|
|
@@ -4470,7 +5256,6 @@ class Hash {
|
|
|
4470
5256
|
throw new AbstractMethodError();
|
|
4471
5257
|
}
|
|
4472
5258
|
}
|
|
4473
|
-
let MAX_SHORT_STRING = -4 & Math.floor(16368);
|
|
4474
5259
|
class WasmHash {
|
|
4475
5260
|
exports;
|
|
4476
5261
|
instancesPool;
|
|
@@ -4488,7 +5273,7 @@ class WasmHash {
|
|
|
4488
5273
|
update(data, encoding) {
|
|
4489
5274
|
if ('string' == typeof data) {
|
|
4490
5275
|
let normalizedData = data;
|
|
4491
|
-
for(; normalizedData.length >
|
|
5276
|
+
for(; normalizedData.length > 16368;)this._updateWithShortString(normalizedData.slice(0, 16368), encoding), normalizedData = normalizedData.slice(16368);
|
|
4492
5277
|
return this._updateWithShortString(normalizedData, encoding), this;
|
|
4493
5278
|
}
|
|
4494
5279
|
return this._updateWithBuffer(data), this;
|
|
@@ -4611,12 +5396,12 @@ let createHash_createHash = (algorithm)=>{
|
|
|
4611
5396
|
})());
|
|
4612
5397
|
case 'native-md4':
|
|
4613
5398
|
return new BulkUpdateDecorator(()=>{
|
|
4614
|
-
let { createHash } =
|
|
5399
|
+
let { createHash } = rspackRequire("node:crypto");
|
|
4615
5400
|
return createHash('md4');
|
|
4616
5401
|
}, 'md4');
|
|
4617
5402
|
default:
|
|
4618
5403
|
return new BulkUpdateDecorator(()=>{
|
|
4619
|
-
let { createHash } =
|
|
5404
|
+
let { createHash } = rspackRequire("node:crypto");
|
|
4620
5405
|
return createHash(algorithm);
|
|
4621
5406
|
}, algorithm);
|
|
4622
5407
|
}
|
|
@@ -4640,66 +5425,59 @@ class ModuleWarning extends lib_WebpackError {
|
|
|
4640
5425
|
super(ModuleError_createMessage(err, 'Warning', from)), this.name = 'ModuleWarning', this.error = err, this.details = getErrorDetails(err);
|
|
4641
5426
|
}
|
|
4642
5427
|
}
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
#dependencies;
|
|
4647
|
-
constructor(context, dependencies){
|
|
4648
|
-
this.#context = context, this.#api = context.__internal__loaderCache, this.#dependencies = dependencies;
|
|
4649
|
-
}
|
|
4650
|
-
async get(loaderIndex, content, additionalData) {
|
|
4651
|
-
let context = this.#context, loader = context.loaderItems[loaderIndex];
|
|
4652
|
-
if (!context.cacheable || !loader || isNil(content) || !isNil(additionalData) || Object.keys(context.__internal__parseMeta).length > 0 || this.#dependencies.contextDependencies().length > 0 || this.#dependencies.missingDependencies().length > 0) return;
|
|
4653
|
-
let hit = await this.#api.get(loaderIndex, content, this.#dependencies.existing);
|
|
4654
|
-
return hit && this.#dependencies.addDependencies(hit.addedDependencies), hit;
|
|
4655
|
-
}
|
|
4656
|
-
async store(loaderIndex, content, sourceMap, additionalData) {
|
|
4657
|
-
let context = this.#context;
|
|
4658
|
-
context.cacheable && isNil(additionalData) && !(Object.keys(context.__internal__parseMeta).length > 0) && await this.#api.store(loaderIndex, {
|
|
4659
|
-
content: isNil(content) ? null : content,
|
|
4660
|
-
sourceMap,
|
|
4661
|
-
addedDependencies: this.#dependencies.added,
|
|
4662
|
-
removedDependencies: this.#dependencies.removed
|
|
4663
|
-
});
|
|
4664
|
-
}
|
|
4665
|
-
async workerGet(loaderIndex, content, additionalData) {
|
|
4666
|
-
let hit = await this.get(loaderIndex, content, additionalData);
|
|
4667
|
-
if (hit) return hit;
|
|
4668
|
-
}
|
|
4669
|
-
async workerStore(loaderIndex, content, sourceMap, additionalData) {
|
|
4670
|
-
await this.store(loaderIndex, content, sourceMap, additionalData);
|
|
4671
|
-
}
|
|
4672
|
-
}
|
|
4673
|
-
let DEPENDENCY_KEYS = [
|
|
5428
|
+
let codeFilter_decoder = new TextDecoder('utf-8', {
|
|
5429
|
+
fatal: !0
|
|
5430
|
+
}), DEPENDENCY_KEYS = [
|
|
4674
5431
|
'fileDependencies',
|
|
4675
5432
|
'contextDependencies',
|
|
4676
5433
|
'missingDependencies',
|
|
4677
5434
|
'buildDependencies'
|
|
4678
|
-
],
|
|
4679
|
-
fileDependencies:
|
|
4680
|
-
contextDependencies:
|
|
4681
|
-
missingDependencies:
|
|
4682
|
-
buildDependencies:
|
|
4683
|
-
}),
|
|
4684
|
-
|
|
4685
|
-
|
|
5435
|
+
], createSets = ()=>({
|
|
5436
|
+
fileDependencies: new Set(),
|
|
5437
|
+
contextDependencies: new Set(),
|
|
5438
|
+
missingDependencies: new Set(),
|
|
5439
|
+
buildDependencies: new Set()
|
|
5440
|
+
}), setsFrom = (dependencies)=>({
|
|
5441
|
+
fileDependencies: new Set(dependencies.fileDependencies),
|
|
5442
|
+
contextDependencies: new Set(dependencies.contextDependencies),
|
|
5443
|
+
missingDependencies: new Set(dependencies.missingDependencies),
|
|
5444
|
+
buildDependencies: new Set(dependencies.buildDependencies)
|
|
5445
|
+
}), arraysFrom = (sets)=>({
|
|
5446
|
+
fileDependencies: Array.from(sets.fileDependencies),
|
|
5447
|
+
contextDependencies: Array.from(sets.contextDependencies),
|
|
5448
|
+
missingDependencies: Array.from(sets.missingDependencies),
|
|
5449
|
+
buildDependencies: Array.from(sets.buildDependencies)
|
|
5450
|
+
});
|
|
4686
5451
|
class LoaderDependenciesState {
|
|
4687
5452
|
existing;
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
5453
|
+
#existingSets = {};
|
|
5454
|
+
#addedSets;
|
|
5455
|
+
#removedSets;
|
|
5456
|
+
constructor(existing, added, removed){
|
|
5457
|
+
this.existing = existing, this.#addedSets = added ? setsFrom(added) : createSets(), this.#removedSets = removed ? setsFrom(removed) : createSets();
|
|
5458
|
+
}
|
|
5459
|
+
#getExisting(key) {
|
|
5460
|
+
return this.#existingSets[key] ??= new Set(this.existing[key]);
|
|
5461
|
+
}
|
|
5462
|
+
get added() {
|
|
5463
|
+
return arraysFrom(this.#addedSets);
|
|
5464
|
+
}
|
|
5465
|
+
get removed() {
|
|
5466
|
+
return arraysFrom(this.#removedSets);
|
|
4692
5467
|
}
|
|
4693
5468
|
resetChanges() {
|
|
4694
|
-
for (let key of DEPENDENCY_KEYS)
|
|
5469
|
+
for (let key of DEPENDENCY_KEYS)this.#addedSets[key].clear(), this.#removedSets[key].clear();
|
|
4695
5470
|
}
|
|
4696
5471
|
mergeChanges() {
|
|
4697
5472
|
for (let key of DEPENDENCY_KEYS){
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
5473
|
+
let added = this.#addedSets[key], removed = this.#removedSets[key];
|
|
5474
|
+
if (0 === added.size && 0 === removed.size) continue;
|
|
5475
|
+
let existing = this.#getExisting(key);
|
|
5476
|
+
for (let dependency of removed)existing.delete(dependency);
|
|
5477
|
+
for (let dependency of added)existing.add(dependency);
|
|
5478
|
+
let target = this.existing[key];
|
|
5479
|
+
for (let dependency of (target.length = 0, existing))target.push(dependency);
|
|
4701
5480
|
}
|
|
4702
|
-
this.resetChanges();
|
|
4703
5481
|
}
|
|
4704
5482
|
addDependencies(dependencies) {
|
|
4705
5483
|
for (let key of DEPENDENCY_KEYS)for (let dependency of dependencies[key])this.add(key, dependency);
|
|
@@ -4729,121 +5507,62 @@ class LoaderDependenciesState {
|
|
|
4729
5507
|
this.clear('fileDependencies'), this.clear('contextDependencies'), this.clear('missingDependencies');
|
|
4730
5508
|
}
|
|
4731
5509
|
add(key, dependency) {
|
|
4732
|
-
|
|
4733
|
-
for(let index = removed.length - 1; index >= 0; index--)removed[index] === dependency && removed.splice(index, 1);
|
|
4734
|
-
this.added[key].includes(dependency) || this.added[key].push(dependency);
|
|
5510
|
+
this.#addedSets[key].add(dependency);
|
|
4735
5511
|
}
|
|
4736
5512
|
get(key) {
|
|
4737
|
-
let removed = new Set(
|
|
4738
|
-
|
|
5513
|
+
let removed = this.#removedSets[key], dependencies = new Set();
|
|
5514
|
+
for (let dependency of this.#getExisting(key))removed.has(dependency) || dependencies.add(dependency);
|
|
5515
|
+
for (let dependency of this.#addedSets[key])dependencies.add(dependency);
|
|
5516
|
+
return Array.from(dependencies);
|
|
4739
5517
|
}
|
|
4740
5518
|
clear(key) {
|
|
4741
|
-
|
|
5519
|
+
let removed = this.#removedSets[key];
|
|
5520
|
+
for (let dependency of this.#getExisting(key))removed.add(dependency);
|
|
5521
|
+
this.#addedSets[key].clear();
|
|
4742
5522
|
}
|
|
4743
5523
|
}
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
concurrentTasksPerWorker: 1
|
|
4752
|
-
});
|
|
4753
|
-
}));
|
|
4754
|
-
function serializeError(error) {
|
|
4755
|
-
if (error instanceof Error || error && 'object' == typeof error && 'message' in error) return {
|
|
4756
|
-
...error,
|
|
4757
|
-
name: error.name,
|
|
4758
|
-
stack: error.stack,
|
|
4759
|
-
message: error.message
|
|
5524
|
+
function serializeAggregateErrorMember(value) {
|
|
5525
|
+
return value instanceof Error ? {
|
|
5526
|
+
__internal__type: 'error',
|
|
5527
|
+
value: serializeErrorWithoutCloneCheck(value)
|
|
5528
|
+
} : {
|
|
5529
|
+
__internal__type: 'value',
|
|
5530
|
+
value
|
|
4760
5531
|
};
|
|
5532
|
+
}
|
|
5533
|
+
function serializeErrorWithoutCloneCheck(error) {
|
|
5534
|
+
if (error instanceof Error || error && 'object' == typeof error && 'message' in error) {
|
|
5535
|
+
let serializedError = {
|
|
5536
|
+
...error,
|
|
5537
|
+
name: error.name,
|
|
5538
|
+
stack: error.stack,
|
|
5539
|
+
message: error.message
|
|
5540
|
+
};
|
|
5541
|
+
return error instanceof AggregateError ? (serializedError.__internal__isAggregateError = !0, serializedError.errors = error.errors.map(serializeAggregateErrorMember)) : delete serializedError.__internal__isAggregateError, serializedError;
|
|
5542
|
+
}
|
|
4761
5543
|
if ('string' == typeof error) return {
|
|
4762
5544
|
name: 'Error',
|
|
4763
5545
|
message: error
|
|
4764
5546
|
};
|
|
4765
5547
|
throw Error('Failed to serialize error, only string, Error instances and objects with a message property are supported');
|
|
4766
5548
|
}
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
})), isArray || (result = result[0]);
|
|
4785
|
-
} else throw Error(`Unknown request type: ${message.requestType}`);
|
|
4786
|
-
mainSyncPort.postMessage({
|
|
4787
|
-
type: 'response',
|
|
4788
|
-
id: message.id,
|
|
4789
|
-
data: result
|
|
4790
|
-
});
|
|
4791
|
-
} catch (e) {
|
|
4792
|
-
mainSyncPort.postMessage({
|
|
4793
|
-
type: 'response-error',
|
|
4794
|
-
id: message.id,
|
|
4795
|
-
error: serializeError(e)
|
|
4796
|
-
});
|
|
4797
|
-
}
|
|
4798
|
-
Atomics.add(sharedBufferView, 0, 1), Atomics.notify(sharedBufferView, 0, 1 / 0);
|
|
4799
|
-
}
|
|
4800
|
-
mainPort.on('message', (message)=>{
|
|
4801
|
-
'done' === message.type ? Promise.allSettled(pendingRequests.values()).then(()=>{
|
|
4802
|
-
mainPort.close(), mainSyncPort.close(), resolve(message.data);
|
|
4803
|
-
}) : 'done-error' === message.type ? Promise.allSettled(pendingRequests.values()).then(()=>{
|
|
4804
|
-
mainPort.close(), mainSyncPort.close(), reject(message.error);
|
|
4805
|
-
}) : 'request' === message.type ? pendingRequests.set(message.id, Promise.resolve().then(()=>options.handleIncomingRequest(message.requestType, ...message.data)).then((result)=>(mainPort.postMessage({
|
|
4806
|
-
type: 'response',
|
|
4807
|
-
id: message.id,
|
|
4808
|
-
data: result
|
|
4809
|
-
}), result)).catch((error)=>{
|
|
4810
|
-
mainPort.postMessage({
|
|
4811
|
-
type: 'response-error',
|
|
4812
|
-
id: message.id,
|
|
4813
|
-
error: serializeError(error)
|
|
4814
|
-
});
|
|
4815
|
-
})) : 'request-sync' === message.type && handleSyncRequest(message);
|
|
4816
|
-
}), mainPort.on('messageerror', handleError);
|
|
4817
|
-
let errors = [];
|
|
4818
|
-
for (let key of Object.keys(task))try {
|
|
4819
|
-
structuredClone(task[key]);
|
|
4820
|
-
} catch (e) {
|
|
4821
|
-
errors.push({
|
|
4822
|
-
key,
|
|
4823
|
-
type: typeof task[key],
|
|
4824
|
-
reason: e.message
|
|
4825
|
-
});
|
|
4826
|
-
}
|
|
4827
|
-
if (errors.length > 0) {
|
|
4828
|
-
let errorMsg = errors.map((err)=>`option "${err.key}" (type: ${err.type}) is not cloneable: ${err.reason}`).join('\n');
|
|
4829
|
-
throw Error(`The options for ${loaderName} are not cloneable, which is not supported by parallelLoader. Consider disabling parallel for this loader or removing the non-cloneable properties from the options:\n${errorMsg}`);
|
|
4830
|
-
}
|
|
4831
|
-
pool.run({
|
|
4832
|
-
...task,
|
|
4833
|
-
workerData: {
|
|
4834
|
-
workerPort,
|
|
4835
|
-
workerSyncPort
|
|
4836
|
-
}
|
|
4837
|
-
}, {
|
|
4838
|
-
...options,
|
|
4839
|
-
transferList: [
|
|
4840
|
-
...options?.transferList || [],
|
|
4841
|
-
workerPort,
|
|
4842
|
-
workerSyncPort
|
|
4843
|
-
]
|
|
4844
|
-
}).catch(handleError);
|
|
4845
|
-
});
|
|
4846
|
-
}), LoaderLoadingError = class extends Error {
|
|
5549
|
+
function serializeError(error) {
|
|
5550
|
+
try {
|
|
5551
|
+
let serializedError = serializeErrorWithoutCloneCheck(error);
|
|
5552
|
+
return structuredClone(serializedError), serializedError;
|
|
5553
|
+
} catch (serializationError) {
|
|
5554
|
+
let reason = serializationError instanceof Error ? serializationError.message : 'unknown reason';
|
|
5555
|
+
return serializeErrorWithoutCloneCheck(Error(`Failed to serialize error: ${reason}`));
|
|
5556
|
+
}
|
|
5557
|
+
}
|
|
5558
|
+
function deserializeAggregateErrorMember(member) {
|
|
5559
|
+
return 'error' === member.__internal__type ? deserializeError(member.value) : member.value;
|
|
5560
|
+
}
|
|
5561
|
+
function deserializeError(error) {
|
|
5562
|
+
let { __internal__isAggregateError, errors, ...properties } = error, shouldDeserializeAsAggregate = !0 === __internal__isAggregateError && Array.isArray(errors), deserializedError = shouldDeserializeAsAggregate ? AggregateError(errors.map(deserializeAggregateErrorMember), error.message) : Error(error.message);
|
|
5563
|
+
return Object.assign(deserializedError, properties), shouldDeserializeAsAggregate || void 0 === errors || (deserializedError.errors = errors), deserializedError;
|
|
5564
|
+
}
|
|
5565
|
+
let LoaderLoadingError = class extends Error {
|
|
4847
5566
|
constructor(message){
|
|
4848
5567
|
super(message), this.name = 'LoaderRunnerError', Error.captureStackTrace(this, this.constructor);
|
|
4849
5568
|
}
|
|
@@ -4854,7 +5573,7 @@ function loadLoader(loader, compiler, callback) {
|
|
|
4854
5573
|
if ('module' === loader.type) try {
|
|
4855
5574
|
let modulePromise = modulePromiseCache.get(cacheKey);
|
|
4856
5575
|
if (void 0 === modulePromise) {
|
|
4857
|
-
void 0 === loadLoader_url && (loadLoader_url =
|
|
5576
|
+
void 0 === loadLoader_url && (loadLoader_url = rspackRequire("node:url"));
|
|
4858
5577
|
let loaderUrl = loaderUrlCache.get(loader.path);
|
|
4859
5578
|
void 0 === loaderUrl && (loaderUrl = loadLoader_url.pathToFileURL(loader.path).toString(), loaderUrlCache.set(loader.path, loaderUrl)), modulePromise = import(loaderUrl).then((module)=>(loadLoader_moduleCache.set(cacheKey, module), modulePromiseCache.delete(cacheKey), module), (err)=>{
|
|
4860
5579
|
throw modulePromiseCache.delete(cacheKey), err;
|
|
@@ -4922,7 +5641,7 @@ let utils_decoder = new TextDecoder(), utils_loadLoader = promisify(loadLoader),
|
|
|
4922
5641
|
if (isDone) return void (e instanceof Error ? console.error(e.stack) : console.error(e));
|
|
4923
5642
|
isDone = !0, reportedError = !0, callback(e, []);
|
|
4924
5643
|
}
|
|
4925
|
-
}), LOADER_PROCESS_NAME = 'Loader Analysis';
|
|
5644
|
+
}), LOADER_PROCESS_NAME = 'Loader Analysis', IS_WASM = !!process.env.WASM;
|
|
4926
5645
|
class LoaderObject {
|
|
4927
5646
|
request;
|
|
4928
5647
|
path;
|
|
@@ -4965,8 +5684,28 @@ class LoaderObject {
|
|
|
4965
5684
|
if (!value) throw Error('noPitch should be true');
|
|
4966
5685
|
this.loaderItem.noPitch = !0;
|
|
4967
5686
|
}
|
|
4968
|
-
|
|
4969
|
-
|
|
5687
|
+
shouldSkipNormal(content, cache) {
|
|
5688
|
+
let codeFilter = this.loaderItem.codeFilter;
|
|
5689
|
+
if (!codeFilter || this.loaderItem.filterMatched) return !1;
|
|
5690
|
+
let matched = function(filter, content, cache) {
|
|
5691
|
+
let code = function(content, cache) {
|
|
5692
|
+
let text;
|
|
5693
|
+
if (cache.initialized && cache.content === content) return cache.text ?? null;
|
|
5694
|
+
if ('string' == typeof content) text = content;
|
|
5695
|
+
else if (content instanceof Uint8Array) try {
|
|
5696
|
+
text = codeFilter_decoder.decode(content);
|
|
5697
|
+
} catch {
|
|
5698
|
+
text = null;
|
|
5699
|
+
}
|
|
5700
|
+
else text = null;
|
|
5701
|
+
return cache.initialized = !0, cache.content = content, cache.text = text, text;
|
|
5702
|
+
}(content, cache);
|
|
5703
|
+
if (null !== code) {
|
|
5704
|
+
let matched;
|
|
5705
|
+
return 'string' == typeof filter ? code.includes(filter) : (filter.lastIndex = 0, matched = filter.test(code), filter.lastIndex = 0, matched);
|
|
5706
|
+
}
|
|
5707
|
+
}(codeFilter, content, cache);
|
|
5708
|
+
return !1 === matched || (matched && (this.loaderItem.filterMatched = !0), !1);
|
|
4970
5709
|
}
|
|
4971
5710
|
static __from_binding(loaderItem, compiler) {
|
|
4972
5711
|
return new this(loaderItem, compiler);
|
|
@@ -4996,7 +5735,7 @@ function getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) {
|
|
|
4996
5735
|
}
|
|
4997
5736
|
async function runLoaders(compiler, context) {
|
|
4998
5737
|
var buildInfo;
|
|
4999
|
-
let loaderState = context.loaderState, pitch = loaderState === binding_.JsLoaderState.Pitching, { resource } = context, traceData = JavaScriptTracer.isEnabled() ? {
|
|
5738
|
+
let loaderState = context.loaderState, loaderChainStart = context.loaderChainStart, loaderChainEnd = context.loaderChainEnd, pitch = loaderState === binding_.JsLoaderState.Pitching, { resource } = context, traceData = JavaScriptTracer.isEnabled() ? {
|
|
5000
5739
|
uuid: JavaScriptTracer.uuid(),
|
|
5001
5740
|
args: {
|
|
5002
5741
|
is_pitch: pitch,
|
|
@@ -5014,7 +5753,7 @@ async function runLoaders(compiler, context) {
|
|
|
5014
5753
|
if ('/' === path) return '/';
|
|
5015
5754
|
let i = path.lastIndexOf('/'), j = path.lastIndexOf('\\'), i2 = path.indexOf('/'), j2 = path.indexOf('\\'), idx = i > j ? i : j, idx2 = i > j ? i2 : j2;
|
|
5016
5755
|
return idx < 0 ? path : idx === idx2 ? path.slice(0, idx + 1) : path.slice(0, idx);
|
|
5017
|
-
}(resourcePath) : null, dependencies = new LoaderDependenciesState(context.dependencies
|
|
5756
|
+
}(resourcePath) : null, dependencies = new LoaderDependenciesState(context.dependencies, context.addedDependencies, context.removedDependencies), loaderContext = {};
|
|
5018
5757
|
loaderContext.loaders = context.loaderItems.map((item)=>LoaderObject.__from_binding(item, compiler)), loaderContext.hot = context.hot, loaderContext.context = contextDirectory, loaderContext.resourcePath = resourcePath, loaderContext.resourceQuery = resourceQuery, loaderContext.resourceFragment = resourceFragment, loaderContext.dependency = loaderContext.addDependency = function(file) {
|
|
5019
5758
|
dependencies.addFile(file);
|
|
5020
5759
|
}, loaderContext.addContextDependency = function(context) {
|
|
@@ -5052,12 +5791,20 @@ async function runLoaders(compiler, context) {
|
|
|
5052
5791
|
for (let dep of res.contextDependencies)loaderContext.addContextDependency(dep);
|
|
5053
5792
|
for (let dep of res.missingDependencies)loaderContext.addMissingDependency(dep);
|
|
5054
5793
|
for (let dep of res.fileDependencies)loaderContext.addDependency(dep);
|
|
5055
|
-
!1 === res.cacheable && loaderContext.cacheable(!1), traceData && JavaScriptTracer.endAsync({
|
|
5794
|
+
if (!1 === res.cacheable && loaderContext.cacheable(!1), traceData && JavaScriptTracer.endAsync({
|
|
5056
5795
|
name: 'importModule',
|
|
5057
5796
|
processName: LOADER_PROCESS_NAME,
|
|
5058
5797
|
uuid: traceData.uuid,
|
|
5059
5798
|
args: traceData.args
|
|
5060
|
-
}), res.
|
|
5799
|
+
}), res.errors.length > 0) {
|
|
5800
|
+
let executionError = compiler.__internal__takeModuleExecutionResult(res.id);
|
|
5801
|
+
if (null != executionError) onError(executionError);
|
|
5802
|
+
else if (1 === res.errors.length) onError(res.errors[0]);
|
|
5803
|
+
else {
|
|
5804
|
+
let error = AggregateError(res.errors, res.errors.map((error)=>error.message).join('\n'));
|
|
5805
|
+
error.hideStack = !0, onError(error);
|
|
5806
|
+
}
|
|
5807
|
+
} else onDone(compiler.__internal__takeModuleExecutionResult(res.id));
|
|
5061
5808
|
}
|
|
5062
5809
|
};
|
|
5063
5810
|
}
|
|
@@ -5130,7 +5877,7 @@ async function runLoaders(compiler, context) {
|
|
|
5130
5877
|
let error = new ModuleError(e, {
|
|
5131
5878
|
from: stringifyLoaderObject(loaderContext.loaders[loaderContext.loaderIndex])
|
|
5132
5879
|
});
|
|
5133
|
-
|
|
5880
|
+
(context.__internal__diagnostics ??= []).push({
|
|
5134
5881
|
error,
|
|
5135
5882
|
severity: binding_.JsRspackSeverity.Error
|
|
5136
5883
|
});
|
|
@@ -5139,7 +5886,7 @@ async function runLoaders(compiler, context) {
|
|
|
5139
5886
|
let warning = new ModuleWarning(e, {
|
|
5140
5887
|
from: stringifyLoaderObject(loaderContext.loaders[loaderContext.loaderIndex])
|
|
5141
5888
|
});
|
|
5142
|
-
|
|
5889
|
+
(context.__internal__diagnostics ??= []).push({
|
|
5143
5890
|
error: warning,
|
|
5144
5891
|
severity: binding_.JsRspackSeverity.Warn
|
|
5145
5892
|
});
|
|
@@ -5173,10 +5920,7 @@ async function runLoaders(compiler, context) {
|
|
|
5173
5920
|
}
|
|
5174
5921
|
else options = node_querystring.parse(options);
|
|
5175
5922
|
return null == options && (options = {}), options;
|
|
5176
|
-
}
|
|
5177
|
-
let compilation = compiler._lastCompilation, step = 0;
|
|
5178
|
-
for(; compilation;)if (binding_.NormalModule.getCompilationHooks(compilation).loader.call(loaderContext, loaderContext._module), compilation = compilation.compiler.parentCompilation, ++step > 1000) throw Error('Too many nested child compiler, exceeded max limitation 1000');
|
|
5179
|
-
dependencies.mergeChanges(), Object.defineProperty(loaderContext, 'loaderIndex', {
|
|
5923
|
+
}, Object.defineProperty(loaderContext, 'loaderIndex', {
|
|
5180
5924
|
enumerable: !0,
|
|
5181
5925
|
get: ()=>context.loaderIndex,
|
|
5182
5926
|
set: (loaderIndex)=>context.loaderIndex = loaderIndex
|
|
@@ -5192,7 +5936,10 @@ async function runLoaders(compiler, context) {
|
|
|
5192
5936
|
}), loaderContext.__internal__setParseMeta = (key, value)=>{
|
|
5193
5937
|
context.__internal__parseMeta[key] = value;
|
|
5194
5938
|
};
|
|
5195
|
-
let
|
|
5939
|
+
let compilation = compiler._lastCompilation, step = 0;
|
|
5940
|
+
for(; compilation;)if (NormalModule.getCompilationHooks(compilation).loader.call(loaderContext, loaderContext._module), compilation = compilation.compiler.parentCompilation, ++step > 1000) throw Error('Too many nested child compiler, exceeded max limitation 1000');
|
|
5941
|
+
dependencies.mergeChanges();
|
|
5942
|
+
let enableParallelism = (currentLoaderObject)=>!(IS_WASM && currentLoaderObject?.loaderItem.cache) && currentLoaderObject?.parallel, isomorphoicRun = async (fn, args)=>{
|
|
5196
5943
|
let loaderName, result, currentLoaderObject = getCurrentLoader(loaderContext), parallelism = enableParallelism(currentLoaderObject);
|
|
5197
5944
|
if ((traceData || parallelism) && (loaderName = function(loaderPath, cwd = '') {
|
|
5198
5945
|
let res = loaderPath.replace(cwd, '');
|
|
@@ -5211,9 +5958,113 @@ async function runLoaders(compiler, context) {
|
|
|
5211
5958
|
uuid: traceData.uuid,
|
|
5212
5959
|
args: traceData.args
|
|
5213
5960
|
}), parallelism) {
|
|
5214
|
-
let normalModule, workerLoaderContext;
|
|
5215
|
-
result = await
|
|
5216
|
-
|
|
5961
|
+
let normalModule, workerLoaderSpan, workerLoaderContext;
|
|
5962
|
+
result = await (async (loaderName, task, options, workerOptions)=>(async (workerOptions)=>service_pool || (service_pool = import("../compiled/tinypool/dist/index.js").then(({ Tinypool })=>{
|
|
5963
|
+
let availableThreads = Math.max(__rspack_createRequire_require("node:os").cpus().length - 1, 1), maxWorkers = workerOptions?.maxWorkers ? Math.max(workerOptions.maxWorkers, 1) : void 0, maxWorkersFromEnv = parseInt(process.env.RSPACK_LOADER_WORKER_THREADS || '', 10);
|
|
5964
|
+
return new Tinypool({
|
|
5965
|
+
filename: node_path.resolve(import.meta.dirname, 'worker.js'),
|
|
5966
|
+
useAtomics: !1,
|
|
5967
|
+
maxThreads: maxWorkers || maxWorkersFromEnv || availableThreads,
|
|
5968
|
+
minThreads: maxWorkers || maxWorkersFromEnv || availableThreads,
|
|
5969
|
+
concurrentTasksPerWorker: 1
|
|
5970
|
+
});
|
|
5971
|
+
})))(workerOptions).then((pool)=>{
|
|
5972
|
+
let { port1: mainPort, port2: workerPort } = new MessageChannel(), { port1: mainSyncPort, port2: workerSyncPort } = new MessageChannel();
|
|
5973
|
+
return new Promise((resolve, reject)=>{
|
|
5974
|
+
let handleError = (error)=>{
|
|
5975
|
+
mainPort.close(), mainSyncPort.close(), reject(error);
|
|
5976
|
+
}, pendingRequests = new Map();
|
|
5977
|
+
mainPort.on('message', (message)=>{
|
|
5978
|
+
'done' === message.type ? Promise.allSettled(pendingRequests.values()).then(()=>{
|
|
5979
|
+
mainPort.close(), mainSyncPort.close(), resolve(message.data);
|
|
5980
|
+
}) : 'done-error' === message.type ? Promise.allSettled(pendingRequests.values()).then(()=>{
|
|
5981
|
+
mainPort.close(), mainSyncPort.close(), reject(deserializeError(message.error));
|
|
5982
|
+
}) : 'request' === message.type ? pendingRequests.set(message.id, Promise.resolve().then(()=>options.handleIncomingRequest(message.requestType, ...message.data)).then((result)=>(mainPort.postMessage({
|
|
5983
|
+
type: 'response',
|
|
5984
|
+
id: message.id,
|
|
5985
|
+
data: result
|
|
5986
|
+
}), result)).catch((error)=>{
|
|
5987
|
+
mainPort.postMessage({
|
|
5988
|
+
type: 'response-error',
|
|
5989
|
+
id: message.id,
|
|
5990
|
+
error: serializeError(error)
|
|
5991
|
+
});
|
|
5992
|
+
})) : 'request-sync' === message.type && async function(message) {
|
|
5993
|
+
let result, { sharedBuffer } = message, sharedBufferView = new Int32Array(sharedBuffer);
|
|
5994
|
+
try {
|
|
5995
|
+
if ("WaitForPendingRequest" === message.requestType) {
|
|
5996
|
+
let pendingRequestId = message.data[0], isArray = Array.isArray(pendingRequestId), ids = isArray ? pendingRequestId : [
|
|
5997
|
+
pendingRequestId
|
|
5998
|
+
];
|
|
5999
|
+
result = await Promise.all(ids.map((id)=>{
|
|
6000
|
+
let pendingRequest = pendingRequests.get(id);
|
|
6001
|
+
if (!pendingRequest) throw Error(`Unknown pending request: ${id}`);
|
|
6002
|
+
return pendingRequest;
|
|
6003
|
+
})), isArray || (result = result[0]);
|
|
6004
|
+
} else throw Error(`Unknown request type: ${message.requestType}`);
|
|
6005
|
+
mainSyncPort.postMessage({
|
|
6006
|
+
type: 'response',
|
|
6007
|
+
id: message.id,
|
|
6008
|
+
data: result
|
|
6009
|
+
});
|
|
6010
|
+
} catch (e) {
|
|
6011
|
+
mainSyncPort.postMessage({
|
|
6012
|
+
type: 'response-error',
|
|
6013
|
+
id: message.id,
|
|
6014
|
+
error: serializeError(e)
|
|
6015
|
+
});
|
|
6016
|
+
}
|
|
6017
|
+
Atomics.add(sharedBufferView, 0, 1), Atomics.notify(sharedBufferView, 0, 1 / 0);
|
|
6018
|
+
}(message);
|
|
6019
|
+
}), mainPort.on('messageerror', handleError);
|
|
6020
|
+
let found = [];
|
|
6021
|
+
for (let key of Object.keys(task)){
|
|
6022
|
+
let uncloneable = function findUncloneablePath(value, path, depth) {
|
|
6023
|
+
try {
|
|
6024
|
+
structuredClone(value);
|
|
6025
|
+
return;
|
|
6026
|
+
} catch (e) {
|
|
6027
|
+
if (depth > 0 && 'object' == typeof value && null !== value) for (let key of Object.keys(value)){
|
|
6028
|
+
let deeper = findUncloneablePath(value[key], `${path}.${key}`, depth - 1);
|
|
6029
|
+
if (deeper) return deeper;
|
|
6030
|
+
}
|
|
6031
|
+
return {
|
|
6032
|
+
path,
|
|
6033
|
+
reason: e.message
|
|
6034
|
+
};
|
|
6035
|
+
}
|
|
6036
|
+
}(task[key], key, 6);
|
|
6037
|
+
uncloneable && found.push(uncloneable);
|
|
6038
|
+
}
|
|
6039
|
+
if (found.length > 0) {
|
|
6040
|
+
let details = found.map((item)=>` ${item.path.replace(/^loaderContext\._module\.buildInfo/, 'module.buildInfo').replace(/^loaderContext\.loaders\.\d+\.options/, 'options').replace(/^loaderContext\.?/, '')}: ${item.reason}`).join('\n');
|
|
6041
|
+
throw Error(`${loaderName} cannot run with \`parallel: true\`. A parallel loader runs in a worker thread and receives its loader context through a structured clone, so the loader options and the custom \`module.buildInfo\` fields the module already carries all have to be cloneable:\n${details}\nEither remove \`parallel\` from this loader, or keep the value above out of the loader options and \`module.buildInfo\`.`);
|
|
6042
|
+
}
|
|
6043
|
+
pool.run({
|
|
6044
|
+
...task,
|
|
6045
|
+
workerData: {
|
|
6046
|
+
workerPort,
|
|
6047
|
+
workerSyncPort
|
|
6048
|
+
}
|
|
6049
|
+
}, {
|
|
6050
|
+
...options,
|
|
6051
|
+
transferList: [
|
|
6052
|
+
...options?.transferList || [],
|
|
6053
|
+
workerPort,
|
|
6054
|
+
workerSyncPort
|
|
6055
|
+
]
|
|
6056
|
+
}).catch(handleError);
|
|
6057
|
+
});
|
|
6058
|
+
}))(loaderName, {
|
|
6059
|
+
loaderContext: (normalModule = loaderContext._module instanceof NormalModule ? loaderContext._module : void 0, workerLoaderSpan = (()=>{
|
|
6060
|
+
let start = loaderContext.loaderIndex, end = start + 1;
|
|
6061
|
+
if (loaderState === binding_.JsLoaderState.Pitching) for(; end < loaderChainEnd && loaderContext.loaders[end]?.parallel;)end++;
|
|
6062
|
+
else for(; start > loaderChainStart && loaderContext.loaders[start - 1]?.parallel;)start--;
|
|
6063
|
+
return {
|
|
6064
|
+
start,
|
|
6065
|
+
end
|
|
6066
|
+
};
|
|
6067
|
+
})(), Object.assign(workerLoaderContext = {
|
|
5217
6068
|
version: loaderContext.version,
|
|
5218
6069
|
hot: loaderContext.hot,
|
|
5219
6070
|
context: loaderContext.context,
|
|
@@ -5225,9 +6076,11 @@ async function runLoaders(compiler, context) {
|
|
|
5225
6076
|
sourceMap: loaderContext.sourceMap,
|
|
5226
6077
|
rootContext: loaderContext.rootContext,
|
|
5227
6078
|
loaderIndex: loaderContext.loaderIndex,
|
|
5228
|
-
|
|
6079
|
+
loaderChainStart: workerLoaderSpan.start,
|
|
6080
|
+
loaderChainEnd: workerLoaderSpan.end,
|
|
6081
|
+
loaders: loaderContext.loaders.map((item, index)=>{
|
|
5229
6082
|
let options = item.options;
|
|
5230
|
-
return (!item.parallel ||
|
|
6083
|
+
return (!item.parallel || index < workerLoaderSpan.start || index >= workerLoaderSpan.end) && (options = void 0), {
|
|
5231
6084
|
...item,
|
|
5232
6085
|
options,
|
|
5233
6086
|
pitch: void 0,
|
|
@@ -5266,7 +6119,8 @@ async function runLoaders(compiler, context) {
|
|
|
5266
6119
|
matchResource: normalModule?.matchResource,
|
|
5267
6120
|
request: normalModule?.request,
|
|
5268
6121
|
userRequest: normalModule?.userRequest,
|
|
5269
|
-
rawRequest: normalModule?.rawRequest
|
|
6122
|
+
rawRequest: normalModule?.rawRequest,
|
|
6123
|
+
buildInfo: pickCustomBuildInfoFields(normalModule?.buildInfo)
|
|
5270
6124
|
}
|
|
5271
6125
|
}, compiler.options.loader), workerLoaderContext),
|
|
5272
6126
|
loaderState,
|
|
@@ -5295,10 +6149,6 @@ async function runLoaders(compiler, context) {
|
|
|
5295
6149
|
case "ClearDependencies":
|
|
5296
6150
|
loaderContext.clearDependencies();
|
|
5297
6151
|
break;
|
|
5298
|
-
case "BeginDependencyChanges":
|
|
5299
|
-
case "MergeDependencyChanges":
|
|
5300
|
-
dependencies.mergeChanges();
|
|
5301
|
-
break;
|
|
5302
6152
|
case "Resolve":
|
|
5303
6153
|
return new Promise((resolve, reject)=>{
|
|
5304
6154
|
loaderContext.resolve(args[0], args[1], (err, result, resolveRequest)=>{
|
|
@@ -5360,19 +6210,18 @@ async function runLoaders(compiler, context) {
|
|
|
5360
6210
|
let updates = args[0];
|
|
5361
6211
|
loaderContext.loaders = loaderContext.loaders.map((item, index)=>{
|
|
5362
6212
|
let update = updates[index];
|
|
5363
|
-
return item.loaderItem.data = update.data, update.pitchExecuted && (item.pitchExecuted = !0), update.normalExecuted && (item.normalExecuted = !0), item;
|
|
6213
|
+
return item.loaderItem.data = update.data, update.pitchExecuted && (item.pitchExecuted = !0), update.normalExecuted && (item.normalExecuted = !0), update.filterMatched && (item.loaderItem.filterMatched = !0), item;
|
|
5364
6214
|
});
|
|
5365
6215
|
break;
|
|
5366
6216
|
}
|
|
5367
|
-
case "
|
|
5368
|
-
{
|
|
5369
|
-
let [loaderIndex, content, additionalData] = args;
|
|
5370
|
-
return loaderCache?.workerGet(loaderIndex, content, additionalData);
|
|
5371
|
-
}
|
|
5372
|
-
case "LoaderCacheStore":
|
|
6217
|
+
case "UpdateBuildInfo":
|
|
5373
6218
|
{
|
|
5374
|
-
let
|
|
5375
|
-
|
|
6219
|
+
let buildInfo = loaderContext._module?.buildInfo;
|
|
6220
|
+
buildInfo && ((buildInfo, custom)=>{
|
|
6221
|
+
for (let key of Object.keys(buildInfo))knownBuildInfoFields.has(key) || Object.hasOwn(custom, key) || delete buildInfo[key];
|
|
6222
|
+
Object.assign(buildInfo, custom);
|
|
6223
|
+
})(buildInfo, pickCustomBuildInfoFields(args[0]));
|
|
6224
|
+
break;
|
|
5376
6225
|
}
|
|
5377
6226
|
case "CompilationGetPath":
|
|
5378
6227
|
{
|
|
@@ -5418,9 +6267,8 @@ async function runLoaders(compiler, context) {
|
|
|
5418
6267
|
try {
|
|
5419
6268
|
switch(loaderState){
|
|
5420
6269
|
case binding_.JsLoaderState.Pitching:
|
|
5421
|
-
for(; loaderContext.loaderIndex <
|
|
6270
|
+
for(; loaderContext.loaderIndex < loaderChainEnd;){
|
|
5422
6271
|
let args, currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex], parallelism = enableParallelism(currentLoaderObject);
|
|
5423
|
-
if (currentLoaderObject.shouldYield()) break;
|
|
5424
6272
|
if (currentLoaderObject.pitchExecuted) {
|
|
5425
6273
|
loaderContext.loaderIndex += 1;
|
|
5426
6274
|
continue;
|
|
@@ -5440,7 +6288,7 @@ async function runLoaders(compiler, context) {
|
|
|
5440
6288
|
}
|
|
5441
6289
|
if (args.some((value)=>void 0 !== value)) {
|
|
5442
6290
|
let [content, sourceMap, additionalData] = args;
|
|
5443
|
-
context.content = isNil(content) ? null : toBuffer(content), context.sourceMap = serializeObject(sourceMap), context.additionalData = additionalData || void 0;
|
|
6291
|
+
context.content = isNil(content) ? null : 'string' == typeof content ? content : toBuffer(content), context.sourceMap = serializeObject(sourceMap), context.additionalData = additionalData || void 0;
|
|
5444
6292
|
break;
|
|
5445
6293
|
}
|
|
5446
6294
|
}
|
|
@@ -5448,21 +6296,21 @@ async function runLoaders(compiler, context) {
|
|
|
5448
6296
|
break;
|
|
5449
6297
|
case binding_.JsLoaderState.Normal:
|
|
5450
6298
|
{
|
|
5451
|
-
let sourceMap, content = context.content, rawSourceMap = context.sourceMap, sourceMapParsed = !1, additionalData = context.additionalData
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
6299
|
+
let sourceMap, content = context.content, rawSourceMap = context.sourceMap, sourceMapParsed = !1, additionalData = context.additionalData, codeFilterTextCache = {
|
|
6300
|
+
initialized: !1
|
|
6301
|
+
};
|
|
6302
|
+
for(; loaderContext.loaderIndex >= loaderChainStart;){
|
|
6303
|
+
let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
|
|
5455
6304
|
if (currentLoaderObject.normalExecuted) {
|
|
5456
6305
|
loaderContext.loaderIndex--;
|
|
5457
6306
|
continue;
|
|
5458
6307
|
}
|
|
5459
|
-
|
|
6308
|
+
if (currentLoaderObject.shouldSkipNormal(content, codeFilterTextCache)) {
|
|
6309
|
+
currentLoaderObject.normalExecuted = !0, loaderContext.loaderIndex--;
|
|
6310
|
+
continue;
|
|
6311
|
+
}
|
|
6312
|
+
let parallelism = enableParallelism(currentLoaderObject);
|
|
5460
6313
|
try {
|
|
5461
|
-
let cached = !parallelism && currentLoaderObject.loaderItem.cache && loaderCache ? await loaderCache.get(loaderContext.loaderIndex, content, additionalData) : void 0;
|
|
5462
|
-
if (cached) {
|
|
5463
|
-
currentLoaderObject.normalExecuted = !0, content = cached.content, sourceMap = JsSourceMap.__from_binding(cached.sourceMap), sourceMapParsed = !0, loaderContext.loaderIndex--;
|
|
5464
|
-
continue;
|
|
5465
|
-
}
|
|
5466
6314
|
await utils_loadLoader(currentLoaderObject, compiler);
|
|
5467
6315
|
let fn = currentLoaderObject.normal;
|
|
5468
6316
|
if (parallelism && fn || (currentLoaderObject.normalExecuted = !0), !fn) continue;
|
|
@@ -5470,12 +6318,12 @@ async function runLoaders(compiler, context) {
|
|
|
5470
6318
|
content,
|
|
5471
6319
|
sourceMap,
|
|
5472
6320
|
additionalData
|
|
5473
|
-
]),
|
|
6321
|
+
]), codeFilterTextCache.initialized = !1, codeFilterTextCache.content = void 0, codeFilterTextCache.text = void 0;
|
|
5474
6322
|
} finally{
|
|
5475
6323
|
dependencies.mergeChanges();
|
|
5476
6324
|
}
|
|
5477
6325
|
}
|
|
5478
|
-
context.content = isNil(content) ? null : toBuffer(content), context.sourceMap = sourceMapParsed ? JsSourceMap.__to_binding(sourceMap) : rawSourceMap, context.additionalData =
|
|
6326
|
+
context.content = isNil(content) ? null : 'string' == typeof content ? content : toBuffer(content), context.sourceMap = sourceMapParsed ? JsSourceMap.__to_binding(sourceMap) : rawSourceMap, context.additionalData = loaderContext.loaderIndex < 0 ? void 0 : additionalData || void 0;
|
|
5479
6327
|
break;
|
|
5480
6328
|
}
|
|
5481
6329
|
default:
|
|
@@ -5492,7 +6340,7 @@ async function runLoaders(compiler, context) {
|
|
|
5492
6340
|
name: 'run_js_loaders',
|
|
5493
6341
|
uuid: traceData.uuid,
|
|
5494
6342
|
args: traceData.args
|
|
5495
|
-
}), compiler.options?.cache && Object.keys(buildInfo = context._module.buildInfo).some((key)=>!knownBuildInfoFields.has(key)) && buildInfo[
|
|
6343
|
+
}), compiler.options?.cache && Object.hasOwn(context._module, MODULE_BUILD_INFO_SYMBOL) && Object.keys(buildInfo = context._module.buildInfo).some((key)=>!knownBuildInfoFields.has(key)) && buildInfo[COMMIT_CUSTOM_FIELDS_SYMBOL](), context.addedDependencies = dependencies.added, context.removedDependencies = dependencies.removed, context;
|
|
5496
6344
|
}
|
|
5497
6345
|
let JsLoaderRspackPlugin = base_create(binding_.BuiltinPluginName.JsLoaderRspackPlugin, (compiler)=>runLoaders.bind(null, compiler), 'thisCompilation'), JsonModulesPlugin = base_create(binding_.BuiltinPluginName.JsonModulesPlugin, ()=>{}, 'compilation'), LibManifestPlugin = base_create(binding_.BuiltinPluginName.LibManifestPlugin, (options)=>{
|
|
5498
6346
|
let { context, entryOnly, format, name, path, type } = options;
|
|
@@ -5530,13 +6378,13 @@ let JsLoaderRspackPlugin = base_create(binding_.BuiltinPluginName.JsLoaderRspack
|
|
|
5530
6378
|
pseudoClasses
|
|
5531
6379
|
}
|
|
5532
6380
|
};
|
|
5533
|
-
}), LimitChunkCountPlugin = base_create(binding_.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options), BuiltinLazyCompilationPlugin = base_create(binding_.BuiltinPluginName.LazyCompilationPlugin, (
|
|
6381
|
+
}), LimitChunkCountPlugin = base_create(binding_.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options), BuiltinLazyCompilationPlugin = base_create(binding_.BuiltinPluginName.LazyCompilationPlugin, (takeNewlyActiveModules, entries, imports, client, collectReservedExternals, test)=>({
|
|
5534
6382
|
imports,
|
|
5535
6383
|
entries,
|
|
5536
6384
|
test,
|
|
5537
6385
|
client,
|
|
5538
|
-
|
|
5539
|
-
|
|
6386
|
+
takeNewlyActiveModules,
|
|
6387
|
+
collectReservedExternals
|
|
5540
6388
|
}), 'thisCompilation'), middleware_require = createRequire(import.meta.url), LAZY_COMPILATION_PREFIX = '/_rspack/lazy/trigger', noop = (_req, _res, next)=>{
|
|
5541
6389
|
'function' == typeof next && next();
|
|
5542
6390
|
}, lazyCompilationMiddleware = (compiler)=>{
|
|
@@ -5548,8 +6396,8 @@ let JsLoaderRspackPlugin = base_create(binding_.BuiltinPluginName.JsLoaderRspack
|
|
|
5548
6396
|
...c.options.lazyCompilation
|
|
5549
6397
|
}, prefix = options.prefix || LAZY_COMPILATION_PREFIX;
|
|
5550
6398
|
options.prefix = `${prefix}__${i++}`;
|
|
5551
|
-
let
|
|
5552
|
-
middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(c,
|
|
6399
|
+
let newlyActiveModules = new Set();
|
|
6400
|
+
middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(c, newlyActiveModules, options.prefix)), applyPlugin(c, options, newlyActiveModules);
|
|
5553
6401
|
}
|
|
5554
6402
|
let keys = [
|
|
5555
6403
|
...middlewareByCompiler.keys()
|
|
@@ -5562,31 +6410,35 @@ let JsLoaderRspackPlugin = base_create(binding_.BuiltinPluginName.JsLoaderRspack
|
|
|
5562
6410
|
};
|
|
5563
6411
|
}
|
|
5564
6412
|
if (!compiler.options.lazyCompilation) return noop;
|
|
5565
|
-
let
|
|
6413
|
+
let newlyActiveModules = new Set(), options = {
|
|
5566
6414
|
...compiler.options.lazyCompilation
|
|
5567
6415
|
};
|
|
5568
|
-
return applyPlugin(compiler, options,
|
|
6416
|
+
return applyPlugin(compiler, options, newlyActiveModules), lazyCompilationMiddlewareInternal(compiler, newlyActiveModules, options.prefix || LAZY_COMPILATION_PREFIX);
|
|
5569
6417
|
};
|
|
5570
|
-
function applyPlugin(compiler, options,
|
|
6418
|
+
function applyPlugin(compiler, options, newlyActiveModules) {
|
|
6419
|
+
let externals = compiler.options.externals;
|
|
5571
6420
|
new BuiltinLazyCompilationPlugin(()=>{
|
|
5572
|
-
let res = new Set(
|
|
5573
|
-
return
|
|
6421
|
+
let res = new Set(newlyActiveModules);
|
|
6422
|
+
return newlyActiveModules.clear(), res;
|
|
5574
6423
|
}, options.entries ?? !0, options.imports ?? !0, `${options.client || middleware_require.resolve(`../hot/lazy-compilation-${compiler.options.externalsPresets.node ? 'node' : 'web'}.js`)}?${encodeURIComponent((({ serverUrl, prefix })=>{
|
|
5575
6424
|
let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
|
|
5576
6425
|
return serverUrl ? serverUrl + (serverUrl.endsWith('/') ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
|
|
5577
|
-
})(options))}`, function(externals) {
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
6426
|
+
})(options))}`, (layer)=>(function(externals, layer) {
|
|
6427
|
+
let requests = new Set(), visit = (item)=>{
|
|
6428
|
+
if ('string' == typeof item) return void requests.add(item);
|
|
6429
|
+
if (!item || 'object' != typeof item || item instanceof RegExp) return;
|
|
6430
|
+
let resolved = resolveLayerExternals(item, layer);
|
|
6431
|
+
if ('string' == typeof resolved) return void requests.add(resolved);
|
|
6432
|
+
if (resolved && 'object' == typeof resolved && !(resolved instanceof RegExp)) for (let [request, value] of Object.entries(resolved))!1 !== value && requests.add(request);
|
|
6433
|
+
};
|
|
6434
|
+
if (Array.isArray(externals)) for (let item of externals)visit(item);
|
|
6435
|
+
else void 0 !== externals && visit(externals);
|
|
6436
|
+
return [
|
|
6437
|
+
...requests
|
|
6438
|
+
];
|
|
6439
|
+
})(externals, layer ?? null), options.test).apply(compiler);
|
|
5588
6440
|
}
|
|
5589
|
-
let lazyCompilationMiddlewareInternal = (compiler,
|
|
6441
|
+
let lazyCompilationMiddlewareInternal = (compiler, newlyActiveModules, lazyCompilationPrefix)=>{
|
|
5590
6442
|
let logger = compiler.getInfrastructureLogger('LazyCompilation');
|
|
5591
6443
|
return async (req, res, next)=>{
|
|
5592
6444
|
if (!req.url?.startsWith(lazyCompilationPrefix) || 'POST' !== req.method) return next?.();
|
|
@@ -5621,10 +6473,7 @@ let lazyCompilationMiddlewareInternal = (compiler, activeModules, lazyCompilatio
|
|
|
5621
6473
|
return;
|
|
5622
6474
|
}
|
|
5623
6475
|
let moduleActivated = [];
|
|
5624
|
-
for (let key of modules){
|
|
5625
|
-
let activated = activeModules.has(key);
|
|
5626
|
-
activeModules.add(key), activated || (logger.log(`${key} is now in use and will be compiled.`), moduleActivated.push(key));
|
|
5627
|
-
}
|
|
6476
|
+
for (let key of modules)newlyActiveModules.has(key) || (newlyActiveModules.add(key), logger.log(`${key} is now in use and will be compiled.`), moduleActivated.push(key));
|
|
5628
6477
|
moduleActivated.length && compiler.watching && compiler.watching.invalidate(), res.writeHead(200), res.write('\n'), res.end();
|
|
5629
6478
|
};
|
|
5630
6479
|
};
|
|
@@ -5662,9 +6511,43 @@ class NaturalModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
|
5662
6511
|
return createBuiltinPlugin(this.name, void 0);
|
|
5663
6512
|
}
|
|
5664
6513
|
}
|
|
5665
|
-
let NodeTargetPlugin = base_create(binding_.BuiltinPluginName.NodeTargetPlugin, ()=>void 0), NoEmitOnErrorsPlugin = base_create(binding_.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0)
|
|
6514
|
+
let NodeTargetPlugin = base_create(binding_.BuiltinPluginName.NodeTargetPlugin, ()=>void 0), NoEmitOnErrorsPlugin = base_create(binding_.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0);
|
|
6515
|
+
function createResolveData(data) {
|
|
6516
|
+
return data.fileDependencies = [], data.contextDependencies = [], data.missingDependencies = [], data;
|
|
6517
|
+
}
|
|
6518
|
+
class NormalModuleFactory {
|
|
6519
|
+
hooks;
|
|
6520
|
+
resolverFactory;
|
|
6521
|
+
constructor(resolverFactory){
|
|
6522
|
+
this.hooks = {
|
|
6523
|
+
resolveForScheme: new HookMap(()=>new AsyncSeriesBailHook([
|
|
6524
|
+
'resourceData'
|
|
6525
|
+
])),
|
|
6526
|
+
beforeResolve: new AsyncSeriesBailHook([
|
|
6527
|
+
'resolveData'
|
|
6528
|
+
]),
|
|
6529
|
+
factorize: new AsyncSeriesBailHook([
|
|
6530
|
+
'resolveData'
|
|
6531
|
+
]),
|
|
6532
|
+
resolve: new AsyncSeriesBailHook([
|
|
6533
|
+
'resolveData'
|
|
6534
|
+
]),
|
|
6535
|
+
afterResolve: new AsyncSeriesBailHook([
|
|
6536
|
+
'resolveData'
|
|
6537
|
+
]),
|
|
6538
|
+
createModule: new AsyncSeriesBailHook([
|
|
6539
|
+
'createData',
|
|
6540
|
+
'resolveData'
|
|
6541
|
+
])
|
|
6542
|
+
}, this.resolverFactory = resolverFactory;
|
|
6543
|
+
}
|
|
6544
|
+
getResolver(type, resolveOptions) {
|
|
6545
|
+
return this.resolverFactory.get(type, resolveOptions);
|
|
6546
|
+
}
|
|
6547
|
+
}
|
|
6548
|
+
let NormalModuleReplacementPlugin = base_create(binding_.BuiltinPluginName.NormalModuleReplacementPlugin, (resourceRegExp, newResource)=>({
|
|
5666
6549
|
resourceRegExp,
|
|
5667
|
-
newResource: 'function' == typeof newResource ? (data)=>(newResource(data), data) : newResource
|
|
6550
|
+
newResource: 'function' == typeof newResource ? (data)=>(newResource(createResolveData(data)), data) : newResource
|
|
5668
6551
|
})), OccurrenceChunkIdsPlugin = base_create(binding_.BuiltinPluginName.OccurrenceChunkIdsPlugin, (options)=>({
|
|
5669
6552
|
...options
|
|
5670
6553
|
}), 'compilation'), ProgressPlugin = base_create(binding_.BuiltinPluginName.ProgressPlugin, (progress = {})=>'function' == typeof progress ? {
|
|
@@ -5719,7 +6602,7 @@ RsdoctorPluginImpl.getCompilationHooks = (compilation)=>{
|
|
|
5719
6602
|
])
|
|
5720
6603
|
}, RsdoctorPlugin_compilationHooksMap.set(compilation, hooks)), hooks;
|
|
5721
6604
|
};
|
|
5722
|
-
let RslibPlugin = base_create(binding_.BuiltinPluginName.RslibPlugin, (rslib)=>rslib), RstestPlugin = base_create(binding_.BuiltinPluginName.RstestPlugin, (rstest)=>rstest), RuntimeChunkPlugin = base_create(binding_.BuiltinPluginName.RuntimeChunkPlugin, (options)=>options, 'thisCompilation'), RuntimePlugin = base_create(binding__default().BuiltinPluginName.RuntimePlugin, ()=>{}, 'compilation'), RuntimePlugin_compilationHooksMap = new WeakMap();
|
|
6605
|
+
let RslibPlugin = base_create(binding_.BuiltinPluginName.RslibPlugin, (rslib = {})=>rslib), RstestPlugin = base_create(binding_.BuiltinPluginName.RstestPlugin, (rstest)=>rstest), RuntimeChunkPlugin = base_create(binding_.BuiltinPluginName.RuntimeChunkPlugin, (options)=>options, 'thisCompilation'), RuntimePlugin = base_create(binding__default().BuiltinPluginName.RuntimePlugin, ()=>{}, 'compilation'), RuntimePlugin_compilationHooksMap = new WeakMap();
|
|
5723
6606
|
RuntimePlugin.getCompilationHooks = (compilation)=>{
|
|
5724
6607
|
checkCompilation(compilation);
|
|
5725
6608
|
let hooks = RuntimePlugin_compilationHooksMap.get(compilation);
|
|
@@ -5826,6 +6709,7 @@ let SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin,
|
|
|
5826
6709
|
return options.htmlPlugin === NATIVE_HTML_PLUGIN ? htmlPlugin = 'Native' : 'string' == typeof options.htmlPlugin && (htmlPlugin = 'JavaScript'), {
|
|
5827
6710
|
hashFuncNames: options.hashFuncNames,
|
|
5828
6711
|
htmlPlugin,
|
|
6712
|
+
hashLoading: options.hashLoading,
|
|
5829
6713
|
integrityCallback: options.integrityCallback
|
|
5830
6714
|
};
|
|
5831
6715
|
});
|
|
@@ -5839,7 +6723,8 @@ class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin {
|
|
|
5839
6723
|
'sha384'
|
|
5840
6724
|
],
|
|
5841
6725
|
htmlPlugin: options.htmlPlugin ?? NATIVE_HTML_PLUGIN,
|
|
5842
|
-
enabled: options.enabled ?? 'auto'
|
|
6726
|
+
enabled: options.enabled ?? 'auto',
|
|
6727
|
+
hashLoading: options.hashLoading ?? 'eager'
|
|
5843
6728
|
};
|
|
5844
6729
|
super({
|
|
5845
6730
|
...finalOptions,
|
|
@@ -5898,7 +6783,7 @@ class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin {
|
|
|
5898
6783
|
src = relative(protocolRelativePublicPath.startsWith('//') ? `http:${protocolRelativePublicPath}` : protocolRelativePublicPath, decodeURIComponent(tagSrcWithScheme));
|
|
5899
6784
|
} else src = relative(publicPath, decodeURIComponent(tagSrc));
|
|
5900
6785
|
tag.attributes.integrity = this.getIntegrityChecksumForAsset(src) || function(hashFuncNames, source) {
|
|
5901
|
-
let { createHash } =
|
|
6786
|
+
let { createHash } = rspackRequire("node:crypto");
|
|
5902
6787
|
return hashFuncNames.map((hashFuncName)=>`${hashFuncName}-${createHash(hashFuncName).update('string' == typeof source ? Buffer.from(source, 'utf-8') : source).digest('base64')}`).join(' ');
|
|
5903
6788
|
}(this.options.hashFuncNames, readFileSync(join(outputPath, src))), tag.attributes.crossorigin = crossOriginLoading || 'anonymous';
|
|
5904
6789
|
}
|
|
@@ -5944,7 +6829,7 @@ function normalizePath(path) {
|
|
|
5944
6829
|
return path.replace(/\?.*$/, '').split(sep).join('/');
|
|
5945
6830
|
}
|
|
5946
6831
|
let SwcJsMinimizerRspackPlugin = base_create(binding_.BuiltinPluginName.SwcJsMinimizerRspackPlugin, function(options) {
|
|
5947
|
-
let compress = options?.minimizerOptions?.compress ?? !0, mangle = options?.minimizerOptions?.mangle ?? !0, ecma = options?.minimizerOptions?.ecma ?? (this.target?.esVersion && this.target.esVersion >
|
|
6832
|
+
let compress = options?.minimizerOptions?.compress ?? !0, mangle = options?.minimizerOptions?.mangle ?? !0, ecma = options?.minimizerOptions?.ecma ?? (this.target?.esVersion && this.target.esVersion > 2024 ? 2024 : this.target.esVersion) ?? 5, format = {
|
|
5948
6833
|
comments: !1,
|
|
5949
6834
|
...options?.minimizerOptions?.format
|
|
5950
6835
|
};
|
|
@@ -6000,25 +6885,10 @@ let SwcJsMinimizerRspackPlugin = base_create(binding_.BuiltinPluginName.SwcJsMin
|
|
|
6000
6885
|
ecma,
|
|
6001
6886
|
format,
|
|
6002
6887
|
minify: options?.minimizerOptions?.minify,
|
|
6003
|
-
module: options?.minimizerOptions?.module
|
|
6004
|
-
}
|
|
6005
|
-
};
|
|
6006
|
-
}, 'compilation');
|
|
6007
|
-
class SyncModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
6008
|
-
options;
|
|
6009
|
-
name = binding_.BuiltinPluginName.SyncModuleIdsPlugin;
|
|
6010
|
-
affectedHooks = 'compilation';
|
|
6011
|
-
constructor(options){
|
|
6012
|
-
super(), this.options = options;
|
|
6013
|
-
}
|
|
6014
|
-
raw() {
|
|
6015
|
-
let options = {
|
|
6016
|
-
...this.options
|
|
6017
|
-
};
|
|
6018
|
-
return createBuiltinPlugin(this.name, options);
|
|
6019
|
-
}
|
|
6020
|
-
}
|
|
6021
|
-
let URLPlugin = base_create(binding_.BuiltinPluginName.URLPlugin, ()=>{}, 'compilation');
|
|
6888
|
+
module: options?.minimizerOptions?.module
|
|
6889
|
+
}
|
|
6890
|
+
};
|
|
6891
|
+
}, 'compilation'), URLPlugin = base_create(binding_.BuiltinPluginName.URLPlugin, ()=>{}, 'compilation');
|
|
6022
6892
|
class WorkerPlugin extends RspackBuiltinPlugin {
|
|
6023
6893
|
chunkLoading;
|
|
6024
6894
|
wasmLoading;
|
|
@@ -6046,182 +6916,70 @@ class ContextModuleFactory {
|
|
|
6046
6916
|
};
|
|
6047
6917
|
}
|
|
6048
6918
|
}
|
|
6049
|
-
|
|
6050
|
-
|
|
6919
|
+
class ConcatenatedModule extends Module_Module {
|
|
6920
|
+
get rootModule() {
|
|
6921
|
+
return binding__default().concatenatedModuleGetRootModule(this);
|
|
6922
|
+
}
|
|
6923
|
+
get modules() {
|
|
6924
|
+
return binding__default().concatenatedModuleGetModules(this);
|
|
6925
|
+
}
|
|
6051
6926
|
}
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
},
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
let result = parseObject(obj);
|
|
6066
|
-
return parseCache.set(obj, result), result;
|
|
6067
|
-
}, parseObject = (obj)=>{
|
|
6068
|
-
let dynamicInfo, info = new Map(), getInfo = (p)=>{
|
|
6069
|
-
let entry = info.get(p);
|
|
6070
|
-
if (void 0 !== entry) return entry;
|
|
6071
|
-
let newEntry = {
|
|
6072
|
-
base: void 0,
|
|
6073
|
-
byProperty: void 0,
|
|
6074
|
-
byValues: new Map()
|
|
6075
|
-
};
|
|
6076
|
-
return info.set(p, newEntry), newEntry;
|
|
6077
|
-
};
|
|
6078
|
-
for (let key of Object.keys(obj))if (key.startsWith('by')) {
|
|
6079
|
-
let byObj = obj[key];
|
|
6080
|
-
if ('object' == typeof byObj) for (let byValue of Object.keys(byObj)){
|
|
6081
|
-
let obj = byObj[byValue];
|
|
6082
|
-
for (let key1 of Object.keys(obj)){
|
|
6083
|
-
let entry = getInfo(key1);
|
|
6084
|
-
if (void 0 === entry.byProperty) entry.byProperty = key;
|
|
6085
|
-
else if (entry.byProperty !== key) throw Error(`${key} and ${entry.byProperty} for a single property is not supported`);
|
|
6086
|
-
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);
|
|
6927
|
+
class ContextModule extends Module_Module {
|
|
6928
|
+
}
|
|
6929
|
+
class ExternalModule extends Module_Module {
|
|
6930
|
+
#userRequest = null;
|
|
6931
|
+
static #properties = {
|
|
6932
|
+
userRequest: {
|
|
6933
|
+
enumerable: !0,
|
|
6934
|
+
configurable: !0,
|
|
6935
|
+
get () {
|
|
6936
|
+
return null === this.#userRequest && (this.#userRequest = binding__default().externalModuleGetUserRequest(this)), this.#userRequest;
|
|
6937
|
+
},
|
|
6938
|
+
set (value) {
|
|
6939
|
+
this.#userRequest = value;
|
|
6087
6940
|
}
|
|
6088
6941
|
}
|
|
6089
|
-
else if ('function' == typeof byObj) if (void 0 === dynamicInfo) dynamicInfo = {
|
|
6090
|
-
byProperty: key,
|
|
6091
|
-
fn: byObj
|
|
6092
|
-
};
|
|
6093
|
-
else throw Error(`${key} and ${dynamicInfo.byProperty} when both are functions is not supported`);
|
|
6094
|
-
else getInfo(key).base = obj[key];
|
|
6095
|
-
} else getInfo(key).base = obj[key];
|
|
6096
|
-
return {
|
|
6097
|
-
static: info,
|
|
6098
|
-
dynamic: dynamicInfo
|
|
6099
6942
|
};
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
for (let entry of info.values())if (void 0 !== entry.byProperty) {
|
|
6103
|
-
let byObj = obj[entry.byProperty] = obj[entry.byProperty] || {};
|
|
6104
|
-
for (let byValue of entry.byValues.keys())byObj[byValue] = byObj[byValue] || {};
|
|
6105
|
-
}
|
|
6106
|
-
for (let [key, entry] of info)if (void 0 !== entry.base && (obj[key] = entry.base), void 0 !== entry.byProperty) {
|
|
6107
|
-
let byObj = obj[entry.byProperty] = obj[entry.byProperty] || {};
|
|
6108
|
-
for (let byValue of Object.keys(byObj)){
|
|
6109
|
-
let value = getFromByValues(entry.byValues, byValue);
|
|
6110
|
-
void 0 !== value && (byObj[byValue][key] = value);
|
|
6111
|
-
}
|
|
6112
|
-
}
|
|
6113
|
-
return void 0 !== dynamicInfo && (obj[dynamicInfo.byProperty] = dynamicInfo.fn), obj;
|
|
6114
|
-
}, 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)=>{
|
|
6115
|
-
let firstObject = internalCaching ? cachedParseObject(first) : parseObject(first), { static: firstInfo, dynamic: firstDynamicInfo } = firstObject, secondObj = second;
|
|
6116
|
-
if (void 0 !== firstDynamicInfo) {
|
|
6117
|
-
let { fn } = firstDynamicInfo, { byProperty } = firstDynamicInfo, fnInfo = fn[DYNAMIC_INFO];
|
|
6118
|
-
fnInfo && (secondObj = internalCaching ? cachedCleverMerge(fnInfo[1], second) : cleverMerge(fnInfo[1], second), fn = fnInfo[0]);
|
|
6119
|
-
let newFn = (...args)=>{
|
|
6120
|
-
let fnResult = fn(...args);
|
|
6121
|
-
return internalCaching ? cachedCleverMerge(fnResult, secondObj) : cleverMerge(fnResult, secondObj);
|
|
6122
|
-
};
|
|
6123
|
-
return newFn[DYNAMIC_INFO] = [
|
|
6124
|
-
fn,
|
|
6125
|
-
secondObj
|
|
6126
|
-
], cleverMerge_serializeObject(firstObject.static, {
|
|
6127
|
-
byProperty,
|
|
6128
|
-
fn: newFn
|
|
6129
|
-
});
|
|
6130
|
-
}
|
|
6131
|
-
let { static: secondInfo, dynamic: secondDynamicInfo } = internalCaching ? cachedParseObject(second) : parseObject(second), resultInfo = new Map();
|
|
6132
|
-
for (let [key, firstEntry] of firstInfo){
|
|
6133
|
-
let secondEntry = secondInfo.get(key), entry = void 0 !== secondEntry ? mergeEntries(firstEntry, secondEntry, internalCaching) : firstEntry;
|
|
6134
|
-
resultInfo.set(key, entry);
|
|
6943
|
+
constructor(){
|
|
6944
|
+
super(), Object.defineProperties(this, ExternalModule.#properties);
|
|
6135
6945
|
}
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
{
|
|
6145
|
-
if (!firstEntry.byProperty) return {
|
|
6146
|
-
base: firstEntry.base,
|
|
6147
|
-
byProperty: secondEntry.byProperty,
|
|
6148
|
-
byValues: secondEntry.byValues
|
|
6149
|
-
};
|
|
6150
|
-
if (firstEntry.byProperty !== secondEntry.byProperty) throw Error(`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`);
|
|
6151
|
-
let newByValues = new Map(firstEntry.byValues);
|
|
6152
|
-
for (let [key, value] of secondEntry.byValues){
|
|
6153
|
-
let firstValue = getFromByValues(firstEntry.byValues, key);
|
|
6154
|
-
newByValues.set(key, mergeSingleValue(firstValue, value, internalCaching));
|
|
6155
|
-
}
|
|
6156
|
-
return {
|
|
6157
|
-
base: firstEntry.base,
|
|
6158
|
-
byProperty: firstEntry.byProperty,
|
|
6159
|
-
byValues: newByValues
|
|
6160
|
-
};
|
|
6161
|
-
}
|
|
6162
|
-
default:
|
|
6163
|
-
{
|
|
6164
|
-
let newBase;
|
|
6165
|
-
if (!firstEntry.byProperty) return {
|
|
6166
|
-
base: mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching),
|
|
6167
|
-
byProperty: secondEntry.byProperty,
|
|
6168
|
-
byValues: secondEntry.byValues
|
|
6169
|
-
};
|
|
6170
|
-
let intermediateByValues = new Map(firstEntry.byValues);
|
|
6171
|
-
for (let [key, value] of intermediateByValues)intermediateByValues.set(key, mergeSingleValue(value, secondEntry.base, internalCaching));
|
|
6172
|
-
if (Array.from(firstEntry.byValues.values()).every((value)=>{
|
|
6173
|
-
let type = getValueType(value);
|
|
6174
|
-
return 1 === type || 4 === type;
|
|
6175
|
-
}) ? newBase = mergeSingleValue(firstEntry.base, secondEntry.base, internalCaching) : (newBase = firstEntry.base, intermediateByValues.has('default') || intermediateByValues.set('default', secondEntry.base)), !secondEntry.byProperty) return {
|
|
6176
|
-
base: newBase,
|
|
6177
|
-
byProperty: firstEntry.byProperty,
|
|
6178
|
-
byValues: intermediateByValues
|
|
6179
|
-
};
|
|
6180
|
-
if (firstEntry.byProperty !== secondEntry.byProperty) throw Error(`${firstEntry.byProperty} and ${secondEntry.byProperty} for a single property is not supported`);
|
|
6181
|
-
let newByValues = new Map(intermediateByValues);
|
|
6182
|
-
for (let [key, value] of secondEntry.byValues){
|
|
6183
|
-
let firstValue = getFromByValues(intermediateByValues, key);
|
|
6184
|
-
newByValues.set(key, mergeSingleValue(firstValue, value, internalCaching));
|
|
6185
|
-
}
|
|
6186
|
-
return {
|
|
6187
|
-
base: newBase,
|
|
6188
|
-
byProperty: firstEntry.byProperty,
|
|
6189
|
-
byValues: newByValues
|
|
6190
|
-
};
|
|
6191
|
-
}
|
|
6946
|
+
static getCompilationHooks(compilation) {
|
|
6947
|
+
if (!(COMPILATION_HOOKS_MAP_SYMBOL in compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
|
|
6948
|
+
return getOrCreateCompilationHooks(compilation, binding__default(), ()=>({
|
|
6949
|
+
chunkCondition: new SyncBailHook([
|
|
6950
|
+
'chunk',
|
|
6951
|
+
'compilation'
|
|
6952
|
+
])
|
|
6953
|
+
}));
|
|
6192
6954
|
}
|
|
6193
|
-
}
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
case 3:
|
|
6217
|
-
return b.map((item)=>'...' === item ? a : item);
|
|
6218
|
-
default:
|
|
6219
|
-
throw Error('Not implemented');
|
|
6220
|
-
}
|
|
6221
|
-
default:
|
|
6222
|
-
throw Error('Not implemented');
|
|
6955
|
+
}
|
|
6956
|
+
let MODULE_CLASSES = {
|
|
6957
|
+
[binding_.ModuleKind.Module]: Module_Module,
|
|
6958
|
+
[binding_.ModuleKind.Normal]: NormalModule,
|
|
6959
|
+
[binding_.ModuleKind.Concatenated]: ConcatenatedModule,
|
|
6960
|
+
[binding_.ModuleKind.Context]: ContextModule,
|
|
6961
|
+
[binding_.ModuleKind.External]: ExternalModule
|
|
6962
|
+
}, bindingHelpers = {
|
|
6963
|
+
createModule: function(kind) {
|
|
6964
|
+
return new MODULE_CLASSES[kind]();
|
|
6965
|
+
},
|
|
6966
|
+
applyIndexedArrayUpdates: function(source, target, commands) {
|
|
6967
|
+
let mode = commands[0], length = commands[1];
|
|
6968
|
+
if (0 === mode) {
|
|
6969
|
+
target.length = length;
|
|
6970
|
+
for(let i = 0, cursor = 2; cursor < commands.length; i++, cursor++)target[i] = source[commands[cursor]];
|
|
6971
|
+
} else for(let cursor = 2; cursor < commands.length; cursor += 2)target[commands[cursor]] = source[commands[cursor + 1]];
|
|
6972
|
+
target.length = length;
|
|
6973
|
+
},
|
|
6974
|
+
swapRemoveArrayElements: function(array, removedIndices) {
|
|
6975
|
+
let length = array.length;
|
|
6976
|
+
for (let index of removedIndices)index !== --length && (array[index] = array[length]);
|
|
6977
|
+
array.length = length;
|
|
6223
6978
|
}
|
|
6224
6979
|
};
|
|
6980
|
+
function assertNotNill(value) {
|
|
6981
|
+
if (null == value) throw Error(`${value} should not be undefined or null`);
|
|
6982
|
+
}
|
|
6225
6983
|
class BrowserslistError extends Error {
|
|
6226
6984
|
constructor(message){
|
|
6227
6985
|
var key, value;
|
|
@@ -6236,8 +6994,14 @@ class BrowserslistError extends Error {
|
|
|
6236
6994
|
let isFileCache = {};
|
|
6237
6995
|
function isFile(file) {
|
|
6238
6996
|
if (file in isFileCache) return isFileCache[file];
|
|
6239
|
-
|
|
6240
|
-
|
|
6997
|
+
try {
|
|
6998
|
+
let result = node_fs.existsSync(file) && node_fs.statSync(file).isFile();
|
|
6999
|
+
return isFileCache[file] = result, result;
|
|
7000
|
+
} catch (error) {
|
|
7001
|
+
let { code } = error;
|
|
7002
|
+
if ('ENOENT' === code || 'EACCES' === code || 'ERR_ACCESS_DENIED' === code) return !1;
|
|
7003
|
+
throw error;
|
|
7004
|
+
}
|
|
6241
7005
|
}
|
|
6242
7006
|
function parsePackage(file) {
|
|
6243
7007
|
let config = JSON.parse(node_fs.readFileSync(file).toString().replace(/^\uFEFF/m, ''));
|
|
@@ -6250,7 +7014,7 @@ function parsePackage(file) {
|
|
|
6250
7014
|
if (Array.isArray(section)) {
|
|
6251
7015
|
for(let i = 0; i < section.length; i++)if ('string' != typeof section[i]) throw new BrowserslistError(FORMAT);
|
|
6252
7016
|
} else if ('string' != typeof section) throw new BrowserslistError(FORMAT);
|
|
6253
|
-
}(list[i]);
|
|
7017
|
+
}(list[i]), 'string' == typeof list[i] && (list[i] = parseConfig(list[i]).defaults);
|
|
6254
7018
|
return list;
|
|
6255
7019
|
}
|
|
6256
7020
|
let IS_SECTION = /^\s*\[(.+)]\s*$/;
|
|
@@ -6817,6 +7581,23 @@ let configCache = {}, ES_VERSIONS_MAP = {
|
|
|
6817
7581
|
6
|
|
6818
7582
|
]
|
|
6819
7583
|
}),
|
|
7584
|
+
topLevelAwait: rawChecker({
|
|
7585
|
+
chrome: 89,
|
|
7586
|
+
and_chr: 89,
|
|
7587
|
+
edge: 89,
|
|
7588
|
+
firefox: 89,
|
|
7589
|
+
and_ff: 89,
|
|
7590
|
+
opera: 75,
|
|
7591
|
+
op_mob: 63,
|
|
7592
|
+
safari: 15,
|
|
7593
|
+
ios_saf: 15,
|
|
7594
|
+
samsung: 15,
|
|
7595
|
+
android: 89,
|
|
7596
|
+
node: [
|
|
7597
|
+
14,
|
|
7598
|
+
8
|
|
7599
|
+
]
|
|
7600
|
+
}),
|
|
6820
7601
|
browser: browserProperty,
|
|
6821
7602
|
electron: !1,
|
|
6822
7603
|
node: nodeProperty,
|
|
@@ -6990,6 +7771,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6990
7771
|
methodShorthand: v(4),
|
|
6991
7772
|
arrowFunction: v(6),
|
|
6992
7773
|
asyncFunction: v(7, 6),
|
|
7774
|
+
topLevelAwait: v(14, 8),
|
|
6993
7775
|
forOf: v(5),
|
|
6994
7776
|
destructuring: v(6),
|
|
6995
7777
|
bigIntLiteral: v(10, 4),
|
|
@@ -7037,6 +7819,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7037
7819
|
methodShorthand: v(1, 1),
|
|
7038
7820
|
arrowFunction: v(1, 1),
|
|
7039
7821
|
asyncFunction: v(1, 7),
|
|
7822
|
+
topLevelAwait: v(12),
|
|
7040
7823
|
forOf: v(0, 36),
|
|
7041
7824
|
destructuring: v(1, 1),
|
|
7042
7825
|
bigIntLiteral: v(4),
|
|
@@ -7078,6 +7861,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7078
7861
|
methodShorthand: v(0, 15),
|
|
7079
7862
|
arrowFunction: v(0, 15),
|
|
7080
7863
|
asyncFunction: v(0, 21),
|
|
7864
|
+
topLevelAwait: v(0, 52),
|
|
7081
7865
|
forOf: v(0, 13),
|
|
7082
7866
|
destructuring: v(0, 15),
|
|
7083
7867
|
bigIntLiteral: v(0, 32),
|
|
@@ -7094,7 +7878,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7094
7878
|
(version)=>{
|
|
7095
7879
|
let v = +version;
|
|
7096
7880
|
return 5 < v && v < 1000 && (v += 2009), {
|
|
7097
|
-
esVersion: v >
|
|
7881
|
+
esVersion: v > 2024 ? 2024 : v,
|
|
7098
7882
|
const: v >= 2015,
|
|
7099
7883
|
computedProperty: v >= 2015,
|
|
7100
7884
|
templateLiteral: v >= 2015,
|
|
@@ -7106,6 +7890,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7106
7890
|
destructuring: v >= 2015,
|
|
7107
7891
|
module: v >= 2015,
|
|
7108
7892
|
asyncFunction: v >= 2017,
|
|
7893
|
+
topLevelAwait: v >= 2022,
|
|
7109
7894
|
globalThis: v >= 2020,
|
|
7110
7895
|
bigIntLiteral: v >= 2020,
|
|
7111
7896
|
dynamicImport: v >= 2020,
|
|
@@ -7165,8 +7950,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7165
7950
|
'./src'
|
|
7166
7951
|
]);
|
|
7167
7952
|
return F(options, 'devtool', ()=>!!development && 'cheap-module-source-map'), D(options, 'watch', !1), D(options, 'lazyCompilation', !1), D(options, 'bail', !1), F(options, 'cache', ()=>!!development && {
|
|
7168
|
-
type: 'memory'
|
|
7169
|
-
snapshot: {}
|
|
7953
|
+
type: 'memory'
|
|
7170
7954
|
}), applyCacheDefaults(options.cache, {
|
|
7171
7955
|
context: options.context,
|
|
7172
7956
|
name: options.name || '',
|
|
@@ -7174,6 +7958,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7174
7958
|
compilerIndex
|
|
7175
7959
|
}), applyIncrementalDefaults(options), applyExperimentsDefaults(options.experiments, {
|
|
7176
7960
|
production
|
|
7961
|
+
}), applySnapshotDefaults(options.snapshot, {
|
|
7962
|
+
production
|
|
7177
7963
|
}), applyOptimizationDefaults(options.optimization, {
|
|
7178
7964
|
production,
|
|
7179
7965
|
development
|
|
@@ -7220,19 +8006,39 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7220
8006
|
targets: targetProperties.targets
|
|
7221
8007
|
};
|
|
7222
8008
|
}, applyCacheDefaults = (cache, { context, name, mode, compilerIndex })=>{
|
|
7223
|
-
if (!1 !== cache) switch(
|
|
7224
|
-
|
|
7225
|
-
|
|
8009
|
+
if (!1 !== cache) switch('persistent' === cache.type && (F(cache, 'name', ()=>{
|
|
8010
|
+
let cacheName = name ? `${name}-${mode}` : mode;
|
|
8011
|
+
return void 0 !== compilerIndex && compilerIndex > 0 ? `${cacheName}-${compilerIndex}` : cacheName;
|
|
8012
|
+
}), D(cache, 'version', ''), D(cache, 'maxMemoryGenerations', 'development' === mode ? 5 : 1 / 0), D(cache, 'readonly', !1)), cache.type){
|
|
7226
8013
|
case 'memory':
|
|
7227
8014
|
break;
|
|
7228
8015
|
case 'persistent':
|
|
7229
|
-
F(cache, 'name', ()=>
|
|
7230
|
-
let cacheName = name ? `${name}-${mode}` : mode;
|
|
7231
|
-
return void 0 !== compilerIndex && compilerIndex > 0 ? `${cacheName}-${compilerIndex}` : cacheName;
|
|
7232
|
-
}), D(cache.storage, 'type', 'filesystem'), F(cache.storage, 'directory', ()=>node_path.resolve(context, 'node_modules/.cache/rspack')), F(cache.storage, 'location', ()=>node_path.resolve(cache.storage.directory, cache.name)), D(cache, 'version', ''), D(cache, 'maxAge', 604800), F(cache, 'buildDependencies', ()=>[]), D(cache, 'portable', !1), D(cache, 'readonly', !1);
|
|
8016
|
+
D(cache.storage, 'type', 'filesystem'), F(cache.storage, 'directory', ()=>node_path.resolve(context, 'node_modules/.cache/rspack')), F(cache.storage, 'location', ()=>node_path.resolve(cache.storage.directory, cache.name)), D(cache, 'maxAge', 604800), F(cache, 'buildDependencies', ()=>[]), D(cache, 'portable', !1);
|
|
7233
8017
|
}
|
|
8018
|
+
}, applySnapshotDefaults = (snapshot, { production })=>{
|
|
8019
|
+
F(snapshot, 'immutablePaths', ()=>[]), F(snapshot, 'unmanagedPaths', ()=>[]), F(snapshot, 'managedPaths', ()=>[
|
|
8020
|
+
/[\\/]node_modules[\\/][^.]/
|
|
8021
|
+
]), F(snapshot, 'resolveBuildDependencies', ()=>({
|
|
8022
|
+
timestamp: !0,
|
|
8023
|
+
hash: !0
|
|
8024
|
+
})), F(snapshot, 'buildDependencies', ()=>({
|
|
8025
|
+
timestamp: !0,
|
|
8026
|
+
hash: !0
|
|
8027
|
+
})), F(snapshot, 'module', ()=>production ? {
|
|
8028
|
+
timestamp: !0,
|
|
8029
|
+
hash: !0
|
|
8030
|
+
} : {
|
|
8031
|
+
timestamp: !0
|
|
8032
|
+
}), F(snapshot, 'contextModule', ()=>({
|
|
8033
|
+
timestamp: !0
|
|
8034
|
+
})), F(snapshot, 'resolve', ()=>production ? {
|
|
8035
|
+
timestamp: !0,
|
|
8036
|
+
hash: !0
|
|
8037
|
+
} : {
|
|
8038
|
+
timestamp: !0
|
|
8039
|
+
});
|
|
7234
8040
|
}, applyExperimentsDefaults = (experiments, { production })=>{
|
|
7235
|
-
D(experiments, 'futureDefaults', !1), D(experiments, 'newCache', !1), 'object' == typeof experiments.newCache && (D(experiments.newCache, 'codeGeneration', !0), D(experiments.newCache, 'devtool', !0), D(experiments.newCache, 'loader', !0), D(experiments.newCache, 'minimize', !0)), D(experiments, 'asyncWebAssembly', !0), D(experiments, 'deferImport', !1), D(experiments, 'sourceImport', !1), D(experiments, 'buildHttp', void 0), experiments.buildHttp && 'object' == typeof experiments.buildHttp && D(experiments.buildHttp, 'upgrade', !1), D(experiments, 'useInputFileSystem', !1), D(experiments, 'pureFunctions', production), D(experiments, 'runtimeMode', 'webpack');
|
|
8041
|
+
D(experiments, 'futureDefaults', !1), D(experiments, 'newCache', !1), 'object' == typeof experiments.newCache && (D(experiments.newCache, 'codeGeneration', !0), D(experiments.newCache, 'module', !0), D(experiments.newCache, 'devtool', !0), D(experiments.newCache, 'loader', !0), D(experiments.newCache, 'minimize', !0), D(experiments.newCache, 'resolver', !1)), D(experiments, 'asyncWebAssembly', !0), D(experiments, 'deferImport', !1), D(experiments, 'sourceImport', !1), D(experiments, 'buildHttp', void 0), experiments.buildHttp && 'object' == typeof experiments.buildHttp && (D(experiments.buildHttp, 'upgrade', !1), D(experiments.buildHttp, 'frozen', production)), D(experiments, 'useInputFileSystem', !1), D(experiments, 'pureFunctions', production), D(experiments, 'runtimeMode', 'webpack');
|
|
7236
8042
|
}, applyIncrementalDefaults = (options)=>{
|
|
7237
8043
|
D(options, 'incremental', {}), 'object' == typeof options.incremental && (D(options.incremental, 'silent', !0), D(options.incremental, 'buildModuleGraph', !0), D(options.incremental, 'finishModules', !0), D(options.incremental, 'optimizeDependencies', !0), D(options.incremental, 'buildChunkGraph', !0), D(options.incremental, 'optimizeChunkModules', !0), D(options.incremental, 'moduleIds', !0), D(options.incremental, 'chunkIds', !0), D(options.incremental, 'modulesHashes', !0), D(options.incremental, 'modulesCodegen', !0), D(options.incremental, 'modulesRuntimeRequirements', !0), D(options.incremental, 'chunksRuntimeRequirements', !0), D(options.incremental, 'chunksHashes', !0), D(options.incremental, 'chunkAsset', !0), D(options.incremental, 'emitAssets', !0));
|
|
7238
8044
|
}, applyCssParserOptionsDefaults = (parserOptions)=>{
|
|
@@ -7245,7 +8051,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7245
8051
|
applyCssModuleParserOptionsDefaults(parserOptions), D(parserOptions, 'pure', !1);
|
|
7246
8052
|
}, applyModuleDefaults = (module, { asyncWebAssembly, targetProperties, mode, uniqueName, deferImport, sourceImport, outputModule, hashFunction, hashSalt })=>{
|
|
7247
8053
|
assertNotNill(module.parser), assertNotNill(module.generator), F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), F(module.parser.asset, 'dataUrlCondition', ()=>({})), 'object' == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, 'maxSize', 8096), F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), ((parserOptions, { deferImport, sourceImport, outputModule })=>{
|
|
7248
|
-
D(parserOptions, 'dynamicImportMode', 'lazy'), D(parserOptions, 'dynamicImportPrefetch', !1), D(parserOptions, 'dynamicImportPreload', !1), D(parserOptions, 'url', !0), D(parserOptions, 'exprContextCritical', !0), D(parserOptions, 'unknownContextCritical', !0), D(parserOptions, 'wrappedContextCritical', !1), D(parserOptions, 'strictThisContextOnImports', !1), D(parserOptions, 'wrappedContextRegExp', /.*/), D(parserOptions, 'exportsPresence', 'error'), D(parserOptions, 'requireAsExpression', !0), D(parserOptions, 'requireAlias', !1), D(parserOptions, 'requireDynamic', !0), D(parserOptions, 'requireResolve', !0), D(parserOptions, 'commonjs', !0), D(parserOptions, 'importDynamic', !0), D(parserOptions, 'worker', [
|
|
8054
|
+
D(parserOptions, 'dynamicImportMode', 'lazy'), D(parserOptions, 'dynamicImportPrefetch', !1), D(parserOptions, 'dynamicImportPreload', !1), D(parserOptions, 'url', !0), D(parserOptions, 'dynamicUrl', !0), D(parserOptions, 'exprContextCritical', !0), D(parserOptions, 'unknownContextCritical', !0), D(parserOptions, 'wrappedContextCritical', !1), D(parserOptions, 'strictThisContextOnImports', !1), D(parserOptions, 'wrappedContextRegExp', /.*/), D(parserOptions, 'exportsPresence', 'error'), D(parserOptions, 'requireAsExpression', !0), D(parserOptions, 'requireAlias', !1), D(parserOptions, 'requireDynamic', !0), D(parserOptions, 'requireResolve', !0), D(parserOptions, 'commonjs', !0), D(parserOptions, 'importDynamic', !0), D(parserOptions, 'worker', [
|
|
7249
8055
|
'...'
|
|
7250
8056
|
]), D(parserOptions, 'importMeta', !outputModule || 'preserve-unknown'), D(parserOptions, 'typeReexportsPresence', 'no-tolerant'), D(parserOptions, 'jsx', !1), D(parserOptions, 'deferImport', deferImport), D(parserOptions, 'sourceImport', sourceImport), D(parserOptions, 'importMetaResolve', !1), D(parserOptions, 'createRequire', !1);
|
|
7251
8057
|
})(module.parser.javascript, {
|
|
@@ -7445,6 +8251,9 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7445
8251
|
}), F(environment, 'importMetaDirnameAndFilename', ()=>tp && tp.importMetaDirnameAndFilename), F(environment, 'templateLiteral', ()=>{
|
|
7446
8252
|
let v;
|
|
7447
8253
|
return tp && ((v = tp.templateLiteral) || void 0 === v);
|
|
8254
|
+
}), F(environment, 'topLevelAwait', ()=>{
|
|
8255
|
+
let v;
|
|
8256
|
+
return tp && ((v = tp.topLevelAwait) || void 0 === v);
|
|
7448
8257
|
}), F(environment, 'dynamicImport', ()=>tp && conditionallyOptimistic(tp.dynamicImport, output.module)), F(environment, 'dynamicImportInWorker', ()=>tp && conditionallyOptimistic(tp.dynamicImportInWorker, output.module)), F(environment, 'module', ()=>tp && conditionallyOptimistic(tp.module, output.module)), F(environment, 'document', ()=>{
|
|
7449
8258
|
let v;
|
|
7450
8259
|
return tp && ((v = tp.document) || void 0 === v);
|
|
@@ -7539,7 +8348,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7539
8348
|
return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
|
|
7540
8349
|
desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
|
|
7541
8350
|
}), Array.from(enabledWasmLoadingTypes);
|
|
7542
|
-
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.
|
|
8351
|
+
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.3.2"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !1));
|
|
7543
8352
|
}, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
|
|
7544
8353
|
let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
|
|
7545
8354
|
D(externalsPresets, 'web', !buildHttp && targetProperties && (targetProperties.web || isUniversal('node'))), D(externalsPresets, 'node', targetProperties && (targetProperties.node || isUniversal('node'))), D(externalsPresets, 'electron', targetProperties && targetProperties.electron || isUniversal('electron')), D(externalsPresets, 'electronMain', targetProperties && !!targetProperties.electron && (targetProperties.electronMain || isUniversal('electronMain'))), D(externalsPresets, 'electronPreload', targetProperties && !!targetProperties.electron && (targetProperties.electronPreload || isUniversal('electronPreload'))), D(externalsPresets, 'electronRenderer', targetProperties && !!targetProperties.electron && (targetProperties.electronRenderer || isUniversal('electronRenderer'))), D(externalsPresets, 'nwjs', targetProperties && (targetProperties.nwjs || isUniversal('nwjs')));
|
|
@@ -7572,11 +8381,11 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7572
8381
|
]), F(optimization, 'nodeEnv', ()=>production ? 'production' : !!development && 'development');
|
|
7573
8382
|
let { splitChunks } = optimization;
|
|
7574
8383
|
if (splitChunks) {
|
|
7575
|
-
A(splitChunks, 'defaultSizeTypes', ()=>[
|
|
8384
|
+
D(splitChunks, 'dedupDepth', +!!production), A(splitChunks, 'defaultSizeTypes', ()=>[
|
|
7576
8385
|
"javascript",
|
|
7577
8386
|
'css',
|
|
7578
8387
|
'unknown'
|
|
7579
|
-
]), D(splitChunks, 'hidePathInfo', production), D(splitChunks, 'chunks', 'async'), D(splitChunks, 'usedExports', !0 === optimization.usedExports), D(splitChunks, 'minChunks', 1), F(splitChunks, 'minSize', ()=>production ? 20000 : 10000), F(splitChunks, 'enforceSizeThreshold', ()=>production ? 50000 : 30000), F(splitChunks, 'maxAsyncRequests', ()=>production ? 30 : 1 / 0), F(splitChunks, 'maxInitialRequests', ()=>production ? 30 : 1 / 0), D(splitChunks, 'automaticNameDelimiter', '-');
|
|
8388
|
+
]), D(splitChunks, 'hidePathInfo', production), D(splitChunks, 'chunks', 'async'), D(splitChunks, 'usedExports', !0 === optimization.usedExports), D(splitChunks, 'minChunks', 1), F(splitChunks, 'minSize', ()=>production ? 20000 : 10000), F(splitChunks, 'minRemainingSize', ()=>development ? 0 : void 0), F(splitChunks, 'enforceSizeThreshold', ()=>production ? 50000 : 30000), F(splitChunks, 'maxAsyncRequests', ()=>production ? 30 : 1 / 0), F(splitChunks, 'maxInitialRequests', ()=>production ? 30 : 1 / 0), D(splitChunks, 'automaticNameDelimiter', '-');
|
|
7580
8389
|
let { cacheGroups } = splitChunks;
|
|
7581
8390
|
cacheGroups && (F(cacheGroups, 'default', ()=>({
|
|
7582
8391
|
idHint: '',
|
|
@@ -7844,16 +8653,13 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7844
8653
|
cache: optionalNestedConfig(config.cache, (cache)=>{
|
|
7845
8654
|
if (!1 === cache) return !1;
|
|
7846
8655
|
if (!0 === cache) return {
|
|
7847
|
-
type: 'memory'
|
|
7848
|
-
snapshot: getNormalizedCacheSnapshot()
|
|
8656
|
+
type: 'memory'
|
|
7849
8657
|
};
|
|
7850
8658
|
switch(cache.type){
|
|
7851
8659
|
case void 0:
|
|
7852
8660
|
case 'memory':
|
|
7853
8661
|
return {
|
|
7854
|
-
|
|
7855
|
-
type: 'memory',
|
|
7856
|
-
snapshot: getNormalizedCacheSnapshot(cache.snapshot)
|
|
8662
|
+
type: 'memory'
|
|
7857
8663
|
};
|
|
7858
8664
|
case 'persistent':
|
|
7859
8665
|
{
|
|
@@ -7865,13 +8671,13 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7865
8671
|
name: cache.name,
|
|
7866
8672
|
version: cache.version,
|
|
7867
8673
|
maxAge: cache.maxAge,
|
|
8674
|
+
maxMemoryGenerations: cache.maxMemoryGenerations,
|
|
7868
8675
|
...hasMaxVersions ? {
|
|
7869
8676
|
maxVersions: cache.maxVersions
|
|
7870
8677
|
} : {},
|
|
7871
8678
|
portable: cache.portable,
|
|
7872
8679
|
readonly: cache.readonly,
|
|
7873
8680
|
buildDependencies: nestedArray(cache.buildDependencies, (deps)=>deps.map((d)=>node_path.resolve(context, d))),
|
|
7874
|
-
snapshot: getNormalizedCacheSnapshot(cache.snapshot),
|
|
7875
8681
|
storage: nestedConfig(cache.storage, (storage)=>({
|
|
7876
8682
|
type: storage.type,
|
|
7877
8683
|
directory: optionalNestedConfig(storage.directory, (directory)=>node_path.resolve(context, directory)),
|
|
@@ -7883,6 +8689,10 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7883
8689
|
throw Error(`Not implemented cache.type ${cache.type}`);
|
|
7884
8690
|
}
|
|
7885
8691
|
}),
|
|
8692
|
+
snapshot: getNormalizedSnapshot({
|
|
8693
|
+
...'object' == typeof config.cache && 'persistent' === config.cache.type ? config.cache.snapshot : void 0,
|
|
8694
|
+
...config.snapshot
|
|
8695
|
+
}),
|
|
7886
8696
|
stats: nestedConfig(config.stats, (stats)=>!1 === stats ? {
|
|
7887
8697
|
preset: 'none'
|
|
7888
8698
|
} : !0 === stats ? {
|
|
@@ -7994,7 +8804,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7994
8804
|
emitAssets: !0
|
|
7995
8805
|
} : !0 === incremental || 'advance-silent' === incremental ? {} : 'advance' === incremental ? {
|
|
7996
8806
|
silent: !1
|
|
7997
|
-
} : incremental), getNormalizedNewCacheOptions = (newCache)=>!1 !== newCache && (!0 === newCache ? {} : newCache),
|
|
8807
|
+
} : incremental), getNormalizedNewCacheOptions = (newCache)=>!1 !== newCache && (!0 === newCache ? {} : newCache), getNormalizedSnapshot = (snapshot)=>nestedConfig(snapshot, (snapshot)=>({
|
|
7998
8808
|
immutablePaths: optionalNestedArray(snapshot.immutablePaths, (p)=>[
|
|
7999
8809
|
...p
|
|
8000
8810
|
]),
|
|
@@ -8003,7 +8813,12 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
8003
8813
|
]),
|
|
8004
8814
|
managedPaths: optionalNestedArray(snapshot.managedPaths, (p)=>[
|
|
8005
8815
|
...p
|
|
8006
|
-
])
|
|
8816
|
+
]),
|
|
8817
|
+
buildDependencies: optionalNestedConfig(snapshot.buildDependencies, cloneObject),
|
|
8818
|
+
resolveBuildDependencies: optionalNestedConfig(snapshot.resolveBuildDependencies, cloneObject),
|
|
8819
|
+
module: optionalNestedConfig(snapshot.module, cloneObject),
|
|
8820
|
+
contextModule: optionalNestedConfig(snapshot.contextModule, cloneObject),
|
|
8821
|
+
resolve: optionalNestedConfig(snapshot.resolve, cloneObject)
|
|
8007
8822
|
})), nestedConfig = (value, fn)=>fn(void 0 === value ? {} : value), optionalNestedConfig = (value, fn)=>void 0 === value ? void 0 : fn(value), nestedArray = (value, fn)=>fn(Array.isArray(value) ? value : []), optionalNestedArray = (value, fn)=>Array.isArray(value) ? fn(value) : void 0, cloneObject = (value)=>({
|
|
8008
8823
|
...value
|
|
8009
8824
|
}), keyedNestedConfig = (value, fn, customKeys)=>{
|
|
@@ -8029,7 +8844,7 @@ function __to_binding_runtime_globals(runtimeRequirements, compilerRuntimeGlobal
|
|
|
8029
8844
|
}
|
|
8030
8845
|
return res;
|
|
8031
8846
|
}
|
|
8032
|
-
var RuntimeGlobals_RuntimeGlobals = ((RuntimeGlobals = RuntimeGlobals_RuntimeGlobals || {})[RuntimeGlobals.require = 0] = "require", RuntimeGlobals[RuntimeGlobals.requireScope = 1] = "requireScope", RuntimeGlobals[RuntimeGlobals.exports = 2] = "exports", RuntimeGlobals[RuntimeGlobals.thisAsExports = 3] = "thisAsExports", RuntimeGlobals[RuntimeGlobals.returnExportsFromRuntime = 4] = "returnExportsFromRuntime", RuntimeGlobals[RuntimeGlobals.module = 5] = "module", RuntimeGlobals[RuntimeGlobals.moduleId = 6] = "moduleId", RuntimeGlobals[RuntimeGlobals.moduleLoaded = 7] = "moduleLoaded", RuntimeGlobals[RuntimeGlobals.publicPath = 8] = "publicPath", RuntimeGlobals[RuntimeGlobals.entryModuleId = 9] = "entryModuleId", RuntimeGlobals[RuntimeGlobals.moduleCache = 10] = "moduleCache", RuntimeGlobals[RuntimeGlobals.moduleFactories = 11] = "moduleFactories", RuntimeGlobals[RuntimeGlobals.moduleFactoriesAddOnly = 12] = "moduleFactoriesAddOnly", RuntimeGlobals[RuntimeGlobals.ensureChunk = 13] = "ensureChunk", RuntimeGlobals[RuntimeGlobals.ensureChunkHandlers = 14] = "ensureChunkHandlers", RuntimeGlobals[RuntimeGlobals.ensureChunkIncludeEntries = 15] = "ensureChunkIncludeEntries", RuntimeGlobals[RuntimeGlobals.prefetchChunk = 16] = "prefetchChunk", RuntimeGlobals[RuntimeGlobals.prefetchChunkHandlers = 17] = "prefetchChunkHandlers", RuntimeGlobals[RuntimeGlobals.preloadChunk = 18] = "preloadChunk", RuntimeGlobals[RuntimeGlobals.preloadChunkHandlers = 19] = "preloadChunkHandlers", RuntimeGlobals[RuntimeGlobals.definePropertyGetters = 20] = "definePropertyGetters", RuntimeGlobals[RuntimeGlobals.makeNamespaceObject = 21] = "makeNamespaceObject", RuntimeGlobals[RuntimeGlobals.createFakeNamespaceObject = 22] = "createFakeNamespaceObject", RuntimeGlobals[RuntimeGlobals.compatGetDefaultExport = 23] = "compatGetDefaultExport", RuntimeGlobals[RuntimeGlobals.harmonyModuleDecorator = 24] = "harmonyModuleDecorator", RuntimeGlobals[RuntimeGlobals.nodeModuleDecorator = 25] = "nodeModuleDecorator", RuntimeGlobals[RuntimeGlobals.getFullHash = 26] = "getFullHash", RuntimeGlobals[RuntimeGlobals.wasmInstances = 27] = "wasmInstances", RuntimeGlobals[RuntimeGlobals.instantiateWasm = 28] = "instantiateWasm", RuntimeGlobals[RuntimeGlobals.compileWasm = 29] = "compileWasm", RuntimeGlobals[RuntimeGlobals.uncaughtErrorHandler = 30] = "uncaughtErrorHandler", RuntimeGlobals[RuntimeGlobals.scriptNonce = 31] = "scriptNonce", RuntimeGlobals[RuntimeGlobals.loadScript = 32] = "loadScript", RuntimeGlobals[RuntimeGlobals.createScript = 33] = "createScript", RuntimeGlobals[RuntimeGlobals.createScriptUrl = 34] = "createScriptUrl", RuntimeGlobals[RuntimeGlobals.getTrustedTypesPolicy = 35] = "getTrustedTypesPolicy", RuntimeGlobals[RuntimeGlobals.hasFetchPriority = 36] = "hasFetchPriority", RuntimeGlobals[RuntimeGlobals.chunkName = 37] = "chunkName", RuntimeGlobals[RuntimeGlobals.runtimeId = 38] = "runtimeId", RuntimeGlobals[RuntimeGlobals.getChunkScriptFilename = 39] = "getChunkScriptFilename", RuntimeGlobals[RuntimeGlobals.getChunkCssFilename = 40] = "getChunkCssFilename", RuntimeGlobals[RuntimeGlobals.rspackVersion = 41] = "rspackVersion", RuntimeGlobals[RuntimeGlobals.hasCssModules = 42] = "hasCssModules", RuntimeGlobals[RuntimeGlobals.rspackUniqueId = 43] = "rspackUniqueId", RuntimeGlobals[RuntimeGlobals.getChunkUpdateScriptFilename = 44] = "getChunkUpdateScriptFilename", RuntimeGlobals[RuntimeGlobals.getChunkUpdateCssFilename = 45] = "getChunkUpdateCssFilename", RuntimeGlobals[RuntimeGlobals.startup = 46] = "startup", RuntimeGlobals[RuntimeGlobals.startupNoDefault = 47] = "startupNoDefault", RuntimeGlobals[RuntimeGlobals.startupOnlyAfter = 48] = "startupOnlyAfter", RuntimeGlobals[RuntimeGlobals.startupOnlyBefore = 49] = "startupOnlyBefore", RuntimeGlobals[RuntimeGlobals.chunkCallback = 50] = "chunkCallback", RuntimeGlobals[RuntimeGlobals.startupEntrypoint = 51] = "startupEntrypoint", RuntimeGlobals[RuntimeGlobals.startupChunkDependencies = 52] = "startupChunkDependencies", RuntimeGlobals[RuntimeGlobals.onChunksLoaded = 53] = "onChunksLoaded", RuntimeGlobals[RuntimeGlobals.externalInstallChunk = 54] = "externalInstallChunk", RuntimeGlobals[RuntimeGlobals.interceptModuleExecution = 55] = "interceptModuleExecution", RuntimeGlobals[RuntimeGlobals.global = 56] = "global", RuntimeGlobals[RuntimeGlobals.shareScopeMap = 57] = "shareScopeMap", RuntimeGlobals[RuntimeGlobals.initializeSharing = 58] = "initializeSharing", RuntimeGlobals[RuntimeGlobals.currentRemoteGetScope = 59] = "currentRemoteGetScope", RuntimeGlobals[RuntimeGlobals.getUpdateManifestFilename = 60] = "getUpdateManifestFilename", RuntimeGlobals[RuntimeGlobals.hmrDownloadManifest = 61] = "hmrDownloadManifest", RuntimeGlobals[RuntimeGlobals.hmrDownloadUpdateHandlers = 62] = "hmrDownloadUpdateHandlers", RuntimeGlobals[RuntimeGlobals.hmrModuleData = 63] = "hmrModuleData", RuntimeGlobals[RuntimeGlobals.hmrInvalidateModuleHandlers = 64] = "hmrInvalidateModuleHandlers", RuntimeGlobals[RuntimeGlobals.hmrRuntimeStatePrefix = 65] = "hmrRuntimeStatePrefix", RuntimeGlobals[RuntimeGlobals.amdDefine = 66] = "amdDefine", RuntimeGlobals[RuntimeGlobals.amdOptions = 67] = "amdOptions", RuntimeGlobals[RuntimeGlobals.system = 68] = "system", RuntimeGlobals[RuntimeGlobals.hasOwnProperty = 69] = "hasOwnProperty", RuntimeGlobals[RuntimeGlobals.systemContext = 70] = "systemContext", RuntimeGlobals[RuntimeGlobals.baseURI = 71] = "baseURI", RuntimeGlobals[RuntimeGlobals.relativeUrl = 72] = "relativeUrl", RuntimeGlobals[RuntimeGlobals.asyncModule = 73] = "asyncModule", RuntimeGlobals[RuntimeGlobals.asyncModuleExportSymbol = 74] = "asyncModuleExportSymbol", RuntimeGlobals[RuntimeGlobals.makeDeferredNamespaceObject = 75] = "makeDeferredNamespaceObject", RuntimeGlobals[RuntimeGlobals.makeDeferredNamespaceObjectSymbol = 76] = "makeDeferredNamespaceObjectSymbol", RuntimeGlobals);
|
|
8847
|
+
var RuntimeGlobals_RuntimeGlobals = ((RuntimeGlobals = RuntimeGlobals_RuntimeGlobals || {})[RuntimeGlobals.require = 0] = "require", RuntimeGlobals[RuntimeGlobals.requireScope = 1] = "requireScope", RuntimeGlobals[RuntimeGlobals.exports = 2] = "exports", RuntimeGlobals[RuntimeGlobals.thisAsExports = 3] = "thisAsExports", RuntimeGlobals[RuntimeGlobals.returnExportsFromRuntime = 4] = "returnExportsFromRuntime", RuntimeGlobals[RuntimeGlobals.module = 5] = "module", RuntimeGlobals[RuntimeGlobals.moduleId = 6] = "moduleId", RuntimeGlobals[RuntimeGlobals.moduleLoaded = 7] = "moduleLoaded", RuntimeGlobals[RuntimeGlobals.publicPath = 8] = "publicPath", RuntimeGlobals[RuntimeGlobals.entryModuleId = 9] = "entryModuleId", RuntimeGlobals[RuntimeGlobals.moduleCache = 10] = "moduleCache", RuntimeGlobals[RuntimeGlobals.moduleFactories = 11] = "moduleFactories", RuntimeGlobals[RuntimeGlobals.moduleFactoriesAddOnly = 12] = "moduleFactoriesAddOnly", RuntimeGlobals[RuntimeGlobals.ensureChunk = 13] = "ensureChunk", RuntimeGlobals[RuntimeGlobals.ensureChunkHandlers = 14] = "ensureChunkHandlers", RuntimeGlobals[RuntimeGlobals.ensureChunkIncludeEntries = 15] = "ensureChunkIncludeEntries", RuntimeGlobals[RuntimeGlobals.prefetchChunk = 16] = "prefetchChunk", RuntimeGlobals[RuntimeGlobals.prefetchChunkHandlers = 17] = "prefetchChunkHandlers", RuntimeGlobals[RuntimeGlobals.preloadChunk = 18] = "preloadChunk", RuntimeGlobals[RuntimeGlobals.preloadChunkHandlers = 19] = "preloadChunkHandlers", RuntimeGlobals[RuntimeGlobals.definePropertyGetters = 20] = "definePropertyGetters", RuntimeGlobals[RuntimeGlobals.makeNamespaceObject = 21] = "makeNamespaceObject", RuntimeGlobals[RuntimeGlobals.createFakeNamespaceObject = 22] = "createFakeNamespaceObject", RuntimeGlobals[RuntimeGlobals.compatGetDefaultExport = 23] = "compatGetDefaultExport", RuntimeGlobals[RuntimeGlobals.harmonyModuleDecorator = 24] = "harmonyModuleDecorator", RuntimeGlobals[RuntimeGlobals.nodeModuleDecorator = 25] = "nodeModuleDecorator", RuntimeGlobals[RuntimeGlobals.getFullHash = 26] = "getFullHash", RuntimeGlobals[RuntimeGlobals.wasmInstances = 27] = "wasmInstances", RuntimeGlobals[RuntimeGlobals.instantiateWasm = 28] = "instantiateWasm", RuntimeGlobals[RuntimeGlobals.compileWasm = 29] = "compileWasm", RuntimeGlobals[RuntimeGlobals.uncaughtErrorHandler = 30] = "uncaughtErrorHandler", RuntimeGlobals[RuntimeGlobals.scriptNonce = 31] = "scriptNonce", RuntimeGlobals[RuntimeGlobals.loadScript = 32] = "loadScript", RuntimeGlobals[RuntimeGlobals.createScript = 33] = "createScript", RuntimeGlobals[RuntimeGlobals.createScriptUrl = 34] = "createScriptUrl", RuntimeGlobals[RuntimeGlobals.getTrustedTypesPolicy = 35] = "getTrustedTypesPolicy", RuntimeGlobals[RuntimeGlobals.hasFetchPriority = 36] = "hasFetchPriority", RuntimeGlobals[RuntimeGlobals.chunkName = 37] = "chunkName", RuntimeGlobals[RuntimeGlobals.runtimeId = 38] = "runtimeId", RuntimeGlobals[RuntimeGlobals.getChunkScriptFilename = 39] = "getChunkScriptFilename", RuntimeGlobals[RuntimeGlobals.getChunkCssFilename = 40] = "getChunkCssFilename", RuntimeGlobals[RuntimeGlobals.rspackVersion = 41] = "rspackVersion", RuntimeGlobals[RuntimeGlobals.hasCssModules = 42] = "hasCssModules", RuntimeGlobals[RuntimeGlobals.rspackUniqueId = 43] = "rspackUniqueId", RuntimeGlobals[RuntimeGlobals.getChunkUpdateScriptFilename = 44] = "getChunkUpdateScriptFilename", RuntimeGlobals[RuntimeGlobals.getChunkUpdateCssFilename = 45] = "getChunkUpdateCssFilename", RuntimeGlobals[RuntimeGlobals.startup = 46] = "startup", RuntimeGlobals[RuntimeGlobals.startupNoDefault = 47] = "startupNoDefault", RuntimeGlobals[RuntimeGlobals.startupOnlyAfter = 48] = "startupOnlyAfter", RuntimeGlobals[RuntimeGlobals.startupOnlyBefore = 49] = "startupOnlyBefore", RuntimeGlobals[RuntimeGlobals.chunkCallback = 50] = "chunkCallback", RuntimeGlobals[RuntimeGlobals.startupEntrypoint = 51] = "startupEntrypoint", RuntimeGlobals[RuntimeGlobals.startupChunkDependencies = 52] = "startupChunkDependencies", RuntimeGlobals[RuntimeGlobals.onChunksLoaded = 53] = "onChunksLoaded", RuntimeGlobals[RuntimeGlobals.externalInstallChunk = 54] = "externalInstallChunk", RuntimeGlobals[RuntimeGlobals.interceptModuleExecution = 55] = "interceptModuleExecution", RuntimeGlobals[RuntimeGlobals.global = 56] = "global", RuntimeGlobals[RuntimeGlobals.shareScopeMap = 57] = "shareScopeMap", RuntimeGlobals[RuntimeGlobals.initializeSharing = 58] = "initializeSharing", RuntimeGlobals[RuntimeGlobals.currentRemoteGetScope = 59] = "currentRemoteGetScope", RuntimeGlobals[RuntimeGlobals.getUpdateManifestFilename = 60] = "getUpdateManifestFilename", RuntimeGlobals[RuntimeGlobals.hmrDownloadManifest = 61] = "hmrDownloadManifest", RuntimeGlobals[RuntimeGlobals.hmrDownloadUpdateHandlers = 62] = "hmrDownloadUpdateHandlers", RuntimeGlobals[RuntimeGlobals.hmrModuleData = 63] = "hmrModuleData", RuntimeGlobals[RuntimeGlobals.hmrInvalidateModuleHandlers = 64] = "hmrInvalidateModuleHandlers", RuntimeGlobals[RuntimeGlobals.hmrRuntimeStatePrefix = 65] = "hmrRuntimeStatePrefix", RuntimeGlobals[RuntimeGlobals.amdDefine = 66] = "amdDefine", RuntimeGlobals[RuntimeGlobals.amdOptions = 67] = "amdOptions", RuntimeGlobals[RuntimeGlobals.system = 68] = "system", RuntimeGlobals[RuntimeGlobals.hasOwnProperty = 69] = "hasOwnProperty", RuntimeGlobals[RuntimeGlobals.systemContext = 70] = "systemContext", RuntimeGlobals[RuntimeGlobals.baseURI = 71] = "baseURI", RuntimeGlobals[RuntimeGlobals.relativeUrl = 72] = "relativeUrl", RuntimeGlobals[RuntimeGlobals.asyncModule = 73] = "asyncModule", RuntimeGlobals[RuntimeGlobals.asyncModuleExportSymbol = 74] = "asyncModuleExportSymbol", RuntimeGlobals[RuntimeGlobals.makeDeferredNamespaceObject = 75] = "makeDeferredNamespaceObject", RuntimeGlobals[RuntimeGlobals.makeDeferredNamespaceObjectSymbol = 76] = "makeDeferredNamespaceObjectSymbol", RuntimeGlobals[RuntimeGlobals.deferredModuleExports = 77] = "deferredModuleExports", RuntimeGlobals);
|
|
8033
8848
|
function renderRuntimeVariables(variable, compilerOptions) {
|
|
8034
8849
|
if (compilerOptions?.experiments.runtimeMode === 'rspack') switch(variable){
|
|
8035
8850
|
case 0:
|
|
@@ -8091,6 +8906,8 @@ function createCompilerRuntimeGlobals(compilerOptions) {
|
|
|
8091
8906
|
return `${scope_name}.s`;
|
|
8092
8907
|
case 10:
|
|
8093
8908
|
return `${scope_name}.c`;
|
|
8909
|
+
case 77:
|
|
8910
|
+
return `${scope_name}.zD`;
|
|
8094
8911
|
case 11:
|
|
8095
8912
|
return `${scope_name}.m`;
|
|
8096
8913
|
case 12:
|
|
@@ -8234,7 +9051,7 @@ class ExecuteModulePlugin {
|
|
|
8234
9051
|
apply(compiler) {
|
|
8235
9052
|
compiler.hooks.thisCompilation.tap('executeModule', (compilation)=>{
|
|
8236
9053
|
compiler.__internal__get_module_execution_results_map().clear(), compilation.hooks.executeModule.tap('executeModule', (options, context)=>{
|
|
8237
|
-
let vm =
|
|
9054
|
+
let vm = rspackRequire("node:vm"), moduleObject = options.moduleObject, source = options.codeGenerationResult.get("javascript");
|
|
8238
9055
|
if (void 0 !== source) try {
|
|
8239
9056
|
let isRspackRuntimeMode = compiler.options.experiments?.runtimeMode === 'rspack', moduleArgument = renderRuntimeVariables(4, compiler.options), exportsArgument = renderRuntimeVariables(5, compiler.options), requireArgument = renderRuntimeVariables(0, compiler.options), runtimeContextArgument = renderRuntimeVariables(1, compiler.options), runtimeContext = context[runtimeContextArgument], runtimeModeArguments = isRspackRuntimeMode ? `, ${runtimeContextArgument}` : '';
|
|
8240
9057
|
vm.runInThisContext(`(function(module, ${moduleArgument}, ${exportsArgument}, exports, ${requireArgument}${runtimeModeArguments}) {\n${source}\n})`, {
|
|
@@ -8297,6 +9114,7 @@ let fs_join = (fs, rootPath, filename)=>{
|
|
|
8297
9114
|
readFile: ASYNC_NOOP,
|
|
8298
9115
|
stat: ASYNC_NOOP,
|
|
8299
9116
|
lstat: ASYNC_NOOP,
|
|
9117
|
+
readlink: ASYNC_NOOP,
|
|
8300
9118
|
chmod: ASYNC_NOOP,
|
|
8301
9119
|
realpath: ASYNC_NOOP,
|
|
8302
9120
|
open: ASYNC_NOOP,
|
|
@@ -8334,6 +9152,7 @@ class ThreadsafeInputNodeFS {
|
|
|
8334
9152
|
readFile;
|
|
8335
9153
|
stat;
|
|
8336
9154
|
lstat;
|
|
9155
|
+
readlink;
|
|
8337
9156
|
chmod;
|
|
8338
9157
|
realpath;
|
|
8339
9158
|
open;
|
|
@@ -8359,7 +9178,7 @@ class ThreadsafeInputNodeFS {
|
|
|
8359
9178
|
if (err) return reject(err);
|
|
8360
9179
|
resolve(stats && __to_binding_stat(stats));
|
|
8361
9180
|
});
|
|
8362
|
-
})), this.realpath = memoizeFn(()=>(name)=>new Promise((resolve, reject)=>{
|
|
9181
|
+
})), this.readlink = memoizeFn(()=>node_util.promisify(fs.readlink.bind(fs))), this.realpath = memoizeFn(()=>(name)=>new Promise((resolve, reject)=>{
|
|
8363
9182
|
fs.realpath ? fs.realpath(name, (err, path)=>{
|
|
8364
9183
|
if (err) return reject(err);
|
|
8365
9184
|
resolve(path);
|
|
@@ -8383,6 +9202,7 @@ class ThreadsafeOutputNodeFS {
|
|
|
8383
9202
|
readFile;
|
|
8384
9203
|
stat;
|
|
8385
9204
|
lstat;
|
|
9205
|
+
readlink;
|
|
8386
9206
|
chmod;
|
|
8387
9207
|
realpath;
|
|
8388
9208
|
open;
|
|
@@ -8496,6 +9316,7 @@ class Cache {
|
|
|
8496
9316
|
static STAGE_MEMORY = -10;
|
|
8497
9317
|
static STAGE_DEFAULT = 0;
|
|
8498
9318
|
static STAGE_NETWORK = 20;
|
|
9319
|
+
#binding;
|
|
8499
9320
|
hooks;
|
|
8500
9321
|
constructor(){
|
|
8501
9322
|
this.hooks = {
|
|
@@ -8516,6 +9337,11 @@ class Cache {
|
|
|
8516
9337
|
endIdle: new AsyncParallelHook([]),
|
|
8517
9338
|
shutdown: new AsyncParallelHook([])
|
|
8518
9339
|
};
|
|
9340
|
+
let { JsCache } = rspackRequire("@ohos-ports/rspack-binding");
|
|
9341
|
+
this.#binding = new JsCache();
|
|
9342
|
+
}
|
|
9343
|
+
static __to_binding(cache) {
|
|
9344
|
+
return cache.#binding;
|
|
8519
9345
|
}
|
|
8520
9346
|
get(identifier, etag, callback) {
|
|
8521
9347
|
let gotHandlers = [];
|
|
@@ -8536,13 +9362,15 @@ class Cache {
|
|
|
8536
9362
|
this.hooks.storeBuildDependencies.callAsync(dependencies, makeWebpackErrorCallback(callback, 'Cache.hooks.storeBuildDependencies'));
|
|
8537
9363
|
}
|
|
8538
9364
|
beginIdle() {
|
|
8539
|
-
this.hooks.beginIdle.call();
|
|
9365
|
+
this.hooks.beginIdle.call(), this.#binding.beginIdle();
|
|
8540
9366
|
}
|
|
8541
9367
|
endIdle(callback) {
|
|
8542
|
-
this.hooks.endIdle.callAsync(makeWebpackErrorCallback(callback, 'Cache.hooks.endIdle'));
|
|
9368
|
+
this.#binding.endIdle(), this.hooks.endIdle.callAsync(makeWebpackErrorCallback(callback, 'Cache.hooks.endIdle'));
|
|
8543
9369
|
}
|
|
8544
9370
|
shutdown(callback) {
|
|
8545
|
-
this.
|
|
9371
|
+
this.#binding.shutdown().then(()=>{
|
|
9372
|
+
this.hooks.shutdown.callAsync(makeWebpackErrorCallback(callback, 'Cache.hooks.shutdown'));
|
|
9373
|
+
});
|
|
8546
9374
|
}
|
|
8547
9375
|
}
|
|
8548
9376
|
class LazyHashedEtag {
|
|
@@ -8686,59 +9514,29 @@ let lib_CacheFacade = class CacheFacade {
|
|
|
8686
9514
|
store(identifier, etag, data, callback) {
|
|
8687
9515
|
this._cache.store(`${this._name}|${identifier}`, etag, data, callback);
|
|
8688
9516
|
}
|
|
8689
|
-
storePromise(identifier, etag, data) {
|
|
8690
|
-
return new Promise((resolve, reject)=>{
|
|
8691
|
-
this._cache.store(`${this._name}|${identifier}`, etag, data, (err)=>{
|
|
8692
|
-
err ? reject(err) : resolve();
|
|
8693
|
-
});
|
|
8694
|
-
});
|
|
8695
|
-
}
|
|
8696
|
-
provide(identifier, etag, computer, callback) {
|
|
8697
|
-
this.get(identifier, etag, (err, cacheEntry)=>err ? callback(err) : void 0 !== cacheEntry ? cacheEntry : void computer((err, result)=>{
|
|
8698
|
-
if (err) return callback(err);
|
|
8699
|
-
this.store(identifier, etag, result, (err)=>{
|
|
8700
|
-
if (err) return callback(err);
|
|
8701
|
-
callback(null, result);
|
|
8702
|
-
});
|
|
8703
|
-
}));
|
|
8704
|
-
}
|
|
8705
|
-
async providePromise(identifier, etag, computer) {
|
|
8706
|
-
let cacheEntry = await this.getPromise(identifier, etag);
|
|
8707
|
-
if (void 0 !== cacheEntry) return cacheEntry;
|
|
8708
|
-
let result = await computer();
|
|
8709
|
-
return await this.storePromise(identifier, etag, result), result;
|
|
8710
|
-
}
|
|
8711
|
-
};
|
|
8712
|
-
class NormalModuleFactory {
|
|
8713
|
-
hooks;
|
|
8714
|
-
resolverFactory;
|
|
8715
|
-
constructor(resolverFactory){
|
|
8716
|
-
this.hooks = {
|
|
8717
|
-
resolveForScheme: new HookMap(()=>new AsyncSeriesBailHook([
|
|
8718
|
-
'resourceData'
|
|
8719
|
-
])),
|
|
8720
|
-
beforeResolve: new AsyncSeriesBailHook([
|
|
8721
|
-
'resolveData'
|
|
8722
|
-
]),
|
|
8723
|
-
factorize: new AsyncSeriesBailHook([
|
|
8724
|
-
'resolveData'
|
|
8725
|
-
]),
|
|
8726
|
-
resolve: new AsyncSeriesBailHook([
|
|
8727
|
-
'resolveData'
|
|
8728
|
-
]),
|
|
8729
|
-
afterResolve: new AsyncSeriesBailHook([
|
|
8730
|
-
'resolveData'
|
|
8731
|
-
]),
|
|
8732
|
-
createModule: new AsyncSeriesBailHook([
|
|
8733
|
-
'createData',
|
|
8734
|
-
'resolveData'
|
|
8735
|
-
])
|
|
8736
|
-
}, this.resolverFactory = resolverFactory;
|
|
9517
|
+
storePromise(identifier, etag, data) {
|
|
9518
|
+
return new Promise((resolve, reject)=>{
|
|
9519
|
+
this._cache.store(`${this._name}|${identifier}`, etag, data, (err)=>{
|
|
9520
|
+
err ? reject(err) : resolve();
|
|
9521
|
+
});
|
|
9522
|
+
});
|
|
8737
9523
|
}
|
|
8738
|
-
|
|
8739
|
-
|
|
9524
|
+
provide(identifier, etag, computer, callback) {
|
|
9525
|
+
this.get(identifier, etag, (err, cacheEntry)=>err ? callback(err) : void 0 !== cacheEntry ? cacheEntry : void computer((err, result)=>{
|
|
9526
|
+
if (err) return callback(err);
|
|
9527
|
+
this.store(identifier, etag, result, (err)=>{
|
|
9528
|
+
if (err) return callback(err);
|
|
9529
|
+
callback(null, result);
|
|
9530
|
+
});
|
|
9531
|
+
}));
|
|
8740
9532
|
}
|
|
8741
|
-
|
|
9533
|
+
async providePromise(identifier, etag, computer) {
|
|
9534
|
+
let cacheEntry = await this.getPromise(identifier, etag);
|
|
9535
|
+
if (void 0 !== cacheEntry) return cacheEntry;
|
|
9536
|
+
let result = await computer();
|
|
9537
|
+
return await this.storePromise(identifier, etag, result), result;
|
|
9538
|
+
}
|
|
9539
|
+
};
|
|
8742
9540
|
class Resolver {
|
|
8743
9541
|
#binding;
|
|
8744
9542
|
constructor(binding){
|
|
@@ -8759,7 +9557,9 @@ class Resolver {
|
|
|
8759
9557
|
});
|
|
8760
9558
|
}
|
|
8761
9559
|
}
|
|
8762
|
-
let EMPTY_RESOLVE_OPTIONS = {}
|
|
9560
|
+
let EMPTY_RESOLVE_OPTIONS = {}, keepRegExpInCacheKey = (_key, value)=>value instanceof RegExp ? {
|
|
9561
|
+
regexp: String(value)
|
|
9562
|
+
} : value;
|
|
8763
9563
|
class ResolverFactory {
|
|
8764
9564
|
#binding;
|
|
8765
9565
|
#cache = new Map();
|
|
@@ -8790,7 +9590,7 @@ class ResolverFactory {
|
|
|
8790
9590
|
}, this.#cache.set(type, typedCaches));
|
|
8791
9591
|
let cachedResolver = typedCaches.direct.get(resolveOptions);
|
|
8792
9592
|
if (cachedResolver) return cachedResolver;
|
|
8793
|
-
let ident = JSON.stringify(resolveOptions), resolver = typedCaches.stringified.get(ident);
|
|
9593
|
+
let ident = JSON.stringify(resolveOptions, keepRegExpInCacheKey), resolver = typedCaches.stringified.get(ident);
|
|
8794
9594
|
if (resolver) return typedCaches.direct.set(resolveOptions, resolver), resolver;
|
|
8795
9595
|
let newResolver = this.#create(type, resolveOptions);
|
|
8796
9596
|
return typedCaches.direct.set(resolveOptions, newResolver), typedCaches.stringified.set(ident, newResolver), newResolver;
|
|
@@ -8847,7 +9647,7 @@ class MultiStats {
|
|
|
8847
9647
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8848
9648
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8849
9649
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8850
|
-
}), childOptions.version && (obj.rspackVersion = "2.
|
|
9650
|
+
}), childOptions.version && (obj.rspackVersion = "2.3.2", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
|
|
8851
9651
|
let mapError = (j, obj)=>({
|
|
8852
9652
|
...obj,
|
|
8853
9653
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -8982,7 +9782,7 @@ class MultiCompiler {
|
|
|
8982
9782
|
watching;
|
|
8983
9783
|
constructor(compilers, options){
|
|
8984
9784
|
let normalizedCompilers;
|
|
8985
|
-
normalizedCompilers = Array.isArray(compilers) ? compilers : Object.entries(compilers).map(([name, compiler])=>(compiler.name = name, compiler)), this.hooks = {
|
|
9785
|
+
normalizedCompilers = Array.isArray(compilers) ? compilers : Object.entries(compilers).map(([name, compiler])=>(compiler.name = name, compiler.compilerPath = name, compiler)), this.hooks = {
|
|
8986
9786
|
done: new SyncHook([
|
|
8987
9787
|
'stats'
|
|
8988
9788
|
]),
|
|
@@ -9001,9 +9801,14 @@ class MultiCompiler {
|
|
|
9001
9801
|
let compiler = this.compilers[index], compilerIndex = index, compilerDone = !1;
|
|
9002
9802
|
compiler.hooks.done.tap('MultiCompiler', (stats)=>{
|
|
9003
9803
|
!compilerDone && (compilerDone = !0, doneCompilers++), compilerStats[compilerIndex] = stats, doneCompilers === this.compilers.length && this.hooks.done.call(new MultiStats(compilerStats));
|
|
9004
|
-
}), compiler.hooks.invalid.tap('MultiCompiler', ()=>{
|
|
9005
|
-
compilerDone && (compilerDone = !1, doneCompilers--);
|
|
9006
9804
|
});
|
|
9805
|
+
let resetDoneState = ()=>{
|
|
9806
|
+
compilerDone && (compilerDone = !1, doneCompilers--);
|
|
9807
|
+
};
|
|
9808
|
+
compiler.hooks.invalid.tap('MultiCompiler', resetDoneState), compiler.hooks.watchRun.tap({
|
|
9809
|
+
name: 'MultiCompiler',
|
|
9810
|
+
stage: -1 / 0
|
|
9811
|
+
}, resetDoneState);
|
|
9007
9812
|
}
|
|
9008
9813
|
}
|
|
9009
9814
|
set unsafeFastDrop(value) {
|
|
@@ -9176,17 +9981,37 @@ let filterToFunction = (item)=>{
|
|
|
9176
9981
|
log: 2,
|
|
9177
9982
|
true: 2,
|
|
9178
9983
|
verbose: 1
|
|
9179
|
-
}
|
|
9984
|
+
}, internalCallbacks = new WeakSet(), consumeWatcherInfo = Symbol('consumeWatcherInfo'), EXISTENCE_ONLY_TIME_ENTRY = Object.freeze({}), memoizeTimeInfoEntries = (snapshot, key)=>memoize(()=>(({ entries: rows, missing })=>{
|
|
9985
|
+
let entries = new Map();
|
|
9986
|
+
for (let row of rows)if (row.existenceOnly) entries.set(row.path, EXISTENCE_ONLY_TIME_ENTRY);
|
|
9987
|
+
else {
|
|
9988
|
+
let entry = {
|
|
9989
|
+
safeTime: row.safeTime
|
|
9990
|
+
};
|
|
9991
|
+
null != row.timestamp && (entry.timestamp = row.timestamp), null != row.accuracy && (entry.accuracy = row.accuracy), entries.set(row.path, entry);
|
|
9992
|
+
}
|
|
9993
|
+
for (let path of missing)entries.set(path, null);
|
|
9994
|
+
return entries;
|
|
9995
|
+
})(snapshot[key]));
|
|
9180
9996
|
class NativeWatcherShim extends EventEmitter {
|
|
9181
|
-
#
|
|
9182
|
-
constructor(
|
|
9183
|
-
super(), this.#
|
|
9997
|
+
#fileSystem;
|
|
9998
|
+
constructor(fileSystem){
|
|
9999
|
+
super(), this.#fileSystem = fileSystem;
|
|
9184
10000
|
}
|
|
9185
10001
|
_onChange(item, _mtime, file, _type) {
|
|
9186
|
-
this.#
|
|
10002
|
+
this.#fileSystem.triggerEvent('change', file ?? item);
|
|
9187
10003
|
}
|
|
9188
10004
|
_onRemove(item, file, _type) {
|
|
9189
|
-
this.#
|
|
10005
|
+
this.#fileSystem.triggerEvent('remove', file ?? item);
|
|
10006
|
+
}
|
|
10007
|
+
getTimes() {
|
|
10008
|
+
return this.#fileSystem.getTimes();
|
|
10009
|
+
}
|
|
10010
|
+
getTimeInfoEntries() {
|
|
10011
|
+
return this.#fileSystem.getTimeInfoEntries();
|
|
10012
|
+
}
|
|
10013
|
+
collectTimeInfoEntries(fileTimestamps, directoryTimestamps) {
|
|
10014
|
+
this.#fileSystem.collectTimeInfoEntries(fileTimestamps, directoryTimestamps);
|
|
9190
10015
|
}
|
|
9191
10016
|
}
|
|
9192
10017
|
class NativeWatchFileSystem {
|
|
@@ -9207,8 +10032,8 @@ class NativeWatchFileSystem {
|
|
|
9207
10032
|
if ('function' != typeof callback) throw Error("Invalid arguments: 'callback'");
|
|
9208
10033
|
if ('object' != typeof options) throw Error("Invalid arguments: 'options'");
|
|
9209
10034
|
if ('function' != typeof callbackUndelayed && callbackUndelayed) throw Error("Invalid arguments: 'callbackUndelayed'");
|
|
9210
|
-
let nativeWatcher = this.getNativeWatcher(options), watcher = new NativeWatcherShim(
|
|
9211
|
-
|
|
10035
|
+
let nativeWatcher = this.getNativeWatcher(options), watcher = new NativeWatcherShim(this);
|
|
10036
|
+
this.#watcher = watcher, nativeWatcher.watch(this.formatWatchDependencies(files), this.formatWatchDependencies(directories), this.formatWatchDependencies(missing), BigInt(startTime), (err, result)=>{
|
|
9212
10037
|
if (err) return void callback(err, new Map(), new Map(), new Set(), new Set());
|
|
9213
10038
|
nativeWatcher.pause();
|
|
9214
10039
|
let changedFiles = result.changedFiles, removedFiles = result.removedFiles;
|
|
@@ -9218,13 +10043,35 @@ class NativeWatchFileSystem {
|
|
|
9218
10043
|
for (let item of removedFiles)fs.purge?.(item);
|
|
9219
10044
|
}
|
|
9220
10045
|
let changes = new Set(changedFiles), removals = new Set(removedFiles);
|
|
9221
|
-
this.#events.emit('aggregated', changes, removals), watcher.emit('aggregated', changes, removals), callback(
|
|
10046
|
+
if (this.#events.emit('aggregated', changes, removals), watcher.emit('aggregated', changes, removals), internalCallbacks.has(callback)) return void callback(null, void 0, void 0, changes, removals);
|
|
10047
|
+
let { fileTimeInfoEntries, contextTimeInfoEntries } = this.#fetchTimeInfo(nativeWatcher);
|
|
10048
|
+
callback(err, fileTimeInfoEntries, contextTimeInfoEntries, changes, removals);
|
|
9222
10049
|
}, (event)=>{
|
|
9223
10050
|
if ('change' === event.kind) {
|
|
9224
|
-
let
|
|
9225
|
-
callbackUndelayed(event.path,
|
|
9226
|
-
} else this.#events.emit('remove', event.path), watcher.emit('remove', event.path);
|
|
9227
|
-
}), this.#isFirstWatch = !1
|
|
10051
|
+
let changeTime = Date.now(), mtime = null === event.mtime ? null : changeTime;
|
|
10052
|
+
callbackUndelayed(event.path, changeTime), this.#events.emit('change', event.path, mtime), watcher.emit('change', event.path, mtime);
|
|
10053
|
+
} else callbackUndelayed(event.path, Date.now()), this.#events.emit('remove', event.path), watcher.emit('remove', event.path);
|
|
10054
|
+
}), this.#isFirstWatch = !1;
|
|
10055
|
+
let info = ({ changedFiles, removedFiles })=>{
|
|
10056
|
+
let changes = new Set(changedFiles), removals = new Set(removedFiles);
|
|
10057
|
+
if (this.#inputFileSystem?.purge) {
|
|
10058
|
+
let fs = this.#inputFileSystem;
|
|
10059
|
+
for (let item of removals)fs.purge?.(item);
|
|
10060
|
+
for (let item of changes)fs.purge?.(item);
|
|
10061
|
+
}
|
|
10062
|
+
let timeInfo = this.#fetchTimeInfo(nativeWatcher);
|
|
10063
|
+
return {
|
|
10064
|
+
changes,
|
|
10065
|
+
removals,
|
|
10066
|
+
get fileTimeInfoEntries () {
|
|
10067
|
+
return timeInfo.fileTimeInfoEntries;
|
|
10068
|
+
},
|
|
10069
|
+
get contextTimeInfoEntries () {
|
|
10070
|
+
return timeInfo.contextTimeInfoEntries;
|
|
10071
|
+
}
|
|
10072
|
+
};
|
|
10073
|
+
};
|
|
10074
|
+
return {
|
|
9228
10075
|
close: ()=>{
|
|
9229
10076
|
this.#inner === nativeWatcher && (this.#inner = void 0, this.#isFirstWatch = !0), nativeWatcher.close().catch((err)=>{
|
|
9230
10077
|
console.error('Error closing native watcher:', err);
|
|
@@ -9233,14 +10080,41 @@ class NativeWatchFileSystem {
|
|
|
9233
10080
|
pause: ()=>{
|
|
9234
10081
|
nativeWatcher.pause();
|
|
9235
10082
|
},
|
|
9236
|
-
getInfo: ()=>(
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
10083
|
+
getInfo: ()=>info(nativeWatcher.peekAggregated()),
|
|
10084
|
+
[consumeWatcherInfo]: ()=>info(nativeWatcher.getAggregated())
|
|
10085
|
+
};
|
|
10086
|
+
}
|
|
10087
|
+
#fetchTimeInfo(nativeWatcher) {
|
|
10088
|
+
let snapshot = nativeWatcher.collectTimeInfoEntries(), files = memoizeTimeInfoEntries(snapshot, 'fileTimestamps'), directories = memoizeTimeInfoEntries(snapshot, 'directoryTimestamps');
|
|
10089
|
+
return {
|
|
10090
|
+
get fileTimeInfoEntries () {
|
|
10091
|
+
return files();
|
|
10092
|
+
},
|
|
10093
|
+
get contextTimeInfoEntries () {
|
|
10094
|
+
return directories();
|
|
10095
|
+
}
|
|
9242
10096
|
};
|
|
9243
10097
|
}
|
|
10098
|
+
getTimes() {
|
|
10099
|
+
let times = Object.create(null);
|
|
10100
|
+
if (!this.#inner) return times;
|
|
10101
|
+
let { fileTimestamps, directoryTimestamps } = this.#inner.collectTimeInfoEntries();
|
|
10102
|
+
for (let row of fileTimestamps.entries)row.existenceOnly || (times[row.path] = Math.max(row.safeTime, row.timestamp ?? row.safeTime));
|
|
10103
|
+
for (let path of fileTimestamps.missing)times[path] = null;
|
|
10104
|
+
for (let row of directoryTimestamps.entries)times[row.path] = row.safeTime ?? null;
|
|
10105
|
+
for (let path of directoryTimestamps.missing)times[path] = null;
|
|
10106
|
+
return times;
|
|
10107
|
+
}
|
|
10108
|
+
getTimeInfoEntries() {
|
|
10109
|
+
let entries = new Map();
|
|
10110
|
+
return this.collectTimeInfoEntries(entries, entries), entries;
|
|
10111
|
+
}
|
|
10112
|
+
collectTimeInfoEntries(fileTimestamps, directoryTimestamps) {
|
|
10113
|
+
if (!this.#inner) return;
|
|
10114
|
+
let { fileTimeInfoEntries, contextTimeInfoEntries } = this.#fetchTimeInfo(this.#inner);
|
|
10115
|
+
for (let [path, entry] of fileTimeInfoEntries)null === entry && fileTimestamps.has(path) || fileTimestamps.set(path, entry);
|
|
10116
|
+
for (let [path, entry] of contextTimeInfoEntries)(null === entry || entry === EXISTENCE_ONLY_TIME_ENTRY) && directoryTimestamps.has(path) || directoryTimestamps.set(path, entry);
|
|
10117
|
+
}
|
|
9244
10118
|
getNativeWatcher(options) {
|
|
9245
10119
|
if (this.#inner) return this.#inner;
|
|
9246
10120
|
let nativeWatcherOptions = {
|
|
@@ -9248,8 +10122,7 @@ class NativeWatchFileSystem {
|
|
|
9248
10122
|
aggregateTimeout: options.aggregateTimeout,
|
|
9249
10123
|
pollInterval: 'boolean' == typeof options.poll ? 0 : options.poll,
|
|
9250
10124
|
ignored: ((ignored)=>{
|
|
9251
|
-
if (Array.isArray(ignored) || 'string' == typeof ignored || ignored instanceof RegExp) return ignored;
|
|
9252
|
-
if ('function' == typeof ignored) throw Error("NativeWatcher does not support using a function for the 'ignored' option");
|
|
10125
|
+
if (Array.isArray(ignored) || 'string' == typeof ignored || ignored instanceof RegExp || 'function' == typeof ignored) return ignored;
|
|
9253
10126
|
})(options.ignored)
|
|
9254
10127
|
}, nativeWatcher = new (binding__default()).NativeWatcher(nativeWatcherOptions);
|
|
9255
10128
|
return this.#inner = nativeWatcher, nativeWatcher;
|
|
@@ -9280,6 +10153,7 @@ class NativeWatchFileSystem {
|
|
|
9280
10153
|
];
|
|
9281
10154
|
}
|
|
9282
10155
|
}
|
|
10156
|
+
let isExistenceOnlyEntry = (entry)=>'object' == typeof entry && null !== entry && !('safeTime' in entry);
|
|
9283
10157
|
class NodeWatchFileSystem {
|
|
9284
10158
|
inputFileSystem;
|
|
9285
10159
|
watcherOptions;
|
|
@@ -9298,7 +10172,7 @@ class NodeWatchFileSystem {
|
|
|
9298
10172
|
if ('number' != typeof startTime && startTime) throw Error("Invalid arguments: 'startTime'");
|
|
9299
10173
|
if ('object' != typeof options) throw Error("Invalid arguments: 'options'");
|
|
9300
10174
|
if ('function' != typeof callbackUndelayed && callbackUndelayed) throw Error("Invalid arguments: 'callbackUndelayed'");
|
|
9301
|
-
let oldWatcher = this.watcher, Watchpack =
|
|
10175
|
+
let oldWatcher = this.watcher, Watchpack = rspackRequire("watchpack");
|
|
9302
10176
|
this.watcher = new Watchpack(options), callbackUndelayed && this.watcher?.once('change', callbackUndelayed), this.watcher?.on('change', (filename, mtime)=>{
|
|
9303
10177
|
this.#events.emit('change', filename, mtime);
|
|
9304
10178
|
}), this.watcher?.on('remove', (filename)=>{
|
|
@@ -9319,6 +10193,7 @@ class NodeWatchFileSystem {
|
|
|
9319
10193
|
for (let item of changes)fs.purge?.(item);
|
|
9320
10194
|
for (let item of removals)fs.purge?.(item);
|
|
9321
10195
|
}
|
|
10196
|
+
if (internalCallbacks.has(callback)) return void callback(null, void 0, void 0, changes, removals);
|
|
9322
10197
|
let { fileTimeInfoEntries, contextTimeInfoEntries } = fetchTimeInfo();
|
|
9323
10198
|
callback(null, fileTimeInfoEntries, contextTimeInfoEntries, changes, removals);
|
|
9324
10199
|
}), this.watcher?.watch({
|
|
@@ -9368,6 +10243,19 @@ class NodeWatchFileSystem {
|
|
|
9368
10243
|
}
|
|
9369
10244
|
};
|
|
9370
10245
|
}
|
|
10246
|
+
getTimes() {
|
|
10247
|
+
return this.watcher?.getTimes() ?? {};
|
|
10248
|
+
}
|
|
10249
|
+
getTimeInfoEntries() {
|
|
10250
|
+
let entries = new Map(), watcher = this.watcher;
|
|
10251
|
+
if (!watcher) return entries;
|
|
10252
|
+
let contextEntries = new Map();
|
|
10253
|
+
for (let [path, entry] of (watcher.collectTimeInfoEntries(entries, contextEntries), contextEntries))(null === entry || isExistenceOnlyEntry(entry)) && entries.has(path) || entries.set(path, entry);
|
|
10254
|
+
return entries;
|
|
10255
|
+
}
|
|
10256
|
+
collectTimeInfoEntries(fileTimestamps, directoryTimestamps) {
|
|
10257
|
+
this.watcher?.collectTimeInfoEntries(fileTimestamps, directoryTimestamps);
|
|
10258
|
+
}
|
|
9371
10259
|
on(event, listener) {
|
|
9372
10260
|
return this.#events.on(event, listener), this;
|
|
9373
10261
|
}
|
|
@@ -9403,8 +10291,8 @@ let arraySum = (array)=>{
|
|
|
9403
10291
|
let str = `${a}`, length = lengths[i];
|
|
9404
10292
|
return str.length === length ? str : length > 5 ? `...${str.slice(-length + 3)}` : length > 0 ? str.slice(-length) : '';
|
|
9405
10293
|
});
|
|
9406
|
-
}
|
|
9407
|
-
var CachedInputFileSystem_default =
|
|
10294
|
+
};
|
|
10295
|
+
var CachedInputFileSystem_default = compatGetDefaultExport(rspackRequire("../../node_modules/.pnpm/enhanced-resolve@5.26.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"));
|
|
9408
10296
|
class NodeEnvironmentPlugin {
|
|
9409
10297
|
options;
|
|
9410
10298
|
constructor(options){
|
|
@@ -10168,8 +11056,12 @@ let iterateConfig = (config, options, fn)=>{
|
|
|
10168
11056
|
hash: (object, compilation, context)=>{
|
|
10169
11057
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
10170
11058
|
},
|
|
11059
|
+
cacheInfo: (object, compilation, context)=>{
|
|
11060
|
+
let { cacheInfo } = context.getStatsCompilation(compilation);
|
|
11061
|
+
cacheInfo && (object.cacheInfo = Object.fromEntries(Object.entries(cacheInfo).sort(([a], [b])=>a.localeCompare(b))));
|
|
11062
|
+
},
|
|
10171
11063
|
version: (object)=>{
|
|
10172
|
-
object.version = "5.75.0", object.rspackVersion = "2.
|
|
11064
|
+
object.version = "5.75.0", object.rspackVersion = "2.3.2";
|
|
10173
11065
|
},
|
|
10174
11066
|
env: (object, _compilation, _context, { _env })=>{
|
|
10175
11067
|
object.env = _env;
|
|
@@ -10570,6 +11462,7 @@ let applyDefaults = (options, defaults)=>{
|
|
|
10570
11462
|
}, NORMAL_ON = ({ all })=>!1 !== all, NORMAL_OFF = ({ all })=>!0 === all, ON_FOR_TO_STRING = ({ all }, { forToString })=>forToString ? !1 !== all : !0 === all, OFF_FOR_TO_STRING = ({ all }, { forToString })=>forToString ? !0 === all : !1 !== all, DEFAULTS = {
|
|
10571
11463
|
performance: NORMAL_ON,
|
|
10572
11464
|
hash: OFF_FOR_TO_STRING,
|
|
11465
|
+
cacheInfo: NORMAL_OFF,
|
|
10573
11466
|
env: NORMAL_OFF,
|
|
10574
11467
|
version: NORMAL_ON,
|
|
10575
11468
|
timings: NORMAL_ON,
|
|
@@ -11416,11 +12309,14 @@ class RspackOptionsApply {
|
|
|
11416
12309
|
if (runtimeChunk && new RuntimeChunkPlugin(runtimeChunk).apply(compiler), options.optimization.emitOnErrors || new NoEmitOnErrorsPlugin().apply(compiler), options.devtool) if (options.devtool.includes('source-map')) {
|
|
11417
12310
|
let hidden = options.devtool.includes('hidden'), inline = options.devtool.includes('inline'), evalWrapped = options.devtool.includes('eval'), cheap = options.devtool.includes('cheap'), moduleMaps = options.devtool.includes('module'), noSources = options.devtool.includes('nosources'), debugIds = options.devtool.includes('debugids');
|
|
11418
12311
|
new (evalWrapped ? EvalSourceMapDevToolPlugin : SourceMapDevToolPlugin)({
|
|
11419
|
-
|
|
12312
|
+
...evalWrapped ? {} : {
|
|
12313
|
+
filename: inline ? null : options.output.sourceMapFilename,
|
|
12314
|
+
fallbackModuleFilenameTemplate: options.output.devtoolFallbackModuleFilenameTemplate,
|
|
12315
|
+
append: !hidden && void 0
|
|
12316
|
+
},
|
|
11420
12317
|
moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
|
|
11421
|
-
fallbackModuleFilenameTemplate: options.output.devtoolFallbackModuleFilenameTemplate,
|
|
11422
|
-
append: !hidden && void 0,
|
|
11423
12318
|
module: !!moduleMaps || !cheap,
|
|
12319
|
+
test: evalWrapped ? void 0 : /\.((c|m)?js|css)($|\?)/i,
|
|
11424
12320
|
columns: !cheap,
|
|
11425
12321
|
noSources: noSources,
|
|
11426
12322
|
namespace: options.output.devtoolNamespace,
|
|
@@ -11430,7 +12326,7 @@ class RspackOptionsApply {
|
|
|
11430
12326
|
moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
|
|
11431
12327
|
namespace: options.output.devtoolNamespace
|
|
11432
12328
|
}).apply(compiler);
|
|
11433
|
-
new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.output.bundlerInfo && new BundlerInfoRspackPlugin(options.output.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin(options.experiments.pureFunctions && !0 === options.optimization.sideEffects).apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), 'production' === options.mode && new CircularModulesInfoPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin('global' === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), options.optimization.inlineExports && new InlineExportsPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin('size' !== options.optimization.mangleExports).apply(compiler);
|
|
12329
|
+
new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.output.bundlerInfo && new BundlerInfoRspackPlugin(options.output.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), options.experiments.deferImport && new ImportedByDeferModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin(options.experiments.pureFunctions && !0 === options.optimization.sideEffects).apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), 'production' === options.mode && new CircularModulesInfoPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin('global' === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), options.optimization.inlineExports && new InlineExportsPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin('size' !== options.optimization.mangleExports).apply(compiler);
|
|
11434
12330
|
let enableLibSplitChunks = !1;
|
|
11435
12331
|
if (options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) {
|
|
11436
12332
|
let hasModernModule = options.output.enabledLibraryTypes.includes('modern-module'), hasNonModernModule = options.output.enabledLibraryTypes.some((t)=>'modern-module' !== t);
|
|
@@ -11508,7 +12404,19 @@ function validateRspackConfig(config) {
|
|
|
11508
12404
|
let library = output?.library;
|
|
11509
12405
|
if (!('object' == typeof library && 'type' in library && 'umd' === library.type) || void 0 !== externalsType && 'umd' !== externalsType) return;
|
|
11510
12406
|
let checkExternalItem = (externalItem)=>{
|
|
11511
|
-
if ('object' == typeof externalItem && null !== externalItem)
|
|
12407
|
+
if ('object' == typeof externalItem && null !== externalItem) {
|
|
12408
|
+
let { byLayer } = externalItem;
|
|
12409
|
+
if ('function' != typeof byLayer) {
|
|
12410
|
+
if (byLayer && 'object' == typeof byLayer) {
|
|
12411
|
+
for (let layer of [
|
|
12412
|
+
'default',
|
|
12413
|
+
...Object.keys(byLayer)
|
|
12414
|
+
])checkExternalItem(resolveLayerExternals(externalItem, layer));
|
|
12415
|
+
return;
|
|
12416
|
+
}
|
|
12417
|
+
for (let [request, value] of Object.entries(externalItem))'byLayer' !== request && checkExternalItemValue(value);
|
|
12418
|
+
}
|
|
12419
|
+
}
|
|
11512
12420
|
}, checkExternalItemValue = (value)=>{
|
|
11513
12421
|
if (value && 'object' == typeof value && [
|
|
11514
12422
|
'root',
|
|
@@ -11589,148 +12497,6 @@ class CodeGenerationResult {
|
|
|
11589
12497
|
return this.#inner.sources[sourceType];
|
|
11590
12498
|
}
|
|
11591
12499
|
}
|
|
11592
|
-
class ContextModuleFactoryBeforeResolveData {
|
|
11593
|
-
#inner;
|
|
11594
|
-
static __from_binding(binding) {
|
|
11595
|
-
return new ContextModuleFactoryBeforeResolveData(binding);
|
|
11596
|
-
}
|
|
11597
|
-
static __to_binding(data) {
|
|
11598
|
-
return data.#inner;
|
|
11599
|
-
}
|
|
11600
|
-
constructor(binding){
|
|
11601
|
-
this.#inner = binding, Object.defineProperties(this, {
|
|
11602
|
-
context: {
|
|
11603
|
-
enumerable: !0,
|
|
11604
|
-
get: ()=>binding.context,
|
|
11605
|
-
set (val) {
|
|
11606
|
-
binding.context = val;
|
|
11607
|
-
}
|
|
11608
|
-
},
|
|
11609
|
-
request: {
|
|
11610
|
-
enumerable: !0,
|
|
11611
|
-
get: ()=>binding.request,
|
|
11612
|
-
set (val) {
|
|
11613
|
-
binding.request = val;
|
|
11614
|
-
}
|
|
11615
|
-
},
|
|
11616
|
-
regExp: {
|
|
11617
|
-
enumerable: !0,
|
|
11618
|
-
get: ()=>binding.regExp,
|
|
11619
|
-
set (val) {
|
|
11620
|
-
binding.regExp = val;
|
|
11621
|
-
}
|
|
11622
|
-
},
|
|
11623
|
-
recursive: {
|
|
11624
|
-
enumerable: !0,
|
|
11625
|
-
get: ()=>binding.recursive,
|
|
11626
|
-
set (val) {
|
|
11627
|
-
binding.recursive = val;
|
|
11628
|
-
}
|
|
11629
|
-
}
|
|
11630
|
-
});
|
|
11631
|
-
}
|
|
11632
|
-
}
|
|
11633
|
-
class ContextModuleFactoryAfterResolveData {
|
|
11634
|
-
#inner;
|
|
11635
|
-
static __from_binding(binding) {
|
|
11636
|
-
return new ContextModuleFactoryAfterResolveData(binding);
|
|
11637
|
-
}
|
|
11638
|
-
static __to_binding(data) {
|
|
11639
|
-
return data.#inner;
|
|
11640
|
-
}
|
|
11641
|
-
constructor(binding){
|
|
11642
|
-
this.#inner = binding, Object.defineProperties(this, {
|
|
11643
|
-
resource: {
|
|
11644
|
-
enumerable: !0,
|
|
11645
|
-
get: ()=>binding.resource,
|
|
11646
|
-
set (val) {
|
|
11647
|
-
binding.resource = val;
|
|
11648
|
-
}
|
|
11649
|
-
},
|
|
11650
|
-
context: {
|
|
11651
|
-
enumerable: !0,
|
|
11652
|
-
get: ()=>binding.context,
|
|
11653
|
-
set (val) {
|
|
11654
|
-
binding.context = val;
|
|
11655
|
-
}
|
|
11656
|
-
},
|
|
11657
|
-
request: {
|
|
11658
|
-
enumerable: !0,
|
|
11659
|
-
get: ()=>binding.request,
|
|
11660
|
-
set (val) {
|
|
11661
|
-
binding.request = val;
|
|
11662
|
-
}
|
|
11663
|
-
},
|
|
11664
|
-
regExp: {
|
|
11665
|
-
enumerable: !0,
|
|
11666
|
-
get: ()=>binding.regExp,
|
|
11667
|
-
set (val) {
|
|
11668
|
-
binding.regExp = val;
|
|
11669
|
-
}
|
|
11670
|
-
},
|
|
11671
|
-
recursive: {
|
|
11672
|
-
enumerable: !0,
|
|
11673
|
-
get: ()=>binding.recursive,
|
|
11674
|
-
set (val) {
|
|
11675
|
-
binding.recursive = val;
|
|
11676
|
-
}
|
|
11677
|
-
},
|
|
11678
|
-
dependencies: {
|
|
11679
|
-
enumerable: !0,
|
|
11680
|
-
get: ()=>binding.dependencies
|
|
11681
|
-
}
|
|
11682
|
-
});
|
|
11683
|
-
}
|
|
11684
|
-
}
|
|
11685
|
-
Object.defineProperty(binding__default().Module.prototype, 'identifier', {
|
|
11686
|
-
enumerable: !0,
|
|
11687
|
-
configurable: !0,
|
|
11688
|
-
value () {
|
|
11689
|
-
return this[binding__default().MODULE_IDENTIFIER_SYMBOL];
|
|
11690
|
-
}
|
|
11691
|
-
}), Object.defineProperty(binding__default().Module.prototype, 'originalSource', {
|
|
11692
|
-
enumerable: !0,
|
|
11693
|
-
configurable: !0,
|
|
11694
|
-
value () {
|
|
11695
|
-
let originalSource = this._originalSource();
|
|
11696
|
-
return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
|
|
11697
|
-
}
|
|
11698
|
-
}), Object.defineProperty(binding__default().Module.prototype, 'emitFile', {
|
|
11699
|
-
enumerable: !0,
|
|
11700
|
-
configurable: !0,
|
|
11701
|
-
value (filename, source, assetInfo) {
|
|
11702
|
-
return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
|
|
11703
|
-
}
|
|
11704
|
-
}), Object.defineProperty(binding__default().ExternalModule.prototype, 'identifier', {
|
|
11705
|
-
enumerable: !0,
|
|
11706
|
-
configurable: !0,
|
|
11707
|
-
value () {
|
|
11708
|
-
return this[binding__default().MODULE_IDENTIFIER_SYMBOL];
|
|
11709
|
-
}
|
|
11710
|
-
}), Object.defineProperty(binding__default().ExternalModule.prototype, 'originalSource', {
|
|
11711
|
-
enumerable: !0,
|
|
11712
|
-
configurable: !0,
|
|
11713
|
-
value () {
|
|
11714
|
-
let originalSource = this._originalSource();
|
|
11715
|
-
return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
|
|
11716
|
-
}
|
|
11717
|
-
}), Object.defineProperty(binding__default().ExternalModule.prototype, 'emitFile', {
|
|
11718
|
-
enumerable: !0,
|
|
11719
|
-
configurable: !0,
|
|
11720
|
-
value (filename, source, assetInfo) {
|
|
11721
|
-
return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
|
|
11722
|
-
}
|
|
11723
|
-
});
|
|
11724
|
-
let ExternalModule = binding__default().ExternalModule;
|
|
11725
|
-
ExternalModule.getCompilationHooks = (compilation)=>{
|
|
11726
|
-
if (!(binding__default().COMPILATION_HOOKS_MAP_SYMBOL in compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
|
|
11727
|
-
return getOrCreateCompilationHooks(compilation, ExternalModule, ()=>({
|
|
11728
|
-
chunkCondition: new SyncBailHook([
|
|
11729
|
-
'chunk',
|
|
11730
|
-
'compilation'
|
|
11731
|
-
])
|
|
11732
|
-
}));
|
|
11733
|
-
};
|
|
11734
12500
|
let traceHookPlugin_PLUGIN_NAME = 'TraceHookPlugin', PLUGIN_PROCESS_NAME = 'Plugin Analysis', makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
|
|
11735
12501
|
register: (tapInfo)=>{
|
|
11736
12502
|
let { name, type, fn: internalFn } = tapInfo, newFn = name === traceHookPlugin_PLUGIN_NAME ? internalFn : makeNewTraceTapFn(compilerName, hookName, tracer, {
|
|
@@ -11862,7 +12628,7 @@ class TraceHookPlugin {
|
|
|
11862
12628
|
});
|
|
11863
12629
|
}
|
|
11864
12630
|
}
|
|
11865
|
-
let CORE_VERSION = "2.
|
|
12631
|
+
let CORE_VERSION = "2.3.2", VFILES_BY_COMPILER = new WeakMap();
|
|
11866
12632
|
class VirtualModulesPlugin {
|
|
11867
12633
|
#staticModules;
|
|
11868
12634
|
#compiler;
|
|
@@ -11937,10 +12703,11 @@ class Watching {
|
|
|
11937
12703
|
});
|
|
11938
12704
|
}
|
|
11939
12705
|
watch(files, dirs, missing) {
|
|
11940
|
-
|
|
12706
|
+
var callback;
|
|
12707
|
+
this.pausedWatcher = void 0, this.watcher = this.compiler.watchFileSystem.watch(files, dirs, missing, this.lastWatcherStartTime, this.watchOptions, (callback = (err, fileTimeInfoEntries, contextTimeInfoEntries, changedFiles, removedFiles)=>{
|
|
11941
12708
|
if (err) return this.compiler.fileTimestamps = void 0, this.compiler.contextTimestamps = void 0, this.compiler.modifiedFiles = void 0, this.compiler.removedFiles = void 0, this.handler(err);
|
|
11942
12709
|
this.#invalidate(fileTimeInfoEntries, contextTimeInfoEntries, changedFiles, removedFiles), this.onChange();
|
|
11943
|
-
}, (fileName, changeTime)=>{
|
|
12710
|
+
}, internalCallbacks.add(callback), callback), (fileName, changeTime)=>{
|
|
11944
12711
|
this.#invalidReported || (this.#invalidReported = !0, this.compiler.hooks.invalid.call(fileName, changeTime)), this.onInvalid();
|
|
11945
12712
|
});
|
|
11946
12713
|
}
|
|
@@ -11976,29 +12743,37 @@ class Watching {
|
|
|
11976
12743
|
#go(fileTimeInfoEntries, contextTimeInfoEntries, changedFiles, removedFiles) {
|
|
11977
12744
|
if (this.#initial = !1, void 0 === this.startTime && (this.startTime = Date.now()), this.running = !0, this.watcher ? (this.pausedWatcher = this.watcher, this.lastWatcherStartTime = Date.now(), this.watcher.pause(), this.watcher = void 0) : this.lastWatcherStartTime || (this.lastWatcherStartTime = Date.now()), fileTimeInfoEntries && contextTimeInfoEntries && changedFiles && removedFiles) this.#mergeWithCollected(changedFiles, removedFiles), this.compiler.fileTimestamps = fileTimeInfoEntries, this.compiler.contextTimestamps = contextTimeInfoEntries;
|
|
11978
12745
|
else if (this.pausedWatcher) {
|
|
11979
|
-
let { changes, removals, fileTimeInfoEntries, contextTimeInfoEntries } =
|
|
12746
|
+
let watcher = this.pausedWatcher, { changes, removals, fileTimeInfoEntries, contextTimeInfoEntries } = watcher[consumeWatcherInfo]?.() ?? watcher.getInfo();
|
|
11980
12747
|
this.#mergeWithCollected(changes, removals), this.compiler.fileTimestamps = fileTimeInfoEntries, this.compiler.contextTimestamps = contextTimeInfoEntries;
|
|
11981
12748
|
}
|
|
11982
|
-
this.compiler.modifiedFiles = this.#collectedChangedFiles, this.compiler.removedFiles = this.#collectedRemovedFiles, this.#collectedChangedFiles = void 0, this.#collectedRemovedFiles = void 0
|
|
11983
|
-
|
|
11984
|
-
|
|
12749
|
+
this.compiler.modifiedFiles = this.#collectedChangedFiles, this.compiler.removedFiles = this.#collectedRemovedFiles, this.#collectedChangedFiles = void 0, this.#collectedRemovedFiles = void 0;
|
|
12750
|
+
let run = ()=>{
|
|
12751
|
+
if (this.compiler.idle) return this.compiler.cache.endIdle((err)=>{
|
|
12752
|
+
if (err) return this._done(err);
|
|
12753
|
+
this.compiler.idle = !1, run();
|
|
12754
|
+
});
|
|
12755
|
+
this.invalid = !1, this.#invalidReported = !1, this.compiler.hooks.watchRun.callAsync(this.compiler, (err)=>{
|
|
11985
12756
|
if (err) return this._done(err);
|
|
11986
|
-
|
|
11987
|
-
|
|
11988
|
-
|
|
11989
|
-
|
|
11990
|
-
|
|
11991
|
-
this.compiler.hooks.
|
|
12757
|
+
let onCompiled = (err, _compilation)=>{
|
|
12758
|
+
if (err) return this._done(err);
|
|
12759
|
+
if (_compilation.hooks.needAdditionalPass.call()) {
|
|
12760
|
+
_compilation.needAdditionalPass = !0, _compilation.startTime = this.startTime, _compilation.endTime = Date.now();
|
|
12761
|
+
let stats = new Stats(_compilation);
|
|
12762
|
+
this.compiler.hooks.done.callAsync(stats, (err)=>{
|
|
11992
12763
|
if (err) return this._done(err, _compilation);
|
|
11993
|
-
this.compiler.
|
|
12764
|
+
this.compiler.hooks.additionalPass.callAsync((err)=>{
|
|
12765
|
+
if (err) return this._done(err, _compilation);
|
|
12766
|
+
this.compiler.compile(onCompiled);
|
|
12767
|
+
});
|
|
11994
12768
|
});
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
}
|
|
12769
|
+
return;
|
|
12770
|
+
}
|
|
12771
|
+
this._done(null, this.compiler._lastCompilation);
|
|
12772
|
+
};
|
|
12773
|
+
this.compiler.compile(onCompiled);
|
|
12774
|
+
});
|
|
12775
|
+
};
|
|
12776
|
+
run();
|
|
12002
12777
|
}
|
|
12003
12778
|
#accumulateWatchDeps(compilation) {
|
|
12004
12779
|
let pending = this.#pendingWatchDeps ??= {
|
|
@@ -12021,7 +12796,7 @@ class Watching {
|
|
|
12021
12796
|
let stats;
|
|
12022
12797
|
this.running = !1;
|
|
12023
12798
|
let handleError = (err, cbs)=>{
|
|
12024
|
-
for (let cb of (this.compiler.hooks.failed.call(err), this.handler(err, stats), cbs || this.callbacks.splice(0)))cb(err);
|
|
12799
|
+
for (let cb of (this.compiler.hooks.failed.call(err), this.compiler.cache.beginIdle(), this.compiler.idle = !0, this.handler(err, stats), cbs || this.callbacks.splice(0)))cb(err);
|
|
12025
12800
|
};
|
|
12026
12801
|
if (error) return handleError(error);
|
|
12027
12802
|
if (!compilation) throw Error('compilation is required if no error');
|
|
@@ -12034,7 +12809,7 @@ class Watching {
|
|
|
12034
12809
|
let cbs = this.callbacks;
|
|
12035
12810
|
this.callbacks = [], this.compiler.hooks.done.callAsync(stats, (err)=>{
|
|
12036
12811
|
if (err) return handleError(err, cbs);
|
|
12037
|
-
for (let cb of (this.handler(null, stats), process.nextTick(()=>{
|
|
12812
|
+
for (let cb of (this.handler(null, stats), this.compiler.cache.beginIdle(), this.compiler.idle = !0, process.nextTick(()=>{
|
|
12038
12813
|
if (!this.#closed) {
|
|
12039
12814
|
this.#accumulateWatchDeps(compilation);
|
|
12040
12815
|
let pending = this.#pendingWatchDeps;
|
|
@@ -12219,7 +12994,7 @@ class Compiler {
|
|
|
12219
12994
|
}, exports_namespaceObject, {
|
|
12220
12995
|
RuntimeGlobals: createCompilerRuntimeGlobals(options)
|
|
12221
12996
|
});
|
|
12222
|
-
compilerRspack.rspack = compilerRspack, compilerRspack.webpack = compilerRspack, this.webpack = compilerRspack, this.rspack = compilerRspack, this.root = this, this.outputPath = '', this.inputFileSystem = null, this.intermediateFileSystem = null, this.outputFileSystem = null, this.watchFileSystem = null, this.records = {}, this.options = options, this.context = context, this.cache = new Cache(), this.compilerPath = '', this.running = !1, this.idle = !1, this.watchMode = !1, this.#platform = {
|
|
12997
|
+
compilerRspack.rspack = compilerRspack, compilerRspack.webpack = compilerRspack, this.webpack = compilerRspack, this.rspack = compilerRspack, this.root = this, this.outputPath = '', this.inputFileSystem = null, this.intermediateFileSystem = null, this.outputFileSystem = null, this.watchFileSystem = null, this.records = {}, this.options = options, this.context = context, this.cache = new Cache(), this.compilerPath = options.name || '', this.running = !1, this.idle = !1, this.watchMode = !1, this.#platform = {
|
|
12223
12998
|
web: null,
|
|
12224
12999
|
browser: null,
|
|
12225
13000
|
webworker: null,
|
|
@@ -12269,7 +13044,7 @@ class Compiler {
|
|
|
12269
13044
|
return this.#ruleSet;
|
|
12270
13045
|
}
|
|
12271
13046
|
getCache(name) {
|
|
12272
|
-
return new lib_CacheFacade(this.cache, `${this.compilerPath}
|
|
13047
|
+
return new lib_CacheFacade(this.cache, `${this.compilerPath}|${name}`, this.options.output.hashFunction);
|
|
12273
13048
|
}
|
|
12274
13049
|
#logInfrastructure(name, type, args) {
|
|
12275
13050
|
void 0 === this.hooks.infrastructureLog.call(name, type, args) && this.infrastructureLogger?.(name, type, args);
|
|
@@ -12308,7 +13083,7 @@ class Compiler {
|
|
|
12308
13083
|
let startTime = Date.now();
|
|
12309
13084
|
this.running = !0;
|
|
12310
13085
|
let finalCallback = (err, stats)=>{
|
|
12311
|
-
this.idle = !0, this.cache.beginIdle(), this.
|
|
13086
|
+
this.idle = !0, this.cache.beginIdle(), this.running = !1, err && this.hooks.failed.call(err), callback && callback(err, stats), this.hooks.afterDone.call(stats);
|
|
12312
13087
|
}, onCompiled = (err, _compilation)=>{
|
|
12313
13088
|
if (err) return finalCallback(err);
|
|
12314
13089
|
if (_compilation.hooks.needAdditionalPass.call()) {
|
|
@@ -12336,7 +13111,7 @@ class Compiler {
|
|
|
12336
13111
|
});
|
|
12337
13112
|
};
|
|
12338
13113
|
this.idle ? this.cache.endIdle((err)=>{
|
|
12339
|
-
if (err) return
|
|
13114
|
+
if (err) return finalCallback(err);
|
|
12340
13115
|
this.idle = !1, run();
|
|
12341
13116
|
}) : run();
|
|
12342
13117
|
}
|
|
@@ -12370,7 +13145,11 @@ class Compiler {
|
|
|
12370
13145
|
};
|
|
12371
13146
|
applyRspackOptionsDefaults(options);
|
|
12372
13147
|
let childCompiler = new Compiler(this.context, options);
|
|
12373
|
-
childCompiler.name = compilerName, childCompiler.outputPath = this.outputPath, childCompiler.inputFileSystem = this.inputFileSystem, childCompiler.outputFileSystem = null, childCompiler.modifiedFiles = this.modifiedFiles, childCompiler.removedFiles = this.removedFiles, childCompiler.fileTimestamps = this.fileTimestamps, childCompiler.contextTimestamps = this.contextTimestamps, childCompiler.fsStartTime = this.fsStartTime, childCompiler.cache = this.cache, childCompiler.compilerPath =
|
|
13148
|
+
childCompiler.name = compilerName, childCompiler.outputPath = this.outputPath, childCompiler.inputFileSystem = this.inputFileSystem, childCompiler.outputFileSystem = null, childCompiler.modifiedFiles = this.modifiedFiles, childCompiler.removedFiles = this.removedFiles, childCompiler.fileTimestamps = this.fileTimestamps, childCompiler.contextTimestamps = this.contextTimestamps, childCompiler.fsStartTime = this.fsStartTime, childCompiler.cache = this.cache, childCompiler.compilerPath = [
|
|
13149
|
+
this.compilerPath,
|
|
13150
|
+
compilerName,
|
|
13151
|
+
compilerIndex
|
|
13152
|
+
].join('|');
|
|
12374
13153
|
let relativeCompilerName = makePathsRelative(this.context, compilerName, this.root);
|
|
12375
13154
|
if (this.records[relativeCompilerName] || (this.records[relativeCompilerName] = []), this.records[relativeCompilerName][compilerIndex] ? childCompiler.records = this.records[relativeCompilerName][compilerIndex] : this.records[relativeCompilerName].push(childCompiler.records = {}), childCompiler.parentCompilation = compilation, childCompiler.root = this.root, Array.isArray(plugins)) for (let plugin of plugins)plugin && plugin.apply(childCompiler);
|
|
12376
13155
|
for(let hookName in childCompiler.#builtinPlugins = [
|
|
@@ -12390,14 +13169,16 @@ class Compiler {
|
|
|
12390
13169
|
});
|
|
12391
13170
|
}
|
|
12392
13171
|
close(callback) {
|
|
12393
|
-
this.watching
|
|
13172
|
+
if (this.watching) return void this.watching.close(()=>{
|
|
12394
13173
|
this.close(callback);
|
|
12395
|
-
})
|
|
12396
|
-
|
|
12397
|
-
this
|
|
12398
|
-
|
|
12399
|
-
|
|
12400
|
-
|
|
13174
|
+
});
|
|
13175
|
+
let instanceCallback = (error)=>{
|
|
13176
|
+
let close = this.#instance?.close();
|
|
13177
|
+
close ? close.then(()=>callback(error), (closeError)=>callback(error || closeError)) : callback(error);
|
|
13178
|
+
};
|
|
13179
|
+
this.hooks.shutdown.callAsync((err)=>{
|
|
13180
|
+
if (err) return instanceCallback(err);
|
|
13181
|
+
this.cache.shutdown(instanceCallback);
|
|
12401
13182
|
});
|
|
12402
13183
|
}
|
|
12403
13184
|
#build(callback) {
|
|
@@ -12436,8 +13217,8 @@ class Compiler {
|
|
|
12436
13217
|
return this.#compilationParams = params, params;
|
|
12437
13218
|
}
|
|
12438
13219
|
#getInstance(callback) {
|
|
12439
|
-
var output;
|
|
12440
|
-
let coreVersion, expectedCoreVersion, statsOptions, mode, experiments,
|
|
13220
|
+
var output, cache, snapshot;
|
|
13221
|
+
let coreVersion, expectedCoreVersion, statsOptions, strategy, mode, experiments, cache1, error = CORE_VERSION === binding__default().EXPECTED_RSPACK_CORE_VERSION || CORE_VERSION.includes('canary') ? null : Error((coreVersion = CORE_VERSION, expectedCoreVersion = binding__default().EXPECTED_RSPACK_CORE_VERSION, process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
|
12441
13222
|
|
|
12442
13223
|
Help:
|
|
12443
13224
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
|
@@ -12451,7 +13232,7 @@ Help:
|
|
|
12451
13232
|
if (error) return callback(error);
|
|
12452
13233
|
if (this.#instance) return callback(null, this.#instance);
|
|
12453
13234
|
let { options } = this;
|
|
12454
|
-
this.#rawOptions = (mode = options.mode, experiments = options.experiments,
|
|
13235
|
+
this.#rawOptions = (mode = options.mode, experiments = options.experiments, cache1 = options.cache, {
|
|
12455
13236
|
name: options.name,
|
|
12456
13237
|
mode,
|
|
12457
13238
|
context: options.context,
|
|
@@ -12476,6 +13257,7 @@ Help:
|
|
|
12476
13257
|
optionalChaining: !!environment.optionalChaining,
|
|
12477
13258
|
logicalAssignment: !!environment.logicalAssignment,
|
|
12478
13259
|
templateLiteral: !!environment.templateLiteral,
|
|
13260
|
+
topLevelAwait: !!environment.topLevelAwait,
|
|
12479
13261
|
importMetaDirnameAndFilename: !!environment.importMetaDirnameAndFilename
|
|
12480
13262
|
};
|
|
12481
13263
|
}(output.environment)
|
|
@@ -12521,35 +13303,44 @@ Help:
|
|
|
12521
13303
|
return delete obj.preset, obj;
|
|
12522
13304
|
}(options.stats)).colors ? isStatsColorSupported() : !!statsOptions.colors
|
|
12523
13305
|
},
|
|
12524
|
-
cache:
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
|
|
12528
|
-
|
|
12529
|
-
|
|
12530
|
-
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
|
|
12535
|
-
|
|
12536
|
-
|
|
12537
|
-
|
|
12538
|
-
version: cache.version,
|
|
12539
|
-
maxAge: ((name, value)=>{
|
|
12540
|
-
if (1 / 0 === value) return 0;
|
|
12541
|
-
if (!Number.isSafeInteger(value) || value < 1 || value > 0xffffffff) throw Error(`Invalid Rspack configuration: "${name}" must be a positive integer (1..4294967295) or Infinity, get \`${value}\`.`);
|
|
13306
|
+
cache: !1 !== (cache = cache1) && ('memory' === cache.type ? {
|
|
13307
|
+
type: cache.type
|
|
13308
|
+
} : {
|
|
13309
|
+
type: cache.type,
|
|
13310
|
+
buildDependencies: cache.buildDependencies,
|
|
13311
|
+
version: cache.version,
|
|
13312
|
+
maxAge: ((name, value)=>{
|
|
13313
|
+
if (1 / 0 === value) return 0;
|
|
13314
|
+
if (!Number.isSafeInteger(value) || value < 1 || value > 0xffffffff) throw Error(`Invalid Rspack configuration: "${name}" must be a positive integer (1..4294967295) or Infinity, get \`${value}\`.`);
|
|
13315
|
+
return value;
|
|
13316
|
+
})('cache.maxAge', cache.maxAge),
|
|
13317
|
+
maxMemoryGenerations: ((value)=>{
|
|
13318
|
+
if (1 / 0 !== value) {
|
|
13319
|
+
if (!Number.isSafeInteger(value) || value < 0 || value > 0xffffffff) throw Error(`Invalid Rspack configuration: "cache.maxMemoryGenerations" must be a non-negative integer (0..4294967295) or Infinity, get \`${value}\`.`);
|
|
12542
13320
|
return value;
|
|
12543
|
-
}
|
|
12544
|
-
|
|
12545
|
-
|
|
12546
|
-
|
|
12547
|
-
|
|
12548
|
-
|
|
12549
|
-
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
}
|
|
13321
|
+
}
|
|
13322
|
+
})(cache.maxMemoryGenerations),
|
|
13323
|
+
storage: {
|
|
13324
|
+
type: cache.storage.type,
|
|
13325
|
+
directory: cache.storage.directory,
|
|
13326
|
+
location: cache.storage.location
|
|
13327
|
+
},
|
|
13328
|
+
portable: cache.portable,
|
|
13329
|
+
readonly: cache.readonly
|
|
13330
|
+
}),
|
|
13331
|
+
snapshot: (snapshot = options.snapshot, strategy = (value)=>({
|
|
13332
|
+
hash: value?.hash ?? !1,
|
|
13333
|
+
timestamp: value?.timestamp ?? !1
|
|
13334
|
+
}), {
|
|
13335
|
+
immutablePaths: snapshot.immutablePaths,
|
|
13336
|
+
unmanagedPaths: snapshot.unmanagedPaths,
|
|
13337
|
+
managedPaths: snapshot.managedPaths,
|
|
13338
|
+
buildDependencies: strategy(snapshot.buildDependencies),
|
|
13339
|
+
resolveBuildDependencies: strategy(snapshot.resolveBuildDependencies),
|
|
13340
|
+
module: strategy(snapshot.module),
|
|
13341
|
+
contextModule: strategy(snapshot.contextModule),
|
|
13342
|
+
resolve: strategy(snapshot.resolve)
|
|
13343
|
+
}),
|
|
12553
13344
|
experiments,
|
|
12554
13345
|
incremental: 'development' === mode && options.incremental,
|
|
12555
13346
|
node: function(node) {
|
|
@@ -12566,14 +13357,14 @@ Help:
|
|
|
12566
13357
|
bail: options.bail,
|
|
12567
13358
|
__references: {}
|
|
12568
13359
|
}), this.#rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries()), this.#rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
|
|
12569
|
-
let instanceBinding =
|
|
13360
|
+
let instanceBinding = rspackRequire("@ohos-ports/rspack-binding");
|
|
12570
13361
|
this.#registers = this.#createHooksRegisters();
|
|
12571
13362
|
let inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0, compilerRef = new WeakRef(this);
|
|
12572
13363
|
try {
|
|
12573
13364
|
this.#instance = new instanceBinding.JsCompiler(this.compilerPath, this.#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), this.unsafeFastDrop, this.#platform, (logs)=>{
|
|
12574
13365
|
let compiler = compilerRef.deref();
|
|
12575
13366
|
compiler && compiler.#logInfrastructureBatch(logs);
|
|
12576
|
-
}), callback(null, this.#instance);
|
|
13367
|
+
}, Cache.__to_binding(this.cache), bindingHelpers), callback(null, this.#instance);
|
|
12577
13368
|
} catch (err) {
|
|
12578
13369
|
err instanceof Error && delete err.stack, callback(Error('Failed to create Rspack compiler instance, check the Rspack configuration.', {
|
|
12579
13370
|
cause: err
|
|
@@ -12644,17 +13435,21 @@ Help:
|
|
|
12644
13435
|
return getCompiler().hooks.assetEmitted;
|
|
12645
13436
|
}, function(queried) {
|
|
12646
13437
|
return async function({ filename, targetPath, outputPath }) {
|
|
13438
|
+
let source, content;
|
|
12647
13439
|
return queried.promise(filename, {
|
|
12648
13440
|
compilation: getCompiler().__internal__get_compilation(),
|
|
12649
13441
|
targetPath,
|
|
12650
13442
|
outputPath,
|
|
12651
13443
|
get source () {
|
|
12652
|
-
|
|
12653
|
-
|
|
13444
|
+
if (void 0 === source) {
|
|
13445
|
+
let assetSource = getCompiler().__internal__get_compilation().getAsset(filename)?.source;
|
|
13446
|
+
if (!assetSource) throw Error(`Asset ${filename} not found`);
|
|
13447
|
+
source = assetSource;
|
|
13448
|
+
}
|
|
12654
13449
|
return source;
|
|
12655
13450
|
},
|
|
12656
13451
|
get content () {
|
|
12657
|
-
return this.source
|
|
13452
|
+
return content ??= this.source.buffer();
|
|
12658
13453
|
}
|
|
12659
13454
|
});
|
|
12660
13455
|
};
|
|
@@ -12898,7 +13693,7 @@ Help:
|
|
|
12898
13693
|
}, function(queried) {
|
|
12899
13694
|
return async function(resolveData) {
|
|
12900
13695
|
return [
|
|
12901
|
-
await queried.promise(resolveData),
|
|
13696
|
+
await queried.promise(createResolveData(resolveData)),
|
|
12902
13697
|
resolveData
|
|
12903
13698
|
];
|
|
12904
13699
|
};
|
|
@@ -12907,14 +13702,14 @@ Help:
|
|
|
12907
13702
|
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
|
|
12908
13703
|
}, function(queried) {
|
|
12909
13704
|
return async function(resolveData) {
|
|
12910
|
-
return await queried.promise(resolveData), resolveData;
|
|
13705
|
+
return await queried.promise(createResolveData(resolveData)), resolveData;
|
|
12911
13706
|
};
|
|
12912
13707
|
}),
|
|
12913
13708
|
registerNormalModuleFactoryResolveTaps: createTap(binding__default().RegisterJsTapKind.NormalModuleFactoryResolve, function() {
|
|
12914
13709
|
return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
|
|
12915
13710
|
}, function(queried) {
|
|
12916
13711
|
return async function(resolveData) {
|
|
12917
|
-
return await queried.promise(resolveData), resolveData;
|
|
13712
|
+
return await queried.promise(createResolveData(resolveData)), resolveData;
|
|
12918
13713
|
};
|
|
12919
13714
|
}),
|
|
12920
13715
|
registerNormalModuleFactoryResolveForSchemeTaps: createMapTap(binding__default().RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
|
|
@@ -12932,7 +13727,7 @@ Help:
|
|
|
12932
13727
|
}, function(queried) {
|
|
12933
13728
|
return async function(resolveData) {
|
|
12934
13729
|
return [
|
|
12935
|
-
await queried.promise(resolveData),
|
|
13730
|
+
await queried.promise(createResolveData(resolveData)),
|
|
12936
13731
|
resolveData
|
|
12937
13732
|
];
|
|
12938
13733
|
};
|
|
@@ -13222,53 +14017,14 @@ Help:
|
|
|
13222
14017
|
return this.#moduleExecutionResultsMap;
|
|
13223
14018
|
}
|
|
13224
14019
|
}
|
|
13225
|
-
Object.defineProperty(binding__default().ConcatenatedModule.prototype, 'identifier', {
|
|
13226
|
-
enumerable: !0,
|
|
13227
|
-
configurable: !0,
|
|
13228
|
-
value () {
|
|
13229
|
-
return this[binding__default().MODULE_IDENTIFIER_SYMBOL];
|
|
13230
|
-
}
|
|
13231
|
-
}), Object.defineProperty(binding__default().ConcatenatedModule.prototype, 'originalSource', {
|
|
13232
|
-
enumerable: !0,
|
|
13233
|
-
configurable: !0,
|
|
13234
|
-
value () {
|
|
13235
|
-
let originalSource = this._originalSource();
|
|
13236
|
-
return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
|
|
13237
|
-
}
|
|
13238
|
-
}), Object.defineProperty(binding__default().ConcatenatedModule.prototype, 'emitFile', {
|
|
13239
|
-
enumerable: !0,
|
|
13240
|
-
configurable: !0,
|
|
13241
|
-
value (filename, source, assetInfo) {
|
|
13242
|
-
return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
|
|
13243
|
-
}
|
|
13244
|
-
}), Object.defineProperty(binding__default().ContextModule.prototype, 'identifier', {
|
|
13245
|
-
enumerable: !0,
|
|
13246
|
-
configurable: !0,
|
|
13247
|
-
value () {
|
|
13248
|
-
return this[binding__default().MODULE_IDENTIFIER_SYMBOL];
|
|
13249
|
-
}
|
|
13250
|
-
}), Object.defineProperty(binding__default().ContextModule.prototype, 'originalSource', {
|
|
13251
|
-
enumerable: !0,
|
|
13252
|
-
configurable: !0,
|
|
13253
|
-
value () {
|
|
13254
|
-
let originalSource = this._originalSource();
|
|
13255
|
-
return originalSource ? SourceAdapter.fromBinding(originalSource) : null;
|
|
13256
|
-
}
|
|
13257
|
-
}), Object.defineProperty(binding__default().ContextModule.prototype, 'emitFile', {
|
|
13258
|
-
enumerable: !0,
|
|
13259
|
-
configurable: !0,
|
|
13260
|
-
value (filename, source, assetInfo) {
|
|
13261
|
-
return this._emitFile(filename, SourceAdapter.toBinding(source), assetInfo);
|
|
13262
|
-
}
|
|
13263
|
-
});
|
|
13264
14020
|
let ModuleGraphConnection = binding_.ModuleGraphConnection;
|
|
13265
14021
|
Object.defineProperties(ModuleGraphConnection, {
|
|
13266
14022
|
TRANSITIVE_ONLY: {
|
|
13267
|
-
value:
|
|
14023
|
+
value: TRANSITIVE_ONLY_SYMBOL,
|
|
13268
14024
|
enumerable: !0
|
|
13269
14025
|
},
|
|
13270
14026
|
CIRCULAR_CONNECTION: {
|
|
13271
|
-
value:
|
|
14027
|
+
value: CIRCULAR_CONNECTION_SYMBOL,
|
|
13272
14028
|
enumerable: !0
|
|
13273
14029
|
}
|
|
13274
14030
|
});
|
|
@@ -13372,7 +14128,7 @@ class LoaderOptionsPlugin {
|
|
|
13372
14128
|
apply(compiler) {
|
|
13373
14129
|
let options = this.options;
|
|
13374
14130
|
compiler.hooks.compilation.tap('LoaderOptionsPlugin', (compilation)=>{
|
|
13375
|
-
|
|
14131
|
+
NormalModule.getCompilationHooks(compilation).loader.tap('LoaderOptionsPlugin', (context)=>{
|
|
13376
14132
|
let resource = context.resourcePath;
|
|
13377
14133
|
if (resource && matchObject(options, resource)) for (let key of Object.keys(options))'include' !== key && 'exclude' !== key && 'test' !== key && (context[key] = options[key]);
|
|
13378
14134
|
});
|
|
@@ -13386,7 +14142,7 @@ class LoaderTargetPlugin {
|
|
|
13386
14142
|
}
|
|
13387
14143
|
apply(compiler) {
|
|
13388
14144
|
compiler.hooks.compilation.tap('LoaderTargetPlugin', (compilation)=>{
|
|
13389
|
-
|
|
14145
|
+
NormalModule.getCompilationHooks(compilation).loader.tap('LoaderTargetPlugin', (loaderContext)=>{
|
|
13390
14146
|
loaderContext.target = this.target;
|
|
13391
14147
|
});
|
|
13392
14148
|
});
|
|
@@ -13524,7 +14280,10 @@ class ProvideSharedPlugin extends RspackBuiltinPlugin {
|
|
|
13524
14280
|
}
|
|
13525
14281
|
}
|
|
13526
14282
|
function validateShareScope(shareScope, enhanced, pluginName) {
|
|
13527
|
-
if (Array.isArray(shareScope)
|
|
14283
|
+
if (Array.isArray(shareScope)) {
|
|
14284
|
+
if (0 === shareScope.length) throw Error(`[${pluginName}] shareScope array must contain at least one entry`);
|
|
14285
|
+
if (shareScope.length > 1 && !enhanced) throw Error(`[${pluginName}] shareScope as an array with multiple entries requires enhanced=true, got: ${JSON.stringify(shareScope)}`);
|
|
14286
|
+
}
|
|
13528
14287
|
}
|
|
13529
14288
|
function normalizeSharedOptions(shared) {
|
|
13530
14289
|
return parseOptions(shared, (item, key)=>{
|
|
@@ -13977,8 +14736,11 @@ class IndependentSharedPlugin {
|
|
|
13977
14736
|
(parentConfig.plugins || []).forEach((plugin)=>{
|
|
13978
14737
|
void 0 !== plugin && 'string' != typeof plugin && ((plugin, excludedPlugins = [])=>{
|
|
13979
14738
|
if (!plugin) return !0;
|
|
13980
|
-
let
|
|
13981
|
-
|
|
14739
|
+
let pluginNames = [
|
|
14740
|
+
plugin.name,
|
|
14741
|
+
plugin.constructor?.name
|
|
14742
|
+
];
|
|
14743
|
+
return ![
|
|
13982
14744
|
'TreeShakingSharedPlugin',
|
|
13983
14745
|
'IndependentSharedPlugin',
|
|
13984
14746
|
'ModuleFederationPlugin',
|
|
@@ -13987,7 +14749,7 @@ class IndependentSharedPlugin {
|
|
|
13987
14749
|
'HtmlRspackPlugin',
|
|
13988
14750
|
'RsbuildHtmlPlugin',
|
|
13989
14751
|
...excludedPlugins
|
|
13990
|
-
].includes(
|
|
14752
|
+
].some((excludedPluginName)=>pluginNames.includes(excludedPluginName));
|
|
13991
14753
|
})(plugin, treeShakingSharedExcludePlugins) && finalPlugins.push(plugin);
|
|
13992
14754
|
}), plugins.forEach((plugin)=>{
|
|
13993
14755
|
finalPlugins.push(plugin);
|
|
@@ -14065,6 +14827,7 @@ class TreeShakingSharedPlugin {
|
|
|
14065
14827
|
}
|
|
14066
14828
|
apply(compiler) {
|
|
14067
14829
|
let { mfConfig, outputDir, secondary } = this, { name, shared, library, treeShakingSharedPlugins } = mfConfig;
|
|
14830
|
+
if (!name) throw Error('[TreeShakingSharedPlugin] Shared dependency tree shaking requires a non-empty "name" in the Module Federation configuration. Set it to a unique name for this application.');
|
|
14068
14831
|
if (!shared) return;
|
|
14069
14832
|
let sharedOptions = normalizeSharedOptions(shared);
|
|
14070
14833
|
sharedOptions.length && sharedOptions.some(([_, config])=>config.treeShaking && !1 !== config.import) && (secondary || new SharedUsedExportsOptimizerPlugin(sharedOptions, mfConfig.injectTreeShakingUsedExports, mfConfig.manifest).apply(compiler), this._independentSharePlugin = new IndependentSharedPlugin({
|
|
@@ -14162,7 +14925,7 @@ function getDefaultEntryRuntimeSource(paths, options, compiler, treeShakingShare
|
|
|
14162
14925
|
let paramsCode = void 0 === pluginParams ? 'undefined' : JSON.stringify(pluginParams);
|
|
14163
14926
|
runtimePluginVars.push(`{ plugin: ${runtimePluginVar}, params: ${paramsCode} }`);
|
|
14164
14927
|
}
|
|
14165
|
-
let defaultRuntimeSource = compiler.rspack.Template.getFunctionContent(
|
|
14928
|
+
let defaultRuntimeSource = compiler.rspack.Template.getFunctionContent(rspackRequire("./moduleFederationDefaultRuntime.js").default), compilerRuntimeGlobals = createCompilerRuntimeGlobals(compiler.options), runtimeSource = (source = defaultRuntimeSource, runtimeRequire = 'rspack' === compiler.options.experiments.runtimeMode ? `new Proxy(function (moduleId) {
|
|
14166
14929
|
return ${compilerRuntimeGlobals.require}(moduleId);
|
|
14167
14930
|
}, {
|
|
14168
14931
|
get(_target, key) {
|
|
@@ -14198,11 +14961,12 @@ class ContainerPlugin extends RspackBuiltinPlugin {
|
|
|
14198
14961
|
name = binding_.BuiltinPluginName.ContainerPlugin;
|
|
14199
14962
|
_options;
|
|
14200
14963
|
constructor(options){
|
|
14201
|
-
|
|
14202
|
-
|
|
14203
|
-
validateShareScope(shareScope, enhanced, 'ContainerPlugin'),
|
|
14964
|
+
var shareScope;
|
|
14965
|
+
if (super(), 'string' != typeof options.name) throw Error('[ContainerPlugin] name must be a string.');
|
|
14966
|
+
let enhanced = options.enhanced ?? !1, shareScope1 = (shareScope = options.shareScope, shareScope ? (validateShareScope(shareScope, enhanced, 'ContainerPlugin'), !enhanced && Array.isArray(shareScope) ? shareScope[0] : shareScope) : 'default');
|
|
14967
|
+
this._options = {
|
|
14204
14968
|
name: options.name,
|
|
14205
|
-
shareScope,
|
|
14969
|
+
shareScope: shareScope1,
|
|
14206
14970
|
library: options.library || {
|
|
14207
14971
|
type: 'global',
|
|
14208
14972
|
name: options.name
|
|
@@ -14288,15 +15052,7 @@ class ContainerReferencePlugin extends RspackBuiltinPlugin {
|
|
|
14288
15052
|
return createBuiltinPlugin(this.name, rawOptions);
|
|
14289
15053
|
}
|
|
14290
15054
|
}
|
|
14291
|
-
|
|
14292
|
-
let _options = JSON.stringify(options || {});
|
|
14293
|
-
return binding__default().minify(source, _options);
|
|
14294
|
-
}
|
|
14295
|
-
async function transform(source, options) {
|
|
14296
|
-
let _options = JSON.stringify(options || {});
|
|
14297
|
-
return binding__default().transform(source, _options);
|
|
14298
|
-
}
|
|
14299
|
-
let exports_rspackVersion = "2.2.2", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
|
|
15055
|
+
let exports_rspackVersion = "2.3.2", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
|
|
14300
15056
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
14301
15057
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
14302
15058
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
|
@@ -14493,8 +15249,14 @@ let exports_rspackVersion = "2.2.2", exports_version = "5.75.0", exports_Webpack
|
|
|
14493
15249
|
RstestPlugin: RstestPlugin,
|
|
14494
15250
|
RslibPlugin: RslibPlugin,
|
|
14495
15251
|
swc: {
|
|
14496
|
-
minify:
|
|
14497
|
-
|
|
15252
|
+
minify: async function(source, options) {
|
|
15253
|
+
let _options = JSON.stringify(options || {});
|
|
15254
|
+
return binding__default().minify(source, _options);
|
|
15255
|
+
},
|
|
15256
|
+
transform: async function(source, options) {
|
|
15257
|
+
let _options = JSON.stringify(options || {});
|
|
15258
|
+
return binding__default().transform(source, _options);
|
|
15259
|
+
},
|
|
14498
15260
|
minifySync: function(source, options) {
|
|
14499
15261
|
let _options = JSON.stringify(options || {});
|
|
14500
15262
|
return binding__default().minifySync(source, _options);
|
|
@@ -14517,7 +15279,20 @@ let exports_rspackVersion = "2.2.2", exports_version = "5.75.0", exports_Webpack
|
|
|
14517
15279
|
},
|
|
14518
15280
|
VirtualModulesPlugin: VirtualModulesPlugin,
|
|
14519
15281
|
ids: {
|
|
14520
|
-
SyncModuleIdsPlugin:
|
|
15282
|
+
SyncModuleIdsPlugin: class extends RspackBuiltinPlugin {
|
|
15283
|
+
options;
|
|
15284
|
+
name = binding_.BuiltinPluginName.SyncModuleIdsPlugin;
|
|
15285
|
+
affectedHooks = 'compilation';
|
|
15286
|
+
constructor(options){
|
|
15287
|
+
super(), this.options = options;
|
|
15288
|
+
}
|
|
15289
|
+
raw() {
|
|
15290
|
+
let options = {
|
|
15291
|
+
...this.options
|
|
15292
|
+
};
|
|
15293
|
+
return createBuiltinPlugin(this.name, options);
|
|
15294
|
+
}
|
|
15295
|
+
}
|
|
14521
15296
|
},
|
|
14522
15297
|
rsc: {
|
|
14523
15298
|
createPlugins: ()=>{
|
|
@@ -14549,4 +15324,4 @@ let exports_rspackVersion = "2.2.2", exports_version = "5.75.0", exports_Webpack
|
|
|
14549
15324
|
src_fn.rspack = src_fn, src_fn.webpack = src_fn;
|
|
14550
15325
|
let src_rspack = src_fn;
|
|
14551
15326
|
export default src_rspack;
|
|
14552
|
-
export { AsyncDependenciesBlock, BannerPlugin, CaseSensitivePlugin, CircularCheckRspackPlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ConcatenatedModule, ContextModule, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefaultRuntimeGlobals as RuntimeGlobals, DefinePlugin, Dependency, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, EntryDependency, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalModule, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin,
|
|
15327
|
+
export { AsyncDependenciesBlock, BannerPlugin, CaseSensitivePlugin, CircularCheckRspackPlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ConcatenatedModule, ContextModule, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefaultRuntimeGlobals as RuntimeGlobals, DefinePlugin, Dependency, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, EntryDependency, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalModule, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, ModuleGraphConnection, Module_Module as Module, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply, RuntimeModule, RuntimePlugin, RuntimeTemplate, SourceMapDevToolPlugin, Stats, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, container, electron, exports_WebpackError as WebpackError, exports_config as config, exports_experiments as experiments, exports_ids as ids, exports_library as library, exports_node as node, exports_rspackVersion as rspackVersion, exports_version as version, exports_wasm as wasm, javascript, lazyCompilationMiddleware, lib_EntryOptionPlugin as EntryOptionPlugin, optimize, sharing, sources_namespaceObject as sources, src_rspack as "module.exports", src_rspack as rspack, statsFactoryUtils_StatsErrorCode as StatsErrorCode, util, web, webworker };
|