@rspack/core 1.4.11 → 1.5.0-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/dist/Compilation.d.ts +2 -2
- package/dist/Compiler.d.ts +5 -0
- package/dist/NativeWatchFileSystem.d.ts +3 -1
- package/dist/NormalModuleFactory.d.ts +2 -2
- package/dist/Resolver.d.ts +0 -6
- package/dist/ResolverFactory.d.ts +8 -5
- package/dist/VirtualModulesPlugin.d.ts +12 -0
- 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 +1 -1
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssChunkingPlugin.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/DllEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.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/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/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/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/InferAsyncModulesPlugin.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/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.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/NoEmitOnErrorsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
- 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 +1 -1
- package/dist/builtin-plugin/RslibPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RstestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- 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 +1 -1
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/config/normalization.d.ts +7 -0
- package/dist/config/types.d.ts +15 -4
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/exports.d.ts +9 -1
- package/dist/index.js +248 -154
- package/dist/loader-runner/loadLoader.d.ts +2 -1
- package/dist/loader-runner/utils.d.ts +2 -1
- package/dist/schema/config.d.ts +56 -47
- package/dist/schema/loaders.d.ts +5 -5
- package/dist/schema/plugins.d.ts +10 -10
- package/dist/util/bindingVersionCheck.d.ts +1 -1
- package/dist/util/require.d.ts +3 -0
- package/dist/worker.js +44 -9
- package/module.d.ts +9 -10
- package/package.json +8 -5
package/dist/index.js
CHANGED
@@ -303,6 +303,7 @@ for(var __webpack_i__ in (()=>{
|
|
303
303
|
HotModuleReplacementPlugin: ()=>HotModuleReplacementPlugin,
|
304
304
|
Dependency: ()=>binding_.Dependency,
|
305
305
|
LoaderTargetPlugin: ()=>LoaderTargetPlugin,
|
306
|
+
VirtualModulesPlugin: ()=>VirtualModulesPlugin,
|
306
307
|
container: ()=>container,
|
307
308
|
EvalDevToolModulePlugin: ()=>EvalDevToolModulePlugin,
|
308
309
|
SwcJsMinimizerRspackPlugin: ()=>SwcJsMinimizerRspackPlugin,
|
@@ -411,6 +412,7 @@ for(var __webpack_i__ in (()=>{
|
|
411
412
|
SwcJsMinimizerRspackPlugin: ()=>SwcJsMinimizerRspackPlugin,
|
412
413
|
Template: ()=>Template,
|
413
414
|
ValidationError: ()=>validate_ValidationError,
|
415
|
+
VirtualModulesPlugin: ()=>VirtualModulesPlugin,
|
414
416
|
WarnCaseSensitiveModulesPlugin: ()=>WarnCaseSensitiveModulesPlugin,
|
415
417
|
WebpackError: ()=>exports_WebpackError,
|
416
418
|
WebpackOptionsApply: ()=>RspackOptionsApply,
|
@@ -2996,12 +2998,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
2996
2998
|
]
|
2997
2999
|
}).catch(handleError);
|
2998
3000
|
});
|
2999
|
-
}),
|
3001
|
+
}), external_node_fs_namespaceObject = require("node:fs");
|
3002
|
+
var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
|
3003
|
+
let LoaderLoadingError = class extends Error {
|
3000
3004
|
constructor(message){
|
3001
3005
|
super(message), this.name = "LoaderRunnerError", Error.captureStackTrace(this, this.constructor);
|
3002
3006
|
}
|
3003
3007
|
};
|
3004
|
-
function loadLoader(loader, callback) {
|
3008
|
+
function loadLoader(loader, compiler, callback) {
|
3005
3009
|
if ("module" === loader.type) try {
|
3006
3010
|
void 0 === loadLoader_url && (loadLoader_url = __webpack_require__("node:url")), import(loadLoader_url.pathToFileURL(loader.path).toString()).then((module)=>{
|
3007
3011
|
handleResult(loader, module, callback);
|
@@ -3015,7 +3019,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
3015
3019
|
try {
|
3016
3020
|
module = require(loader.path);
|
3017
3021
|
} catch (e) {
|
3018
|
-
if (e instanceof Error && "EMFILE" === e.code) return void setImmediate(loadLoader.bind(null, loader, callback));
|
3022
|
+
if (e instanceof Error && "EMFILE" === e.code) return void setImmediate(loadLoader.bind(null, loader, compiler, callback));
|
3019
3023
|
return callback(e);
|
3020
3024
|
}
|
3021
3025
|
return handleResult(loader, module, callback);
|
@@ -3385,7 +3389,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
3385
3389
|
resource: loaderContext.resource,
|
3386
3390
|
mode: loaderContext.mode,
|
3387
3391
|
sourceMap: loaderContext.sourceMap,
|
3388
|
-
rootContext: loaderContext.
|
3392
|
+
rootContext: loaderContext.rootContext,
|
3389
3393
|
loaderIndex: loaderContext.loaderIndex,
|
3390
3394
|
loaders: loaderContext.loaders.map((item)=>{
|
3391
3395
|
let options = item.options;
|
@@ -3569,7 +3573,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
3569
3573
|
loaderContext.loaderIndex += 1;
|
3570
3574
|
continue;
|
3571
3575
|
}
|
3572
|
-
await utils_loadLoader(currentLoaderObject);
|
3576
|
+
await utils_loadLoader(currentLoaderObject, compiler);
|
3573
3577
|
let fn = currentLoaderObject.pitch;
|
3574
3578
|
if (parallelism && fn || (currentLoaderObject.pitchExecuted = !0), !fn) continue;
|
3575
3579
|
let args = await isomorphoicRun(fn, [
|
@@ -3594,7 +3598,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
3594
3598
|
loaderContext.loaderIndex--;
|
3595
3599
|
continue;
|
3596
3600
|
}
|
3597
|
-
await utils_loadLoader(currentLoaderObject);
|
3601
|
+
await utils_loadLoader(currentLoaderObject, compiler);
|
3598
3602
|
let fn = currentLoaderObject.normal;
|
3599
3603
|
parallelism && fn || (currentLoaderObject.normalExecuted = !0), fn && ([content, sourceMap, additionalData] = await isomorphoicRun(fn, [
|
3600
3604
|
content,
|
@@ -3713,7 +3717,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
3713
3717
|
alias: getRawAlias(resolve.alias),
|
3714
3718
|
fallback: getRawAlias(resolve.fallback),
|
3715
3719
|
extensionAlias: function(alias = {}) {
|
3716
|
-
return Object.fromEntries(Object.entries(alias).map(([key, value])=>Array.isArray(value) ? [
|
3720
|
+
if ("object" == typeof alias && null !== alias) return Object.fromEntries(Object.entries(alias).map(([key, value])=>Array.isArray(value) ? [
|
3717
3721
|
key,
|
3718
3722
|
value
|
3719
3723
|
] : [
|
@@ -4025,6 +4029,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4025
4029
|
let resolveRequest = this.#resolveRequestCache.get(text);
|
4026
4030
|
return resolveRequest || (resolveRequest = JSON.parse(text), this.#resolveRequestCache.set(text, resolveRequest)), Object.assign({}, resolveRequest);
|
4027
4031
|
};
|
4032
|
+
#processRequest(req) {
|
4033
|
+
return `${req.path.replace(/#/g, "\u200b#")}${req.query.replace(/#/g, "\u200b#")}${req.fragment}`;
|
4034
|
+
}
|
4028
4035
|
#getRawExternalItem = (item)=>{
|
4029
4036
|
if ("string" == typeof item || item instanceof RegExp) return item;
|
4030
4037
|
if ("function" == typeof item) {
|
@@ -4038,7 +4045,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4038
4045
|
issuer: data.contextInfo.issuer,
|
4039
4046
|
issuerLayer: data.contextInfo.issuerLayer ?? null
|
4040
4047
|
},
|
4041
|
-
getResolve (options)
|
4048
|
+
getResolve: (options)=>{
|
4042
4049
|
let rawResolve = options ? getRawResolve(options) : void 0, resolve = ctx.getResolve(rawResolve);
|
4043
4050
|
return (context, request, callback)=>{
|
4044
4051
|
if (!callback) return new Promise((promiseResolve, promiseReject)=>{
|
@@ -4046,7 +4053,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4046
4053
|
if (error) promiseReject(error);
|
4047
4054
|
else {
|
4048
4055
|
let req = processResolveResult(text);
|
4049
|
-
promiseResolve(req
|
4056
|
+
promiseResolve(req ? this.#processRequest(req) : void 0);
|
4050
4057
|
}
|
4051
4058
|
});
|
4052
4059
|
});
|
@@ -4054,7 +4061,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4054
4061
|
if (error) callback(error);
|
4055
4062
|
else {
|
4056
4063
|
let req = processResolveResult(text);
|
4057
|
-
callback(null, req
|
4064
|
+
callback(null, !!req && this.#processRequest(req), req);
|
4058
4065
|
}
|
4059
4066
|
});
|
4060
4067
|
};
|
@@ -6325,7 +6332,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6325
6332
|
let ZodRecord = $constructor("ZodRecord", (inst, def)=>{
|
6326
6333
|
$ZodRecord.init(inst, def), ZodType.init(inst, def), inst.keyType = def.keyType, inst.valueType = def.valueType;
|
6327
6334
|
});
|
6328
|
-
function
|
6335
|
+
function schemas_record(keyType, valueType, params) {
|
6329
6336
|
return new ZodRecord({
|
6330
6337
|
type: "record",
|
6331
6338
|
keyType,
|
@@ -6553,7 +6560,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6553
6560
|
buildMeta: custom(),
|
6554
6561
|
exports: schemas_array(schemas_string()).or(literal(!0)),
|
6555
6562
|
id: schemas_string().or(numberOrInfinity)
|
6556
|
-
}).partial(), dllReferencePluginOptionsContent =
|
6563
|
+
}).partial(), dllReferencePluginOptionsContent = schemas_record(schemas_string(), dllReferencePluginOptionsContentItem), dllReferencePluginOptionsSourceType = schemas_enum([
|
6557
6564
|
"var",
|
6558
6565
|
"assign",
|
6559
6566
|
"this",
|
@@ -6605,7 +6612,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6605
6612
|
error: "HtmlRspackPlugin does not support template path with loader yet"
|
6606
6613
|
}),
|
6607
6614
|
templateContent: schemas_string().or(anyFunction),
|
6608
|
-
templateParameters:
|
6615
|
+
templateParameters: schemas_record(schemas_string(), schemas_string()).or(schemas_boolean()).or(anyFunction),
|
6609
6616
|
inject: schemas_enum([
|
6610
6617
|
"head",
|
6611
6618
|
"body"
|
@@ -6640,7 +6647,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
6640
6647
|
minify: schemas_boolean(),
|
6641
6648
|
title: schemas_string(),
|
6642
6649
|
favicon: schemas_string(),
|
6643
|
-
meta:
|
6650
|
+
meta: schemas_record(schemas_string(), schemas_string().or(schemas_record(schemas_string(), schemas_string()))),
|
6644
6651
|
hash: schemas_boolean()
|
6645
6652
|
}).partial());
|
6646
6653
|
function isZodErrorLike(err) {
|
@@ -7088,9 +7095,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7088
7095
|
return !1;
|
7089
7096
|
}
|
7090
7097
|
}
|
7091
|
-
let compilationOptionsMap = new WeakMap(),
|
7092
|
-
var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
|
7093
|
-
let hooks_compilationHooksMap = new WeakMap(), HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
|
7098
|
+
let compilationOptionsMap = new WeakMap(), hooks_compilationHooksMap = new WeakMap(), HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
|
7094
7099
|
let templateFn, templateParameters, filenames;
|
7095
7100
|
validate(c, getHtmlPluginOptionsSchema);
|
7096
7101
|
let uid = HTML_PLUGIN_UID++, meta = {};
|
@@ -7159,7 +7164,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7159
7164
|
let context = this.options.context || process.cwd(), templateFilePath = external_node_path_default().resolve(context, filename);
|
7160
7165
|
if (!external_node_fs_default().existsSync(templateFilePath)) throw Error(`HtmlRspackPlugin: could not load file \`${filename}\` from \`${context}\``);
|
7161
7166
|
try {
|
7162
|
-
let renderer =
|
7167
|
+
let renderer = await async function(id) {
|
7168
|
+
return require(id);
|
7169
|
+
}(templateFilePath);
|
7163
7170
|
if (!1 === c.templateParameters) return await renderer({});
|
7164
7171
|
return await renderer(generateRenderData(data));
|
7165
7172
|
} catch (e) {
|
@@ -7304,7 +7311,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7304
7311
|
test
|
7305
7312
|
}), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", noop = (_req, _res, next)=>{
|
7306
7313
|
"function" == typeof next && next();
|
7307
|
-
};
|
7314
|
+
}, DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN = "The `experiments.lazyCompilation` option is deprecated, please use the configuration top level `lazyCompilation` instead.", REPEAT_LAZY_COMPILATION_OPTIONS_WARN = "Both top-level `lazyCompilation` and `experiments.lazyCompilation` options are set. The top-level `lazyCompilation` configuration will take precedence.";
|
7308
7315
|
function applyPlugin(compiler, moduleToIndex, indexToModule, options, activeModules, filesByKey) {
|
7309
7316
|
new BuiltinLazyCompilationPlugin(({ module, path })=>{
|
7310
7317
|
let compiler1, index = moduleToIndex.get(module);
|
@@ -7611,28 +7618,27 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7611
7618
|
});
|
7612
7619
|
});
|
7613
7620
|
}), "string" == typeof this.options.htmlPlugin && this.options.htmlPlugin !== NATIVE_HTML_PLUGIN) {
|
7614
|
-
let
|
7621
|
+
let self = this;
|
7615
7622
|
try {
|
7616
|
-
|
7617
|
-
getHooks = htmlPlugin.getCompilationHooks || htmlPlugin.getHooks;
|
7623
|
+
var obj, htmlPlugin = require(this.options.htmlPlugin);
|
7624
|
+
let getHooks = htmlPlugin.getCompilationHooks || htmlPlugin.getHooks;
|
7625
|
+
"function" == typeof getHooks && compiler.hooks.thisCompilation.tap(SubresourceIntegrityPlugin_PLUGIN_NAME, (compilation)=>{
|
7626
|
+
if ("string" == typeof compiler.options.output.chunkLoading && [
|
7627
|
+
"require",
|
7628
|
+
"async-node"
|
7629
|
+
].includes(compiler.options.output.chunkLoading)) return;
|
7630
|
+
let hwpHooks = getHooks(compilation);
|
7631
|
+
hwpHooks.beforeAssetTagGeneration.tapPromise(SubresourceIntegrityPlugin_PLUGIN_NAME, async (data)=>(self.handleHwpPluginArgs(data), data)), hwpHooks.alterAssetTagGroups.tapPromise({
|
7632
|
+
name: SubresourceIntegrityPlugin_PLUGIN_NAME,
|
7633
|
+
stage: 10000
|
7634
|
+
}, async (data)=>(self.handleHwpBodyTags(data, compiler.outputPath, compiler.options.output.crossOriginLoading), data));
|
7635
|
+
});
|
7618
7636
|
} catch (e) {
|
7619
|
-
var obj;
|
7620
7637
|
if (!((obj = e) instanceof Error && "code" in obj && [
|
7621
7638
|
"string",
|
7622
7639
|
"undefined"
|
7623
7640
|
].includes(typeof obj.code)) || "MODULE_NOT_FOUND" !== e.code) throw e;
|
7624
7641
|
}
|
7625
|
-
"function" == typeof getHooks && compiler.hooks.thisCompilation.tap(SubresourceIntegrityPlugin_PLUGIN_NAME, (compilation)=>{
|
7626
|
-
if ("string" == typeof compiler.options.output.chunkLoading && [
|
7627
|
-
"require",
|
7628
|
-
"async-node"
|
7629
|
-
].includes(compiler.options.output.chunkLoading)) return;
|
7630
|
-
let hwpHooks = getHooks(compilation);
|
7631
|
-
hwpHooks.beforeAssetTagGeneration.tapPromise(SubresourceIntegrityPlugin_PLUGIN_NAME, async (data)=>(this.handleHwpPluginArgs(data), data)), hwpHooks.alterAssetTagGroups.tapPromise({
|
7632
|
-
name: SubresourceIntegrityPlugin_PLUGIN_NAME,
|
7633
|
-
stage: 10000
|
7634
|
-
}, async (data)=>(this.handleHwpBodyTags(data, compiler.outputPath, compiler.options.output.crossOriginLoading), data));
|
7635
|
-
});
|
7636
7642
|
}
|
7637
7643
|
}
|
7638
7644
|
}
|
@@ -8574,7 +8580,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
8574
8580
|
if ("function" != typeof options.entry) for (let key of Object.keys(options.entry))defaults_F(options.entry[key], "import", ()=>[
|
8575
8581
|
"./src"
|
8576
8582
|
]);
|
8577
|
-
defaults_F(options, "devtool", ()=>!!development && "eval"), D(options, "watch", !1), D(options, "profile", !1), D(options, "bail", !1), defaults_F(options, "cache", ()=>development), applyExperimentsDefaults(options.experiments, {
|
8583
|
+
defaults_F(options, "devtool", ()=>!!development && "eval"), D(options, "watch", !1), D(options, "profile", !1), D(options, "lazyCompilation", !1), D(options, "bail", !1), defaults_F(options, "cache", ()=>development), applyExperimentsDefaults(options.experiments, {
|
8578
8584
|
production,
|
8579
8585
|
development
|
8580
8586
|
}), !1 === options.cache && (options.experiments.cache = !1), applySnapshotDefaults(options.snapshot, {
|
@@ -8584,7 +8590,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
8584
8590
|
css: options.experiments.css,
|
8585
8591
|
targetProperties,
|
8586
8592
|
mode: options.mode,
|
8587
|
-
uniqueName: options.output.uniqueName
|
8593
|
+
uniqueName: options.output.uniqueName,
|
8594
|
+
inlineConst: options.experiments.inlineConst
|
8588
8595
|
}), applyOutputDefaults(options.output, {
|
8589
8596
|
context: options.context,
|
8590
8597
|
targetProperties,
|
@@ -8616,17 +8623,20 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
8616
8623
|
}), options.resolve), options.resolveLoader = cleverMerge(getResolveLoaderDefaults(), options.resolveLoader);
|
8617
8624
|
}, applyInfrastructureLoggingDefaults = (infrastructureLogging)=>{
|
8618
8625
|
defaults_F(infrastructureLogging, "stream", ()=>process.stderr);
|
8619
|
-
let tty = infrastructureLogging.stream
|
8626
|
+
let tty = infrastructureLogging.stream?.isTTY && "dumb" !== process.env.TERM;
|
8620
8627
|
D(infrastructureLogging, "level", "info"), D(infrastructureLogging, "debug", !1), D(infrastructureLogging, "colors", tty), D(infrastructureLogging, "appendOnly", !tty);
|
8621
8628
|
}, applyExperimentsDefaults = (experiments, { production, development })=>{
|
8622
|
-
defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1);
|
8629
|
+
defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), !1 === experiments.topLevelAwait && console.warn("`experiments.topLevelAwait` config has been deprecated and will be removed in Rspack v2.0. Top-level await will be always enabled. Please remove this option from your Rspack configuration."), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !1);
|
8623
8630
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
8624
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.
|
8625
|
-
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
|
8626
|
-
|
8627
|
-
|
8628
|
-
|
8629
|
-
|
8631
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.5.0-beta.0"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
8632
|
+
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName, inlineConst })=>{
|
8633
|
+
if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), ((parserOptions, { inlineConst })=>{
|
8634
|
+
D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
|
8635
|
+
"..."
|
8636
|
+
]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", inlineConst), D(parserOptions, "typeReexportsPresence", "no-tolerant");
|
8637
|
+
})(module.parser.javascript, {
|
8638
|
+
inlineConst
|
8639
|
+
}), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, "JSONParse", !0), css) {
|
8630
8640
|
defaults_F(module.parser, "css", ()=>({})), assertNotNill(module.parser.css), D(module.parser.css, "namedExports", !0), D(module.parser.css, "url", !0), defaults_F(module.parser, "css/auto", ()=>({})), assertNotNill(module.parser["css/auto"]), D(module.parser["css/auto"], "namedExports", !0), D(module.parser["css/auto"], "url", !0), defaults_F(module.parser, "css/module", ()=>({})), assertNotNill(module.parser["css/module"]), D(module.parser["css/module"], "namedExports", !0), D(module.parser["css/module"], "url", !0), defaults_F(module.generator, "css", ()=>({})), assertNotNill(module.generator.css), D(module.generator.css, "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator.css, "esModule", !0), defaults_F(module.generator, "css/auto", ()=>({})), assertNotNill(module.generator["css/auto"]), D(module.generator["css/auto"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/auto"], "exportsConvention", "as-is");
|
8631
8641
|
let localIdentName = uniqueName && uniqueName.length > 0 ? "[uniqueName]-[id]-[local]" : "[id]-[local]";
|
8632
8642
|
D(module.generator["css/auto"], "localIdentName", localIdentName), D(module.generator["css/auto"], "esModule", !0), defaults_F(module.generator, "css/module", ()=>({})), assertNotNill(module.generator["css/module"]), D(module.generator["css/module"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/module"], "exportsConvention", "as-is"), D(module.generator["css/module"], "localIdentName", localIdentName), D(module.generator["css/module"], "esModule", !0);
|
@@ -8810,7 +8820,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
8810
8820
|
}), defaults_F(output, "cssChunkFilename", ()=>{
|
8811
8821
|
let chunkFilename = output.chunkFilename;
|
8812
8822
|
return "function" != typeof chunkFilename ? chunkFilename.replace(/\.[mc]?js(\?|$)/, ".css$1") : "[id].css";
|
8813
|
-
}), D(output, "hotUpdateChunkFilename", `[id].[fullhash].hot-update.${output.module ? "mjs" : "js"}`),
|
8823
|
+
}), D(output, "hotUpdateChunkFilename", `[id].[fullhash].hot-update.${output.module ? "mjs" : "js"}`), defaults_F(output, "hotUpdateMainFilename", ()=>`[runtime].[fullhash].hot-update.${output.module ? "json.mjs" : "json"}`);
|
8814
8824
|
let uniqueNameId = Template.toIdentifier(output.uniqueName);
|
8815
8825
|
defaults_F(output, "hotUpdateGlobal", ()=>`webpackHotUpdate${uniqueNameId}`), defaults_F(output, "chunkLoadingGlobal", ()=>`webpackChunk${uniqueNameId}`), D(output, "assetModuleFilename", "[hash][ext][query]"), D(output, "webassemblyModuleFilename", "[hash].module.wasm"), D(output, "compareBeforeEmit", !0), defaults_F(output, "path", ()=>external_node_path_default().join(process.cwd(), "dist")), defaults_F(output, "pathinfo", ()=>development), D(output, "publicPath", tp && (tp.document || tp.importScripts) ? "auto" : ""), D(output, "hashFunction", "xxhash64"), D(output, "hashDigest", "hex"), D(output, "hashDigestLength", 16), D(output, "strictModuleErrorHandling", !1), output.library && defaults_F(output.library, "type", ()=>output.module ? "module" : "var"), defaults_F(output, "chunkFormat", ()=>{
|
8816
8826
|
if (tp) {
|
@@ -9264,7 +9274,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9264
9274
|
devServer: config.devServer,
|
9265
9275
|
profile: config.profile,
|
9266
9276
|
amd: config.amd,
|
9267
|
-
bail: config.bail
|
9277
|
+
bail: config.bail,
|
9278
|
+
lazyCompilation: optionalNestedConfig(config.lazyCompilation, (options)=>!0 === options ? {} : options)
|
9268
9279
|
};
|
9269
9280
|
}, getNormalizedEntryStatic = (entry)=>{
|
9270
9281
|
if ("string" == typeof entry) return {
|
@@ -9860,7 +9871,6 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9860
9871
|
}
|
9861
9872
|
class Resolver {
|
9862
9873
|
#binding;
|
9863
|
-
#childCache = new WeakMap();
|
9864
9874
|
constructor(binding){
|
9865
9875
|
this.#binding = binding;
|
9866
9876
|
}
|
@@ -9874,32 +9884,42 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9874
9884
|
callback(error, !!req && `${req.path.replace(/#/g, "\u200b#")}${req.query.replace(/#/g, "\u200b#")}${req.fragment}`, req);
|
9875
9885
|
});
|
9876
9886
|
}
|
9877
|
-
withOptions(options) {
|
9878
|
-
let cacheEntry = this.#childCache.get(options);
|
9879
|
-
if (void 0 !== cacheEntry) return cacheEntry;
|
9880
|
-
let { dependencyCategory, resolveToContext, ...resolve } = options, rawResolve = getRawResolve(resolve), resolver = new Resolver(this.#binding.withOptions({
|
9881
|
-
dependencyCategory,
|
9882
|
-
resolveToContext,
|
9883
|
-
...rawResolve
|
9884
|
-
}));
|
9885
|
-
return this.#childCache.set(options, resolver), resolver;
|
9886
|
-
}
|
9887
9887
|
}
|
9888
|
+
let EMPTY_RESOLVE_OPTIONS = {};
|
9888
9889
|
class ResolverFactory {
|
9889
9890
|
#binding;
|
9891
|
+
#cache = new Map();
|
9890
9892
|
static __to_binding(resolver_factory) {
|
9891
9893
|
return resolver_factory.#binding;
|
9892
9894
|
}
|
9893
|
-
constructor(pnp){
|
9894
|
-
this.#binding = new (binding_default()).JsResolverFactory(pnp);
|
9895
|
+
constructor(pnp, resolveOptions, loaderResolveOptions){
|
9896
|
+
this.#binding = new (binding_default()).JsResolverFactory(pnp, getRawResolve(resolveOptions), getRawResolve(loaderResolveOptions));
|
9895
9897
|
}
|
9896
|
-
|
9897
|
-
let {
|
9898
|
-
return new Resolver(this.#binding.get(type, {
|
9898
|
+
#create(type, resolveOptionsWithDepType) {
|
9899
|
+
let { dependencyType, resolveToContext, ...resolve } = resolveOptionsWithDepType, resolver = new Resolver(this.#binding.get(type, {
|
9899
9900
|
...getRawResolve(resolve),
|
9900
|
-
|
9901
|
+
dependencyType,
|
9901
9902
|
resolveToContext
|
9902
|
-
}));
|
9903
|
+
})), childCache = new WeakMap();
|
9904
|
+
return resolver.withOptions = (options)=>{
|
9905
|
+
let cacheEntry = childCache.get(options);
|
9906
|
+
if (void 0 !== cacheEntry) return cacheEntry;
|
9907
|
+
let mergedOptions = cachedCleverMerge(resolveOptionsWithDepType, options), newResolver = this.get(type, mergedOptions);
|
9908
|
+
return childCache.set(options, newResolver), newResolver;
|
9909
|
+
}, resolver;
|
9910
|
+
}
|
9911
|
+
get(type, resolveOptions = EMPTY_RESOLVE_OPTIONS) {
|
9912
|
+
let typedCaches = this.#cache.get(type);
|
9913
|
+
typedCaches || (typedCaches = {
|
9914
|
+
direct: new WeakMap(),
|
9915
|
+
stringified: new Map()
|
9916
|
+
}, this.#cache.set(type, typedCaches));
|
9917
|
+
let cachedResolver = typedCaches.direct.get(resolveOptions);
|
9918
|
+
if (cachedResolver) return cachedResolver;
|
9919
|
+
let ident = JSON.stringify(resolveOptions), resolver = typedCaches.stringified.get(ident);
|
9920
|
+
if (resolver) return typedCaches.direct.set(resolveOptions, resolver), resolver;
|
9921
|
+
let newResolver = this.#create(type, resolveOptions);
|
9922
|
+
return typedCaches.direct.set(resolveOptions, newResolver), typedCaches.stringified.set(ident, newResolver), newResolver;
|
9903
9923
|
}
|
9904
9924
|
}
|
9905
9925
|
class RuleSetCompiler {
|
@@ -10251,7 +10271,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10251
10271
|
});
|
10252
10272
|
}
|
10253
10273
|
}
|
10254
|
-
let CORE_VERSION = "1.
|
10274
|
+
let CORE_VERSION = "1.5.0-beta.0", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
10255
10275
|
|
10256
10276
|
Help:
|
10257
10277
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
@@ -10262,6 +10282,119 @@ Help:
|
|
10262
10282
|
Please ensure the version of @rspack/binding and @rspack/core is the same.
|
10263
10283
|
The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
|
10264
10284
|
`;
|
10285
|
+
class NativeWatchFileSystem {
|
10286
|
+
#inner;
|
10287
|
+
#inputFileSystem;
|
10288
|
+
constructor(inputFileSystem){
|
10289
|
+
this.#inputFileSystem = inputFileSystem;
|
10290
|
+
}
|
10291
|
+
watch(files, directories, missing, _startTime, options, callback, callbackUndelayed) {
|
10292
|
+
if ((!files.added || "function" != typeof files.added[Symbol.iterator]) && (!files.removed || "function" != typeof files.removed[Symbol.iterator])) throw Error("Invalid arguments: 'files'");
|
10293
|
+
if ((!directories.added || "function" != typeof directories.added[Symbol.iterator]) && (!directories.removed || "function" != typeof directories.removed[Symbol.iterator])) throw Error("Invalid arguments: 'directories'");
|
10294
|
+
if ("function" != typeof callback) throw Error("Invalid arguments: 'callback'");
|
10295
|
+
if ("object" != typeof options) throw Error("Invalid arguments: 'options'");
|
10296
|
+
if ("function" != typeof callbackUndelayed && callbackUndelayed) throw Error("Invalid arguments: 'callbackUndelayed'");
|
10297
|
+
let nativeWatcher = this.getNativeWatcher(options);
|
10298
|
+
return nativeWatcher.watch([
|
10299
|
+
Array.from(files.added),
|
10300
|
+
Array.from(files.removed)
|
10301
|
+
], [
|
10302
|
+
Array.from(directories.added),
|
10303
|
+
Array.from(directories.removed)
|
10304
|
+
], [
|
10305
|
+
Array.from(missing.added),
|
10306
|
+
Array.from(missing.removed)
|
10307
|
+
], (err, result)=>{
|
10308
|
+
if (err) return void callback(err, new Map(), new Map(), new Set(), new Set());
|
10309
|
+
nativeWatcher.pause();
|
10310
|
+
let changedFiles = result.changedFiles, removedFiles = result.removedFiles;
|
10311
|
+
if (this.#inputFileSystem?.purge) {
|
10312
|
+
let fs = this.#inputFileSystem;
|
10313
|
+
for (let item of changedFiles)fs.purge?.(item);
|
10314
|
+
for (let item of removedFiles)fs.purge?.(item);
|
10315
|
+
}
|
10316
|
+
callback(err, new Map(), new Map(), new Set(changedFiles), new Set(removedFiles));
|
10317
|
+
}, (fileName)=>{
|
10318
|
+
callbackUndelayed(fileName, Date.now());
|
10319
|
+
}), {
|
10320
|
+
close: ()=>{
|
10321
|
+
nativeWatcher.close().then(()=>{
|
10322
|
+
this.#inner = void 0;
|
10323
|
+
}, (err)=>{
|
10324
|
+
console.error("Error closing native watcher:", err);
|
10325
|
+
});
|
10326
|
+
},
|
10327
|
+
pause: ()=>{
|
10328
|
+
nativeWatcher.pause();
|
10329
|
+
},
|
10330
|
+
getInfo: ()=>({
|
10331
|
+
changes: new Set(),
|
10332
|
+
removals: new Set(),
|
10333
|
+
fileTimeInfoEntries: new Map(),
|
10334
|
+
contextTimeInfoEntries: new Map()
|
10335
|
+
})
|
10336
|
+
};
|
10337
|
+
}
|
10338
|
+
getNativeWatcher(options) {
|
10339
|
+
if (this.#inner) return this.#inner;
|
10340
|
+
let nativeWatcherOptions = {
|
10341
|
+
followSymlinks: options.followSymlinks,
|
10342
|
+
aggregateTimeout: options.aggregateTimeout,
|
10343
|
+
pollInterval: "boolean" == typeof options.poll ? 0 : options.poll,
|
10344
|
+
ignored: ((ignored)=>{
|
10345
|
+
if (Array.isArray(ignored) || "string" == typeof ignored || ignored instanceof RegExp) return ignored;
|
10346
|
+
if ("function" == typeof ignored) throw Error("NativeWatcher does not support using a function for the 'ignored' option");
|
10347
|
+
})(options.ignored)
|
10348
|
+
}, nativeWatcher = new (binding_default()).NativeWatcher(nativeWatcherOptions);
|
10349
|
+
return this.#inner = nativeWatcher, nativeWatcher;
|
10350
|
+
}
|
10351
|
+
triggerEvent(kind, path) {
|
10352
|
+
this.#inner?.triggerEvent(kind, path);
|
10353
|
+
}
|
10354
|
+
}
|
10355
|
+
let VFILES_BY_COMPILER = new WeakMap();
|
10356
|
+
class VirtualModulesPlugin {
|
10357
|
+
#staticModules;
|
10358
|
+
#compiler;
|
10359
|
+
#store;
|
10360
|
+
constructor(modules){
|
10361
|
+
this.#staticModules = modules || null;
|
10362
|
+
}
|
10363
|
+
apply(compiler) {
|
10364
|
+
this.#compiler = compiler, compiler.hooks.afterEnvironment.tap("VirtualModulesPlugin", ()=>{
|
10365
|
+
let record = VFILES_BY_COMPILER.get(compiler) || {};
|
10366
|
+
if (this.#staticModules) for (let [filePath, content] of Object.entries(this.#staticModules))record[external_node_path_default().resolve(compiler.context, filePath)] = content;
|
10367
|
+
VFILES_BY_COMPILER.set(compiler, record);
|
10368
|
+
});
|
10369
|
+
}
|
10370
|
+
writeModule(filePath, contents) {
|
10371
|
+
var compiler, fullPath, time;
|
10372
|
+
if (!this.#compiler) throw Error("Plugin has not been initialized");
|
10373
|
+
let store = this.getVirtualFileStore(), fullPath1 = external_node_path_default().resolve(this.#compiler.context, filePath);
|
10374
|
+
store.writeVirtualFileSync(fullPath1, contents), compiler = this.#compiler, fullPath = fullPath1, time = Date.now(), compiler.watchFileSystem instanceof NativeWatchFileSystem ? compiler.watchFileSystem.triggerEvent("change", fullPath) : function(compiler, fullPath, time) {
|
10375
|
+
var fs;
|
10376
|
+
if (compiler.watchFileSystem && "watch" in (fs = compiler.watchFileSystem)) {
|
10377
|
+
let watcher = compiler.watchFileSystem.watcher;
|
10378
|
+
if (!watcher) return;
|
10379
|
+
let fileWatcher = watcher.fileWatchers.get(fullPath);
|
10380
|
+
fileWatcher && fileWatcher.watcher.emit("change", time, null);
|
10381
|
+
}
|
10382
|
+
}(compiler, fullPath, time);
|
10383
|
+
}
|
10384
|
+
getVirtualFileStore() {
|
10385
|
+
if (this.#store) return this.#store;
|
10386
|
+
let store = this.#compiler?.__internal__get_virtual_file_store();
|
10387
|
+
if (!store) throw Error("Virtual file store has not been initialized");
|
10388
|
+
return this.#store = store, store;
|
10389
|
+
}
|
10390
|
+
static __internal__take_virtual_files(compiler) {
|
10391
|
+
let record = VFILES_BY_COMPILER.get(compiler);
|
10392
|
+
if (record) return VFILES_BY_COMPILER.delete(compiler), Object.entries(record).map(([path, content])=>({
|
10393
|
+
path,
|
10394
|
+
content
|
10395
|
+
}));
|
10396
|
+
}
|
10397
|
+
}
|
10265
10398
|
class Watching {
|
10266
10399
|
watcher;
|
10267
10400
|
pausedWatcher;
|
@@ -10524,7 +10657,7 @@ Help:
|
|
10524
10657
|
"entry"
|
10525
10658
|
]),
|
10526
10659
|
additionalPass: new lite_tapable_namespaceObject.AsyncSeriesHook([])
|
10527
|
-
}, this.webpack = src_rspack, this.rspack = src_rspack, 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.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault()), new JsLoaderRspackPlugin(this).apply(this), new ExecuteModulePlugin().apply(this), new TraceHookPlugin().apply(this);
|
10660
|
+
}, this.webpack = src_rspack, this.rspack = src_rspack, 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.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader), new JsLoaderRspackPlugin(this).apply(this), new ExecuteModulePlugin().apply(this), new TraceHookPlugin().apply(this);
|
10528
10661
|
}
|
10529
10662
|
get recordsInputPath() {
|
10530
10663
|
return unsupported("Compiler.recordsInputPath");
|
@@ -10695,6 +10828,9 @@ Help:
|
|
10695
10828
|
let compilation = COMPILATION_WEAK_MAP.get(native);
|
10696
10829
|
return compilation || ((compilation = new Compilation(this, native)).name = this.name, COMPILATION_WEAK_MAP.set(native, compilation)), this.#compilation = compilation, compilation;
|
10697
10830
|
}
|
10831
|
+
__internal__get_virtual_file_store() {
|
10832
|
+
return this.#instance?.getVirtualFileStore();
|
10833
|
+
}
|
10698
10834
|
#resetThisCompilation() {
|
10699
10835
|
this.#compilation = void 0, this.hooks.thisCompilation.intercept({
|
10700
10836
|
call: ()=>{}
|
@@ -10797,7 +10933,7 @@ Help:
|
|
10797
10933
|
__references: {}
|
10798
10934
|
};
|
10799
10935
|
})(options, this);
|
10800
|
-
rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries());
|
10936
|
+
rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries()), rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
|
10801
10937
|
let instanceBinding = __webpack_require__("@rspack/binding");
|
10802
10938
|
this.#registers = this.#createHooksRegisters();
|
10803
10939
|
let inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
|
@@ -11449,7 +11585,7 @@ Help:
|
|
11449
11585
|
obj.children = this.stats.map((stat, idx)=>{
|
11450
11586
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
11451
11587
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
11452
|
-
}), childOptions.version && (obj.rspackVersion = "1.
|
11588
|
+
}), childOptions.version && (obj.rspackVersion = "1.5.0-beta.0", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
11453
11589
|
let mapError = (j, obj)=>({
|
11454
11590
|
...obj,
|
11455
11591
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
@@ -12349,7 +12485,7 @@ Help:
|
|
12349
12485
|
object.hash = context.getStatsCompilation(compilation).hash;
|
12350
12486
|
},
|
12351
12487
|
version: (object)=>{
|
12352
|
-
object.version = "5.75.0", object.rspackVersion = "1.
|
12488
|
+
object.version = "5.75.0", object.rspackVersion = "1.5.0-beta.0";
|
12353
12489
|
},
|
12354
12490
|
env: (object, _compilation, _context, { _env })=>{
|
12355
12491
|
object.env = _env;
|
@@ -13964,59 +14100,6 @@ Help:
|
|
13964
14100
|
true: 2,
|
13965
14101
|
verbose: 1
|
13966
14102
|
};
|
13967
|
-
class NativeWatchFileSystem {
|
13968
|
-
#inner;
|
13969
|
-
watch(files, directories, missing, _startTime, options, callback, callbackUndelayed) {
|
13970
|
-
if ((!files.added || "function" != typeof files.added[Symbol.iterator]) && (!files.removed || "function" != typeof files.removed[Symbol.iterator])) throw Error("Invalid arguments: 'files'");
|
13971
|
-
if ((!directories.added || "function" != typeof directories.added[Symbol.iterator]) && (!directories.removed || "function" != typeof directories.removed[Symbol.iterator])) throw Error("Invalid arguments: 'directories'");
|
13972
|
-
if ("function" != typeof callback) throw Error("Invalid arguments: 'callback'");
|
13973
|
-
if ("object" != typeof options) throw Error("Invalid arguments: 'options'");
|
13974
|
-
if ("function" != typeof callbackUndelayed && callbackUndelayed) throw Error("Invalid arguments: 'callbackUndelayed'");
|
13975
|
-
let nativeWatcher = this.getNativeWatcher(options);
|
13976
|
-
return nativeWatcher.watch([
|
13977
|
-
Array.from(files.added),
|
13978
|
-
Array.from(files.removed)
|
13979
|
-
], [
|
13980
|
-
Array.from(directories.added),
|
13981
|
-
Array.from(directories.removed)
|
13982
|
-
], [
|
13983
|
-
Array.from(missing.added),
|
13984
|
-
Array.from(missing.removed)
|
13985
|
-
], (err, result)=>{
|
13986
|
-
let { changedFiles, removedFiles } = result;
|
13987
|
-
callback(err, new Map(), new Map(), new Set(changedFiles), new Set(removedFiles));
|
13988
|
-
}, (fileName)=>{
|
13989
|
-
callbackUndelayed(fileName, Date.now());
|
13990
|
-
}), {
|
13991
|
-
close: ()=>{
|
13992
|
-
nativeWatcher.close();
|
13993
|
-
},
|
13994
|
-
pause: ()=>{
|
13995
|
-
nativeWatcher.pause();
|
13996
|
-
},
|
13997
|
-
getInfo: ()=>({
|
13998
|
-
changes: new Set(),
|
13999
|
-
removals: new Set(),
|
14000
|
-
fileTimeInfoEntries: new Map(),
|
14001
|
-
contextTimeInfoEntries: new Map()
|
14002
|
-
})
|
14003
|
-
};
|
14004
|
-
}
|
14005
|
-
getNativeWatcher(options) {
|
14006
|
-
if (this.#inner) return this.#inner;
|
14007
|
-
let nativeWatcherOptions = {
|
14008
|
-
followSymlinks: options.followSymlinks,
|
14009
|
-
aggregateTimeout: options.aggregateTimeout,
|
14010
|
-
pollInterval: "boolean" == typeof options.poll ? 0 : options.poll,
|
14011
|
-
ignored: ((ignored)=>{
|
14012
|
-
if (Array.isArray(ignored) || "string" == typeof ignored || ignored instanceof RegExp) return ignored;
|
14013
|
-
if ("function" == typeof ignored) throw Error("NativeWatcher does not support using a function for the 'ignored' option");
|
14014
|
-
if (ignored) throw Error(`Invalid option for 'ignored': ${ignored}`);
|
14015
|
-
})(options.ignored)
|
14016
|
-
}, nativeWatcher = new (binding_default()).NativeWatcher(nativeWatcherOptions);
|
14017
|
-
return this.#inner = nativeWatcher, nativeWatcher;
|
14018
|
-
}
|
14019
|
-
}
|
14020
14103
|
class NodeWatchFileSystem {
|
14021
14104
|
inputFileSystem;
|
14022
14105
|
watcherOptions;
|
@@ -14270,7 +14353,7 @@ Help:
|
|
14270
14353
|
})
|
14271
14354
|
});
|
14272
14355
|
let inputFileSystem = new (CachedInputFileSystem_default())(graceful_fs_index_js_default(), 60000);
|
14273
|
-
compiler.inputFileSystem = inputFileSystem, compiler.outputFileSystem = graceful_fs_index_js_default(), compiler.intermediateFileSystem = null, compiler.options.experiments.nativeWatcher ? compiler.watchFileSystem = new NativeWatchFileSystem() : compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem), compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler)=>{
|
14356
|
+
compiler.inputFileSystem = inputFileSystem, compiler.outputFileSystem = graceful_fs_index_js_default(), compiler.intermediateFileSystem = null, compiler.options.experiments.nativeWatcher ? compiler.watchFileSystem = new NativeWatchFileSystem(inputFileSystem) : compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem), compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler)=>{
|
14274
14357
|
compiler.inputFileSystem === inputFileSystem && (compiler.fsStartTime = Date.now(), inputFileSystem.purge?.());
|
14275
14358
|
});
|
14276
14359
|
}
|
@@ -14444,7 +14527,7 @@ Help:
|
|
14444
14527
|
const_to_let: schemas_boolean(),
|
14445
14528
|
module: schemas_boolean()
|
14446
14529
|
}).partial(), ZodSwcTerserMangleOptions = strictObject({
|
14447
|
-
props:
|
14530
|
+
props: schemas_record(schemas_string(), any()),
|
14448
14531
|
topLevel: schemas_boolean(),
|
14449
14532
|
toplevel: schemas_boolean(),
|
14450
14533
|
keepClassNames: schemas_boolean(),
|
@@ -14473,14 +14556,14 @@ Help:
|
|
14473
14556
|
]),
|
14474
14557
|
importSource: schemas_string()
|
14475
14558
|
}).partial(), ZodSwcConstModulesConfig = strictObject({
|
14476
|
-
globals:
|
14559
|
+
globals: schemas_record(schemas_string(), schemas_record(schemas_string(), schemas_string())).optional()
|
14477
14560
|
}), ZodSwcGlobalPassOption = strictObject({
|
14478
|
-
vars:
|
14561
|
+
vars: schemas_record(schemas_string(), schemas_string()),
|
14479
14562
|
envs: union([
|
14480
14563
|
schemas_string().array(),
|
14481
|
-
|
14564
|
+
schemas_record(schemas_string(), schemas_string())
|
14482
14565
|
]),
|
14483
|
-
typeofs:
|
14566
|
+
typeofs: schemas_record(schemas_string(), schemas_string())
|
14484
14567
|
}).partial(), ZodSwcOptimizerConfig = strictObject({
|
14485
14568
|
simplify: schemas_boolean(),
|
14486
14569
|
globals: ZodSwcGlobalPassOption,
|
@@ -14537,7 +14620,7 @@ Help:
|
|
14537
14620
|
cacheRoot: schemas_string(),
|
14538
14621
|
plugins: schemas_array(tuple([
|
14539
14622
|
schemas_string(),
|
14540
|
-
|
14623
|
+
schemas_record(schemas_string(), any())
|
14541
14624
|
])),
|
14542
14625
|
runPluginFirst: schemas_boolean(),
|
14543
14626
|
disableBuiltinTransformsForInternalTesting: schemas_boolean(),
|
@@ -14546,7 +14629,7 @@ Help:
|
|
14546
14629
|
keepImportAssertions: schemas_boolean()
|
14547
14630
|
}).partial(),
|
14548
14631
|
baseUrl: schemas_string(),
|
14549
|
-
paths:
|
14632
|
+
paths: schemas_record(schemas_string(), schemas_string().array()),
|
14550
14633
|
minify: ZodSwcJsMinifyOptions,
|
14551
14634
|
preserveAllComments: schemas_boolean(),
|
14552
14635
|
output: strictObject({
|
@@ -14586,7 +14669,7 @@ Help:
|
|
14586
14669
|
type: literal("commonjs")
|
14587
14670
|
}), ZodSwcUmdConfig = ZodSwcBaseModuleConfig.extend({
|
14588
14671
|
type: literal("umd"),
|
14589
|
-
globals:
|
14672
|
+
globals: schemas_record(schemas_string(), schemas_string()).optional()
|
14590
14673
|
}), ZodSwcAmdConfig = ZodSwcBaseModuleConfig.extend({
|
14591
14674
|
type: literal("amd"),
|
14592
14675
|
moduleId: schemas_string().optional()
|
@@ -14736,7 +14819,7 @@ Help:
|
|
14736
14819
|
library: libraryOptions.optional(),
|
14737
14820
|
dependOn: entryDependOn.optional(),
|
14738
14821
|
layer: layer.optional()
|
14739
|
-
}), entryStatic =
|
14822
|
+
}), entryStatic = schemas_record(schemas_string(), entryItem.or(entryDescription)).or(entryItem), entry = entryStatic.or(anyFunction), path = schemas_string(), pathinfo = schemas_boolean().or(literal("verbose")), webassemblyModuleFilename = schemas_string(), crossOriginLoading = literal(!1).or(schemas_enum([
|
14740
14823
|
"anonymous",
|
14741
14824
|
"use-credentials"
|
14742
14825
|
])), hotUpdateGlobal = schemas_string(), uniqueName = schemas_string(), chunkLoadingGlobal = schemas_string(), enabledLibraryTypes = schemas_array(libraryType), clean = union([
|
@@ -14826,7 +14909,7 @@ Help:
|
|
14826
14909
|
charset: schemas_boolean(),
|
14827
14910
|
environment: environment,
|
14828
14911
|
compareBeforeEmit: schemas_boolean()
|
14829
|
-
}).partial(), resolveAlias =
|
14912
|
+
}).partial(), resolveAlias = schemas_record(schemas_string(), literal(!1).or(schemas_string()).or(schemas_array(schemas_string().or(literal(!1))))).or(literal(!1)), resolveTsConfigFile = schemas_string(), resolveTsConfig = resolveTsConfigFile.or(strictObject({
|
14830
14913
|
configFile: resolveTsConfigFile,
|
14831
14914
|
references: schemas_array(schemas_string()).or(literal("auto")).optional()
|
14832
14915
|
})), resolveOptions = strictObject({
|
@@ -14846,18 +14929,18 @@ Help:
|
|
14846
14929
|
tsConfig: resolveTsConfig,
|
14847
14930
|
fullySpecified: schemas_boolean(),
|
14848
14931
|
exportsFields: schemas_array(schemas_string()),
|
14849
|
-
extensionAlias:
|
14932
|
+
extensionAlias: schemas_record(schemas_string(), schemas_string().or(schemas_array(schemas_string()))),
|
14850
14933
|
aliasFields: schemas_array(schemas_string()),
|
14851
14934
|
restrictions: schemas_array(schemas_string()),
|
14852
14935
|
roots: schemas_array(schemas_string()),
|
14853
14936
|
pnp: schemas_boolean()
|
14854
14937
|
}).partial().extend({
|
14855
|
-
byDependency: lazy(()=>
|
14938
|
+
byDependency: lazy(()=>schemas_record(schemas_string(), resolveOptions)).optional()
|
14856
14939
|
}), ruleSetCondition = _instanceof(RegExp).or(schemas_string()).or(anyFunction).or(lazy(()=>ruleSetConditions)).or(lazy(()=>ruleSetLogicalConditions)), ruleSetConditions = lazy(()=>schemas_array(ruleSetCondition)), ruleSetLogicalConditions = strictObject({
|
14857
14940
|
and: ruleSetConditions,
|
14858
14941
|
or: ruleSetConditions,
|
14859
14942
|
not: ruleSetCondition
|
14860
|
-
}).partial(), ruleSetLoader = schemas_string(), ruleSetLoaderOptions = schemas_string().or(
|
14943
|
+
}).partial(), ruleSetLoader = schemas_string(), ruleSetLoaderOptions = schemas_string().or(schemas_record(schemas_string(), any())), ruleSetLoaderWithOptions = strictObject({
|
14861
14944
|
ident: schemas_string().optional(),
|
14862
14945
|
loader: ruleSetLoader,
|
14863
14946
|
options: ruleSetLoaderOptions.optional(),
|
@@ -14891,15 +14974,15 @@ Help:
|
|
14891
14974
|
resourceQuery: ruleSetCondition,
|
14892
14975
|
scheme: ruleSetCondition,
|
14893
14976
|
mimetype: ruleSetCondition,
|
14894
|
-
descriptionData:
|
14895
|
-
with:
|
14977
|
+
descriptionData: schemas_record(schemas_string(), ruleSetCondition),
|
14978
|
+
with: schemas_record(schemas_string(), ruleSetCondition),
|
14896
14979
|
type: schemas_string(),
|
14897
14980
|
layer: schemas_string(),
|
14898
14981
|
loader: ruleSetLoader,
|
14899
14982
|
options: ruleSetLoaderOptions,
|
14900
14983
|
use: ruleSetUse,
|
14901
|
-
parser:
|
14902
|
-
generator:
|
14984
|
+
parser: schemas_record(schemas_string(), any()),
|
14985
|
+
generator: schemas_record(schemas_string(), any()),
|
14903
14986
|
resolve: resolveOptions,
|
14904
14987
|
sideEffects: schemas_boolean(),
|
14905
14988
|
enforce: literal("pre").or(literal("post"))
|
@@ -15077,12 +15160,12 @@ Help:
|
|
15077
15160
|
literal(!1),
|
15078
15161
|
allowTarget,
|
15079
15162
|
allowTarget.array()
|
15080
|
-
]), externalItemObjectValue =
|
15163
|
+
]), externalItemObjectValue = schemas_record(schemas_string(), schemas_string().or(schemas_string().array())), externalItemUmdValue = strictObject({
|
15081
15164
|
root: schemas_string().or(schemas_string().array()),
|
15082
15165
|
commonjs: schemas_string().or(schemas_string().array()),
|
15083
15166
|
commonjs2: schemas_string().or(schemas_string().array()),
|
15084
15167
|
amd: schemas_string().or(schemas_string().array())
|
15085
|
-
}), externalItemValue = schemas_string().or(schemas_boolean()).or(schemas_string().array().min(1)).or(externalItemObjectValue), externalItemObjectUnknown =
|
15168
|
+
}), externalItemValue = schemas_string().or(schemas_boolean()).or(schemas_string().array().min(1)).or(externalItemObjectValue), externalItemObjectUnknown = schemas_record(schemas_string(), externalItemValue), externalItem = schemas_string().or(_instanceof(RegExp)).or(externalItemObjectUnknown).or(anyFunction), externals = externalItem.array().or(externalItem), externalsPresets = strictObject({
|
15086
15169
|
node: schemas_boolean(),
|
15087
15170
|
web: schemas_boolean(),
|
15088
15171
|
webAsync: schemas_boolean(),
|
@@ -15121,7 +15204,7 @@ Help:
|
|
15121
15204
|
"node-module"
|
15122
15205
|
])),
|
15123
15206
|
global: schemas_boolean().or(literal("warn"))
|
15124
|
-
}).partial(), node = literal(!1).or(nodeOptions), loader =
|
15207
|
+
}).partial(), node = literal(!1).or(nodeOptions), loader = schemas_record(schemas_string(), any()), snapshotOptions = strictObject({}), cacheOptions = schemas_boolean(), statsPresets = schemas_enum([
|
15125
15208
|
"normal",
|
15126
15209
|
"none",
|
15127
15210
|
"verbose",
|
@@ -15226,7 +15309,7 @@ Help:
|
|
15226
15309
|
"initial",
|
15227
15310
|
"async",
|
15228
15311
|
"all"
|
15229
|
-
]).or(_instanceof(RegExp)).or(anyFunction), optimizationSplitChunksSizes = numberOrInfinity.or(
|
15312
|
+
]).or(_instanceof(RegExp)).or(anyFunction), optimizationSplitChunksSizes = numberOrInfinity.or(schemas_record(schemas_string(), numberOrInfinity)), sharedOptimizationSplitChunksCacheGroup = {
|
15230
15313
|
chunks: optimizationSplitChunksChunks,
|
15231
15314
|
defaultSizeTypes: schemas_array(schemas_string()),
|
15232
15315
|
minChunks: schemas_number().min(1).or(literal(1 / 0)),
|
@@ -15251,7 +15334,7 @@ Help:
|
|
15251
15334
|
layer: schemas_string().or(_instanceof(RegExp)).or(anyFunction),
|
15252
15335
|
...sharedOptimizationSplitChunksCacheGroup
|
15253
15336
|
}).partial(), optimizationSplitChunksOptions = strictObject({
|
15254
|
-
cacheGroups:
|
15337
|
+
cacheGroups: schemas_record(schemas_string(), literal(!1).or(optimizationSplitChunksCacheGroup)),
|
15255
15338
|
fallbackCacheGroup: strictObject({
|
15256
15339
|
chunks: optimizationSplitChunksChunks,
|
15257
15340
|
minSize: numberOrInfinity,
|
@@ -15388,6 +15471,7 @@ Help:
|
|
15388
15471
|
inlineConst: schemas_boolean(),
|
15389
15472
|
inlineEnum: schemas_boolean(),
|
15390
15473
|
typeReexportsPresence: schemas_boolean(),
|
15474
|
+
lazyBarrel: schemas_boolean(),
|
15391
15475
|
nativeWatcher: schemas_boolean()
|
15392
15476
|
}).partial(), watch = schemas_boolean(), watchOptions = strictObject({
|
15393
15477
|
aggregateTimeout: numberOrInfinity,
|
@@ -15399,7 +15483,7 @@ Help:
|
|
15399
15483
|
file: _instanceof(RegExp).optional(),
|
15400
15484
|
message: _instanceof(RegExp).optional(),
|
15401
15485
|
module: _instanceof(RegExp).optional()
|
15402
|
-
})).array(), profile = schemas_boolean(), amd = literal(!1).or(
|
15486
|
+
})).array(), profile = schemas_boolean(), amd = literal(!1).or(schemas_record(schemas_string(), any())), bail = schemas_boolean(), performance = strictObject({
|
15403
15487
|
assetFilter: anyFunction,
|
15404
15488
|
hints: schemas_enum([
|
15405
15489
|
"error",
|
@@ -15443,7 +15527,8 @@ Help:
|
|
15443
15527
|
profile: profile,
|
15444
15528
|
amd: amd,
|
15445
15529
|
bail: bail,
|
15446
|
-
performance: performance
|
15530
|
+
performance: performance,
|
15531
|
+
lazyCompilation: schemas_boolean().or(lazyCompilationOptions).optional()
|
15447
15532
|
}).partial().check((ctx)=>{
|
15448
15533
|
let config = ctx.value, library = config?.output?.library;
|
15449
15534
|
function checkExternalItem(externalItem, path) {
|
@@ -15730,7 +15815,7 @@ Help:
|
|
15730
15815
|
let _options = JSON.stringify(options || {});
|
15731
15816
|
return binding_default().transform(source, _options);
|
15732
15817
|
}
|
15733
|
-
let exports_rspackVersion = "1.
|
15818
|
+
let exports_rspackVersion = "1.5.0-beta.0", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
15734
15819
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
15735
15820
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
15736
15821
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
@@ -15927,11 +16012,12 @@ Help:
|
|
15927
16012
|
SubresourceIntegrityPlugin: SubresourceIntegrityPlugin,
|
15928
16013
|
lazyCompilationMiddleware: (compiler)=>{
|
15929
16014
|
if (compiler instanceof MultiCompiler) {
|
15930
|
-
let middlewareByCompiler = new Map(), i = 0;
|
16015
|
+
let middlewareByCompiler = new Map(), i = 0, isReportDeprecatedWarned = !1, isReportRepeatWarned = !1;
|
15931
16016
|
for (let c of compiler.compilers){
|
15932
|
-
if (!c.options.experiments.lazyCompilation) continue;
|
16017
|
+
if (c.options.experiments.lazyCompilation && (c.name ? console.warn(`The 'experiments.lazyCompilation' option in compiler named '${c.name}' is deprecated, please use the Configuration top level 'lazyCompilation' instead.`) : isReportDeprecatedWarned || (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), isReportDeprecatedWarned = !0)), c.options.lazyCompilation && c.options.experiments.lazyCompilation && (c.name ? console.warn(`The top-level 'lazyCompilation' option in compiler named '${c.name}' will override the 'experiments.lazyCompilation' option.`) : isReportRepeatWarned || (console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN), isReportRepeatWarned = !0)), !c.options.lazyCompilation && !c.options.experiments.lazyCompilation) continue;
|
15933
16018
|
let options = {
|
15934
|
-
...c.options.experiments.lazyCompilation
|
16019
|
+
...c.options.experiments.lazyCompilation,
|
16020
|
+
...c.options.lazyCompilation
|
15935
16021
|
}, prefix = options.prefix || LAZY_COMPILATION_PREFIX;
|
15936
16022
|
options.prefix = `${prefix}__${i++}`;
|
15937
16023
|
let activeModules = new Map(), filesByKey = new Map(), indexToModule = new Map(), moduleToIndex = new Map();
|
@@ -15947,9 +16033,10 @@ Help:
|
|
15947
16033
|
return middleware?.(req, res, next);
|
15948
16034
|
};
|
15949
16035
|
}
|
15950
|
-
if (!compiler.options.experiments.lazyCompilation) return noop;
|
16036
|
+
if (compiler.options.experiments.lazyCompilation && (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), compiler.options.lazyCompilation && console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN)), !compiler.options.lazyCompilation && !compiler.options.experiments.lazyCompilation) return noop;
|
15951
16037
|
let activeModules = new Map(), filesByKey = new Map(), indexToMap = new Map(), moduleToIndex = new Map(), options = {
|
15952
|
-
...compiler.options.experiments.lazyCompilation
|
16038
|
+
...compiler.options.experiments.lazyCompilation,
|
16039
|
+
...compiler.options.lazyCompilation
|
15953
16040
|
};
|
15954
16041
|
return applyPlugin(compiler, moduleToIndex, indexToMap, options, activeModules, filesByKey), lazyCompilationMiddlewareInternal(compiler, indexToMap, activeModules, filesByKey, options.prefix || LAZY_COMPILATION_PREFIX);
|
15955
16042
|
},
|
@@ -15965,6 +16052,12 @@ Help:
|
|
15965
16052
|
return binding_default().transformSync(source, _options);
|
15966
16053
|
}
|
15967
16054
|
},
|
16055
|
+
resolver: {
|
16056
|
+
ResolverFactory: binding_.ResolverFactory,
|
16057
|
+
EnforceExtension: binding_.EnforceExtension,
|
16058
|
+
async: binding_.async,
|
16059
|
+
sync: binding_.sync
|
16060
|
+
},
|
15968
16061
|
CssChunkingPlugin: CssChunkingPlugin,
|
15969
16062
|
createNativePlugin: function(name, resolve, affectedHooks) {
|
15970
16063
|
if (INTERNAL_PLUGIN_NAMES.includes(name)) throw Error(`Cannot register native plugin with name '${name}', it conflicts with internal plugin names.`);
|
@@ -16028,7 +16121,7 @@ Help:
|
|
16028
16121
|
}, exports_namespaceObject);
|
16029
16122
|
src_fn.rspack = src_fn, src_fn.webpack = src_fn;
|
16030
16123
|
let src_rspack = src_fn, src_0 = src_rspack;
|
16031
|
-
})(), exports.AsyncDependenciesBlock = __webpack_exports__.AsyncDependenciesBlock, exports.BannerPlugin = __webpack_exports__.BannerPlugin, exports.CircularDependencyRspackPlugin = __webpack_exports__.CircularDependencyRspackPlugin, exports.Compilation = __webpack_exports__.Compilation, exports.Compiler = __webpack_exports__.Compiler, exports.ConcatenatedModule = __webpack_exports__.ConcatenatedModule, exports.ContextModule = __webpack_exports__.ContextModule, exports.ContextReplacementPlugin = __webpack_exports__.ContextReplacementPlugin, exports.CopyRspackPlugin = __webpack_exports__.CopyRspackPlugin, exports.CssExtractRspackPlugin = __webpack_exports__.CssExtractRspackPlugin, exports.DefinePlugin = __webpack_exports__.DefinePlugin, exports.Dependency = __webpack_exports__.Dependency, exports.DllPlugin = __webpack_exports__.DllPlugin, exports.DllReferencePlugin = __webpack_exports__.DllReferencePlugin, exports.DynamicEntryPlugin = __webpack_exports__.DynamicEntryPlugin, exports.EntryDependency = __webpack_exports__.EntryDependency, exports.EntryOptionPlugin = __webpack_exports__.EntryOptionPlugin, exports.EntryPlugin = __webpack_exports__.EntryPlugin, exports.EnvironmentPlugin = __webpack_exports__.EnvironmentPlugin, exports.EvalDevToolModulePlugin = __webpack_exports__.EvalDevToolModulePlugin, exports.EvalSourceMapDevToolPlugin = __webpack_exports__.EvalSourceMapDevToolPlugin, exports.ExternalModule = __webpack_exports__.ExternalModule, exports.ExternalsPlugin = __webpack_exports__.ExternalsPlugin, exports.HotModuleReplacementPlugin = __webpack_exports__.HotModuleReplacementPlugin, exports.HtmlRspackPlugin = __webpack_exports__.HtmlRspackPlugin, exports.IgnorePlugin = __webpack_exports__.IgnorePlugin, exports.LightningCssMinimizerRspackPlugin = __webpack_exports__.LightningCssMinimizerRspackPlugin, exports.LoaderOptionsPlugin = __webpack_exports__.LoaderOptionsPlugin, exports.LoaderTargetPlugin = __webpack_exports__.LoaderTargetPlugin, exports.Module = __webpack_exports__.Module, exports.ModuleFilenameHelpers = __webpack_exports__.ModuleFilenameHelpers, exports.MultiCompiler = __webpack_exports__.MultiCompiler, exports.MultiStats = __webpack_exports__.MultiStats, exports.NoEmitOnErrorsPlugin = __webpack_exports__.NoEmitOnErrorsPlugin, exports.NormalModule = __webpack_exports__.NormalModule, exports.NormalModuleReplacementPlugin = __webpack_exports__.NormalModuleReplacementPlugin, exports.ProgressPlugin = __webpack_exports__.ProgressPlugin, exports.ProvidePlugin = __webpack_exports__.ProvidePlugin, exports.RspackOptionsApply = __webpack_exports__.RspackOptionsApply, exports.RuntimeGlobals = __webpack_exports__.RuntimeGlobals, exports.RuntimeModule = __webpack_exports__.RuntimeModule, exports.RuntimePlugin = __webpack_exports__.RuntimePlugin, exports.SourceMapDevToolPlugin = __webpack_exports__.SourceMapDevToolPlugin, exports.Stats = __webpack_exports__.Stats, exports.StatsErrorCode = __webpack_exports__.StatsErrorCode, exports.SwcJsMinimizerRspackPlugin = __webpack_exports__.SwcJsMinimizerRspackPlugin, exports.Template = __webpack_exports__.Template, exports.ValidationError = __webpack_exports__.ValidationError, exports.WarnCaseSensitiveModulesPlugin = __webpack_exports__.WarnCaseSensitiveModulesPlugin, exports.WebpackError = __webpack_exports__.WebpackError, exports.WebpackOptionsApply = __webpack_exports__.WebpackOptionsApply, exports.config = __webpack_exports__.config, exports.container = __webpack_exports__.container, exports.default = __webpack_exports__.default, exports.electron = __webpack_exports__.electron, exports.experiments = __webpack_exports__.experiments, exports.javascript = __webpack_exports__.javascript, exports.library = __webpack_exports__.library, exports.node = __webpack_exports__.node, exports.optimize = __webpack_exports__.optimize, exports.rspack = __webpack_exports__.rspack, exports.rspackVersion = __webpack_exports__.rspackVersion, exports.sharing = __webpack_exports__.sharing, exports.sources = __webpack_exports__.sources, exports.util = __webpack_exports__.util, exports.version = __webpack_exports__.version, exports.wasm = __webpack_exports__.wasm, exports.web = __webpack_exports__.web, exports.webworker = __webpack_exports__.webworker, __webpack_exports__)-1 === [
|
16124
|
+
})(), exports.AsyncDependenciesBlock = __webpack_exports__.AsyncDependenciesBlock, exports.BannerPlugin = __webpack_exports__.BannerPlugin, exports.CircularDependencyRspackPlugin = __webpack_exports__.CircularDependencyRspackPlugin, exports.Compilation = __webpack_exports__.Compilation, exports.Compiler = __webpack_exports__.Compiler, exports.ConcatenatedModule = __webpack_exports__.ConcatenatedModule, exports.ContextModule = __webpack_exports__.ContextModule, exports.ContextReplacementPlugin = __webpack_exports__.ContextReplacementPlugin, exports.CopyRspackPlugin = __webpack_exports__.CopyRspackPlugin, exports.CssExtractRspackPlugin = __webpack_exports__.CssExtractRspackPlugin, exports.DefinePlugin = __webpack_exports__.DefinePlugin, exports.Dependency = __webpack_exports__.Dependency, exports.DllPlugin = __webpack_exports__.DllPlugin, exports.DllReferencePlugin = __webpack_exports__.DllReferencePlugin, exports.DynamicEntryPlugin = __webpack_exports__.DynamicEntryPlugin, exports.EntryDependency = __webpack_exports__.EntryDependency, exports.EntryOptionPlugin = __webpack_exports__.EntryOptionPlugin, exports.EntryPlugin = __webpack_exports__.EntryPlugin, exports.EnvironmentPlugin = __webpack_exports__.EnvironmentPlugin, exports.EvalDevToolModulePlugin = __webpack_exports__.EvalDevToolModulePlugin, exports.EvalSourceMapDevToolPlugin = __webpack_exports__.EvalSourceMapDevToolPlugin, exports.ExternalModule = __webpack_exports__.ExternalModule, exports.ExternalsPlugin = __webpack_exports__.ExternalsPlugin, exports.HotModuleReplacementPlugin = __webpack_exports__.HotModuleReplacementPlugin, exports.HtmlRspackPlugin = __webpack_exports__.HtmlRspackPlugin, exports.IgnorePlugin = __webpack_exports__.IgnorePlugin, exports.LightningCssMinimizerRspackPlugin = __webpack_exports__.LightningCssMinimizerRspackPlugin, exports.LoaderOptionsPlugin = __webpack_exports__.LoaderOptionsPlugin, exports.LoaderTargetPlugin = __webpack_exports__.LoaderTargetPlugin, exports.Module = __webpack_exports__.Module, exports.ModuleFilenameHelpers = __webpack_exports__.ModuleFilenameHelpers, exports.MultiCompiler = __webpack_exports__.MultiCompiler, exports.MultiStats = __webpack_exports__.MultiStats, exports.NoEmitOnErrorsPlugin = __webpack_exports__.NoEmitOnErrorsPlugin, exports.NormalModule = __webpack_exports__.NormalModule, exports.NormalModuleReplacementPlugin = __webpack_exports__.NormalModuleReplacementPlugin, exports.ProgressPlugin = __webpack_exports__.ProgressPlugin, exports.ProvidePlugin = __webpack_exports__.ProvidePlugin, exports.RspackOptionsApply = __webpack_exports__.RspackOptionsApply, exports.RuntimeGlobals = __webpack_exports__.RuntimeGlobals, exports.RuntimeModule = __webpack_exports__.RuntimeModule, exports.RuntimePlugin = __webpack_exports__.RuntimePlugin, exports.SourceMapDevToolPlugin = __webpack_exports__.SourceMapDevToolPlugin, exports.Stats = __webpack_exports__.Stats, exports.StatsErrorCode = __webpack_exports__.StatsErrorCode, exports.SwcJsMinimizerRspackPlugin = __webpack_exports__.SwcJsMinimizerRspackPlugin, exports.Template = __webpack_exports__.Template, exports.ValidationError = __webpack_exports__.ValidationError, exports.VirtualModulesPlugin = __webpack_exports__.VirtualModulesPlugin, exports.WarnCaseSensitiveModulesPlugin = __webpack_exports__.WarnCaseSensitiveModulesPlugin, exports.WebpackError = __webpack_exports__.WebpackError, exports.WebpackOptionsApply = __webpack_exports__.WebpackOptionsApply, exports.config = __webpack_exports__.config, exports.container = __webpack_exports__.container, exports.default = __webpack_exports__.default, exports.electron = __webpack_exports__.electron, exports.experiments = __webpack_exports__.experiments, exports.javascript = __webpack_exports__.javascript, exports.library = __webpack_exports__.library, exports.node = __webpack_exports__.node, exports.optimize = __webpack_exports__.optimize, exports.rspack = __webpack_exports__.rspack, exports.rspackVersion = __webpack_exports__.rspackVersion, exports.sharing = __webpack_exports__.sharing, exports.sources = __webpack_exports__.sources, exports.util = __webpack_exports__.util, exports.version = __webpack_exports__.version, exports.wasm = __webpack_exports__.wasm, exports.web = __webpack_exports__.web, exports.webworker = __webpack_exports__.webworker, __webpack_exports__)-1 === [
|
16032
16125
|
"AsyncDependenciesBlock",
|
16033
16126
|
"BannerPlugin",
|
16034
16127
|
"CircularDependencyRspackPlugin",
|
@@ -16077,6 +16170,7 @@ Help:
|
|
16077
16170
|
"SwcJsMinimizerRspackPlugin",
|
16078
16171
|
"Template",
|
16079
16172
|
"ValidationError",
|
16173
|
+
"VirtualModulesPlugin",
|
16080
16174
|
"WarnCaseSensitiveModulesPlugin",
|
16081
16175
|
"WebpackError",
|
16082
16176
|
"WebpackOptionsApply",
|