@rspack/core 1.5.0-beta.0 → 1.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Module.d.ts +3 -14
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +10 -0
- package/dist/builtin-plugin/index.d.ts +1 -0
- package/dist/config/types.d.ts +5 -0
- package/dist/exports.d.ts +3 -3
- package/dist/index.js +61 -113
- package/dist/schema/config.d.ts +8 -4
- package/dist/worker.js +49 -50
- package/package.json +6 -7
- package/dist/lib/NormalModuleReplacementPlugin.d.ts +0 -29
package/dist/Module.d.ts
CHANGED
@@ -5,20 +5,9 @@ import "./BuildInfo";
|
|
5
5
|
export type ResourceDataWithData = ResourceData & {
|
6
6
|
data?: Record<string, any>;
|
7
7
|
};
|
8
|
-
export type CreateData =
|
9
|
-
export type ContextInfo =
|
10
|
-
|
11
|
-
issuerLayer?: string | null;
|
12
|
-
};
|
13
|
-
export type ResolveData = {
|
14
|
-
contextInfo: ContextInfo;
|
15
|
-
context: string;
|
16
|
-
request: string;
|
17
|
-
fileDependencies: string[];
|
18
|
-
missingDependencies: string[];
|
19
|
-
contextDependencies: string[];
|
20
|
-
createData?: CreateData;
|
21
|
-
};
|
8
|
+
export type CreateData = binding.JsCreateData;
|
9
|
+
export type ContextInfo = binding.ContextInfo;
|
10
|
+
export type ResolveData = binding.JsResolveData;
|
22
11
|
export declare class ContextModuleFactoryBeforeResolveData {
|
23
12
|
#private;
|
24
13
|
context: string;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { ResolveData } from "../Module";
|
2
|
+
export declare const NormalModuleReplacementPlugin: {
|
3
|
+
new (resourceRegExp: RegExp, newResource: string | ((data: ResolveData) => void)): {
|
4
|
+
name: string;
|
5
|
+
_args: [resourceRegExp: RegExp, newResource: string | ((data: ResolveData) => void)];
|
6
|
+
affectedHooks: "done" | "compilation" | "run" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
7
|
+
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
8
|
+
apply(compiler: import("..").Compiler): void;
|
9
|
+
};
|
10
|
+
};
|
@@ -58,6 +58,7 @@ export * from "./NaturalChunkIdsPlugin";
|
|
58
58
|
export * from "./NaturalModuleIdsPlugin";
|
59
59
|
export * from "./NodeTargetPlugin";
|
60
60
|
export * from "./NoEmitOnErrorsPlugin";
|
61
|
+
export * from "./NormalModuleReplacementPlugin";
|
61
62
|
export * from "./OccurrenceChunkIdsPlugin";
|
62
63
|
export * from "./ProgressPlugin";
|
63
64
|
export * from "./ProvidePlugin";
|
package/dist/config/types.d.ts
CHANGED
@@ -763,6 +763,11 @@ export type JavascriptParserOptions = {
|
|
763
763
|
* @default true
|
764
764
|
* */
|
765
765
|
exprContextCritical?: boolean;
|
766
|
+
/**
|
767
|
+
* Enable warnings for unknown dynamic dependencies
|
768
|
+
* @default true
|
769
|
+
* */
|
770
|
+
unknownContextCritical?: boolean;
|
766
771
|
/**
|
767
772
|
* Enable warnings for partial dynamic dependencies
|
768
773
|
* @default false
|
package/dist/exports.d.ts
CHANGED
@@ -56,7 +56,6 @@ export { default as EntryOptionPlugin } from "./lib/EntryOptionPlugin";
|
|
56
56
|
export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
|
57
57
|
export { LoaderOptionsPlugin } from "./lib/LoaderOptionsPlugin";
|
58
58
|
export { LoaderTargetPlugin } from "./lib/LoaderTargetPlugin";
|
59
|
-
export { NormalModuleReplacementPlugin } from "./lib/NormalModuleReplacementPlugin";
|
60
59
|
export type { OutputFileSystem } from "./util/fs";
|
61
60
|
import { FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, SubresourceIntegrityPlugin } from "./builtin-plugin";
|
62
61
|
interface Web {
|
@@ -133,10 +132,11 @@ export declare const sharing: {
|
|
133
132
|
export type { FeatureOptions as LightningcssFeatureOptions, LoaderOptions as LightningcssLoaderOptions } from "./builtin-loader/lightningcss/index";
|
134
133
|
export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./builtin-loader/swc/index";
|
135
134
|
export type { CircularDependencyRspackPluginOptions, CopyRspackPluginOptions, CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions, EvalDevToolModulePluginOptions, HtmlRspackPluginOptions, LightningCssMinimizerRspackPluginOptions, RsdoctorPluginData, RsdoctorPluginHooks, SourceMapDevToolPluginOptions, SubresourceIntegrityPluginOptions, SwcJsMinimizerRspackPluginOptions } from "./builtin-plugin";
|
136
|
-
export { CircularDependencyRspackPlugin, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, HtmlRspackPlugin, LightningCssMinimizerRspackPlugin, SourceMapDevToolPlugin, SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
|
135
|
+
export { CircularDependencyRspackPlugin, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, HtmlRspackPlugin, LightningCssMinimizerRspackPlugin, NormalModuleReplacementPlugin, SourceMapDevToolPlugin, SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
|
137
136
|
import { EnforceExtension, ResolverFactory, async as resolveAsync, sync as resolveSync } from "@rspack/binding";
|
138
137
|
import { createNativePlugin } from "./builtin-plugin";
|
139
138
|
import { minify, minifySync, transform, transformSync } from "./swc";
|
139
|
+
import { VirtualModulesPlugin } from "./VirtualModulesPlugin";
|
140
140
|
interface Experiments {
|
141
141
|
globalTrace: {
|
142
142
|
register: (filter: string, layer: "logger" | "perfetto", output: string) => Promise<void>;
|
@@ -162,6 +162,6 @@ interface Experiments {
|
|
162
162
|
};
|
163
163
|
CssChunkingPlugin: typeof CssChunkingPlugin;
|
164
164
|
createNativePlugin: typeof createNativePlugin;
|
165
|
+
VirtualModulesPlugin: typeof VirtualModulesPlugin;
|
165
166
|
}
|
166
167
|
export declare const experiments: Experiments;
|
167
|
-
export { VirtualModulesPlugin } from "./VirtualModulesPlugin";
|
package/dist/index.js
CHANGED
@@ -303,7 +303,6 @@ for(var __webpack_i__ in (()=>{
|
|
303
303
|
HotModuleReplacementPlugin: ()=>HotModuleReplacementPlugin,
|
304
304
|
Dependency: ()=>binding_.Dependency,
|
305
305
|
LoaderTargetPlugin: ()=>LoaderTargetPlugin,
|
306
|
-
VirtualModulesPlugin: ()=>VirtualModulesPlugin,
|
307
306
|
container: ()=>container,
|
308
307
|
EvalDevToolModulePlugin: ()=>EvalDevToolModulePlugin,
|
309
308
|
SwcJsMinimizerRspackPlugin: ()=>SwcJsMinimizerRspackPlugin,
|
@@ -352,7 +351,7 @@ for(var __webpack_i__ in (()=>{
|
|
352
351
|
wasm: ()=>exports_wasm,
|
353
352
|
version: ()=>exports_version
|
354
353
|
});
|
355
|
-
var
|
354
|
+
var StatsErrorCode, _computedKey, _computedKey1, _computedKey2, ArrayQueue_computedKey, browserslistTargetHandler_namespaceObject = {};
|
356
355
|
__webpack_require__.r(browserslistTargetHandler_namespaceObject), __webpack_require__.d(browserslistTargetHandler_namespaceObject, {
|
357
356
|
resolve: ()=>browserslistTargetHandler_resolve
|
358
357
|
});
|
@@ -412,7 +411,6 @@ for(var __webpack_i__ in (()=>{
|
|
412
411
|
SwcJsMinimizerRspackPlugin: ()=>SwcJsMinimizerRspackPlugin,
|
413
412
|
Template: ()=>Template,
|
414
413
|
ValidationError: ()=>validate_ValidationError,
|
415
|
-
VirtualModulesPlugin: ()=>VirtualModulesPlugin,
|
416
414
|
WarnCaseSensitiveModulesPlugin: ()=>WarnCaseSensitiveModulesPlugin,
|
417
415
|
WebpackError: ()=>exports_WebpackError,
|
418
416
|
WebpackOptionsApply: ()=>RspackOptionsApply,
|
@@ -2909,7 +2907,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
2909
2907
|
concurrentTasksPerWorker: 1
|
2910
2908
|
});
|
2911
2909
|
}));
|
2912
|
-
var service_RequestType = ((RequestType = {}).AddDependency = "AddDependency", RequestType.AddContextDependency = "AddContextDependency", RequestType.AddMissingDependency = "AddMissingDependency", RequestType.AddBuildDependency = "AddBuildDependency", RequestType.GetDependencies = "GetDependencies", RequestType.GetContextDependencies = "GetContextDependencies", RequestType.GetMissingDependencies = "GetMissingDependencies", RequestType.ClearDependencies = "ClearDependencies", RequestType.Resolve = "Resolve", RequestType.GetResolve = "GetResolve", RequestType.GetLogger = "GetLogger", RequestType.EmitError = "EmitError", RequestType.EmitWarning = "EmitWarning", RequestType.EmitFile = "EmitFile", RequestType.EmitDiagnostic = "EmitDiagnostic", RequestType.SetCacheable = "SetCacheable", RequestType.ImportModule = "ImportModule", RequestType.UpdateLoaderObjects = "UpdateLoaderObjects", RequestType.CompilationGetPath = "CompilationGetPath", RequestType.CompilationGetPathWithInfo = "CompilationGetPathWithInfo", RequestType.CompilationGetAssetPath = "CompilationGetAssetPath", RequestType.CompilationGetAssetPathWithInfo = "CompilationGetAssetPathWithInfo", RequestType);
|
2913
2910
|
function serializeError(error) {
|
2914
2911
|
if (error instanceof Error || error && "object" == typeof error && "message" in error) return {
|
2915
2912
|
...error,
|
@@ -3441,77 +3438,77 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
3441
3438
|
}, {
|
3442
3439
|
handleIncomingRequest (requestType, ...args) {
|
3443
3440
|
switch(requestType){
|
3444
|
-
case
|
3441
|
+
case "AddDependency":
|
3445
3442
|
loaderContext.addDependency(args[0]);
|
3446
3443
|
break;
|
3447
|
-
case
|
3444
|
+
case "AddContextDependency":
|
3448
3445
|
loaderContext.addContextDependency(args[0]);
|
3449
3446
|
break;
|
3450
|
-
case
|
3447
|
+
case "AddMissingDependency":
|
3451
3448
|
loaderContext.addMissingDependency(args[0]);
|
3452
3449
|
break;
|
3453
|
-
case
|
3450
|
+
case "AddBuildDependency":
|
3454
3451
|
loaderContext.addBuildDependency(args[0]);
|
3455
3452
|
break;
|
3456
|
-
case
|
3453
|
+
case "GetDependencies":
|
3457
3454
|
return loaderContext.getDependencies();
|
3458
|
-
case
|
3455
|
+
case "GetContextDependencies":
|
3459
3456
|
return loaderContext.getContextDependencies();
|
3460
|
-
case
|
3457
|
+
case "GetMissingDependencies":
|
3461
3458
|
return loaderContext.getMissingDependencies();
|
3462
|
-
case
|
3459
|
+
case "ClearDependencies":
|
3463
3460
|
loaderContext.clearDependencies();
|
3464
3461
|
break;
|
3465
|
-
case
|
3462
|
+
case "Resolve":
|
3466
3463
|
return new Promise((resolve, reject)=>{
|
3467
3464
|
loaderContext.resolve(args[0], args[1], (err, result)=>{
|
3468
3465
|
err ? reject(err) : resolve(result);
|
3469
3466
|
});
|
3470
3467
|
});
|
3471
|
-
case
|
3468
|
+
case "GetResolve":
|
3472
3469
|
return new Promise((resolve, reject)=>{
|
3473
3470
|
loaderContext.getResolve(args[0])(args[1], args[2], (err, result)=>{
|
3474
3471
|
err ? reject(err) : resolve(result);
|
3475
3472
|
});
|
3476
3473
|
});
|
3477
|
-
case
|
3474
|
+
case "GetLogger":
|
3478
3475
|
{
|
3479
3476
|
let [type, name, arg] = args;
|
3480
3477
|
loaderContext.getLogger(name)[type](...arg);
|
3481
3478
|
}
|
3482
|
-
case
|
3479
|
+
case "EmitError":
|
3483
3480
|
{
|
3484
3481
|
let workerError = args[0], error = Error(workerError.message);
|
3485
3482
|
error.stack = workerError.stack, error.name = workerError.name, loaderContext.emitError(error);
|
3486
3483
|
break;
|
3487
3484
|
}
|
3488
|
-
case
|
3485
|
+
case "EmitWarning":
|
3489
3486
|
{
|
3490
3487
|
let workerError = args[0], error = Error(workerError.message);
|
3491
3488
|
error.stack = workerError.stack, error.name = workerError.name, loaderContext.emitWarning(error);
|
3492
3489
|
break;
|
3493
3490
|
}
|
3494
|
-
case
|
3491
|
+
case "EmitFile":
|
3495
3492
|
{
|
3496
3493
|
let [name, content, sourceMap, assetInfo] = args;
|
3497
3494
|
loaderContext.emitFile(name, content, sourceMap, assetInfo);
|
3498
3495
|
break;
|
3499
3496
|
}
|
3500
|
-
case
|
3497
|
+
case "EmitDiagnostic":
|
3501
3498
|
{
|
3502
3499
|
let diagnostic = args[0];
|
3503
3500
|
loaderContext.experiments.emitDiagnostic(diagnostic);
|
3504
3501
|
break;
|
3505
3502
|
}
|
3506
|
-
case
|
3503
|
+
case "SetCacheable":
|
3507
3504
|
{
|
3508
3505
|
let cacheable = args[0];
|
3509
3506
|
loaderContext.cacheable(cacheable);
|
3510
3507
|
break;
|
3511
3508
|
}
|
3512
|
-
case
|
3509
|
+
case "ImportModule":
|
3513
3510
|
return loaderContext.importModule(args[0], args[1]);
|
3514
|
-
case
|
3511
|
+
case "UpdateLoaderObjects":
|
3515
3512
|
{
|
3516
3513
|
let updates = args[0];
|
3517
3514
|
loaderContext.loaders = loaderContext.loaders.map((item, index)=>{
|
@@ -3520,22 +3517,22 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
3520
3517
|
});
|
3521
3518
|
break;
|
3522
3519
|
}
|
3523
|
-
case
|
3520
|
+
case "CompilationGetPath":
|
3524
3521
|
{
|
3525
3522
|
let filename = args[0], data = args[1];
|
3526
3523
|
return compiler._lastCompilation.getPath(filename, data);
|
3527
3524
|
}
|
3528
|
-
case
|
3525
|
+
case "CompilationGetPathWithInfo":
|
3529
3526
|
{
|
3530
3527
|
let filename = args[0], data = args[1];
|
3531
3528
|
return compiler._lastCompilation.getPathWithInfo(filename, data);
|
3532
3529
|
}
|
3533
|
-
case
|
3530
|
+
case "CompilationGetAssetPath":
|
3534
3531
|
{
|
3535
3532
|
let filename = args[0], data = args[1];
|
3536
3533
|
return compiler._lastCompilation.getAssetPath(filename, data);
|
3537
3534
|
}
|
3538
|
-
case
|
3535
|
+
case "CompilationGetAssetPathWithInfo":
|
3539
3536
|
{
|
3540
3537
|
let filename = args[0], data = args[1];
|
3541
3538
|
return compiler._lastCompilation.getAssetPathWithInfo(filename, data);
|
@@ -3902,6 +3899,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
3902
3899
|
importMeta: parser.importMeta,
|
3903
3900
|
url: parser.url?.toString(),
|
3904
3901
|
exprContextCritical: parser.exprContextCritical,
|
3902
|
+
unknownContextCritical: parser.unknownContextCritical,
|
3905
3903
|
wrappedContextCritical: parser.wrappedContextCritical,
|
3906
3904
|
wrappedContextRegExp: parser.wrappedContextRegExp,
|
3907
3905
|
exportsPresence: !1 === parser.exportsPresence ? "false" : parser.exportsPresence,
|
@@ -7312,40 +7310,38 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7312
7310
|
}), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", noop = (_req, _res, next)=>{
|
7313
7311
|
"function" == typeof next && next();
|
7314
7312
|
}, 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.";
|
7315
|
-
function applyPlugin(compiler,
|
7313
|
+
function applyPlugin(compiler, options, activeModules, filesByKey) {
|
7316
7314
|
new BuiltinLazyCompilationPlugin(({ module, path })=>{
|
7317
|
-
let compiler1,
|
7318
|
-
|
7319
|
-
let
|
7320
|
-
filesByKey.set(key, path);
|
7321
|
-
let active = !0 === activeModules.get(key);
|
7315
|
+
let compiler1, data = `${encodeURIComponent(module.replace(/\\/g, "/").replace(/@/g, "_"))}`;
|
7316
|
+
filesByKey.set(data, path);
|
7317
|
+
let active = activeModules.has(data);
|
7322
7318
|
return {
|
7323
7319
|
client: `${options.client || (compiler1 = compiler, require.resolve(`../hot/lazy-compilation-${compiler1.options.externalsPresets.node ? "node" : "web"}.js`))}?${encodeURIComponent((({ serverUrl, prefix })=>{
|
7324
7320
|
let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
|
7325
7321
|
return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
|
7326
7322
|
})(options))}`,
|
7327
|
-
data
|
7323
|
+
data,
|
7328
7324
|
active
|
7329
7325
|
};
|
7330
7326
|
}, options.cacheable ?? !0, options.entries ?? !0, options.imports ?? !0, options.test).apply(compiler);
|
7331
7327
|
}
|
7332
|
-
let lazyCompilationMiddlewareInternal = (compiler,
|
7328
|
+
let lazyCompilationMiddlewareInternal = (compiler, activeModules, filesByKey, lazyCompilationPrefix)=>{
|
7333
7329
|
let logger = compiler.getInfrastructureLogger("LazyCompilation");
|
7334
7330
|
return (req, res, next)=>{
|
7335
7331
|
if (!req.url?.startsWith(lazyCompilationPrefix)) return next?.();
|
7336
|
-
let
|
7332
|
+
let modules = req.url.slice(lazyCompilationPrefix.length).split("@");
|
7337
7333
|
req.socket.setNoDelay(!0), res.setHeader("content-type", "text/event-stream"), res.writeHead(200), res.write("\n");
|
7338
7334
|
let moduleActivated = [];
|
7339
|
-
for (let
|
7340
|
-
let
|
7341
|
-
activeModules.
|
7335
|
+
for (let key of modules){
|
7336
|
+
let activated = activeModules.has(key);
|
7337
|
+
activeModules.add(key), activated || (logger.log(`${key} is now in use and will be compiled.`), moduleActivated.push(key));
|
7342
7338
|
}
|
7343
7339
|
if (moduleActivated.length && compiler.watching) {
|
7344
7340
|
let rebuiltModules = new Set(moduleActivated.map((key)=>{
|
7345
7341
|
let filePath = filesByKey.get(key);
|
7346
7342
|
return filePath || logger.warn(`Cannot find correct file path for module ${key}`), filePath;
|
7347
7343
|
}).filter(Boolean));
|
7348
|
-
rebuiltModules.size && compiler.watching.invalidateWithChangesAndRemovals(
|
7344
|
+
rebuiltModules.size && compiler.watching.invalidateWithChangesAndRemovals(rebuiltModules);
|
7349
7345
|
}
|
7350
7346
|
};
|
7351
7347
|
};
|
@@ -7383,7 +7379,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7383
7379
|
return createBuiltinPlugin(this.name, void 0);
|
7384
7380
|
}
|
7385
7381
|
}
|
7386
|
-
let NodeTargetPlugin = base_create(binding_.BuiltinPluginName.NodeTargetPlugin, ()=>void 0), NoEmitOnErrorsPlugin = base_create(binding_.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0),
|
7382
|
+
let NodeTargetPlugin = base_create(binding_.BuiltinPluginName.NodeTargetPlugin, ()=>void 0), NoEmitOnErrorsPlugin = base_create(binding_.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0), NormalModuleReplacementPlugin = base_create(binding_.BuiltinPluginName.NormalModuleReplacementPlugin, (resourceRegExp, newResource)=>({
|
7383
|
+
resourceRegExp,
|
7384
|
+
newResource: "function" == typeof newResource ? (data)=>(newResource(data), data) : newResource
|
7385
|
+
})), OccurrenceChunkIdsPlugin = base_create(binding_.BuiltinPluginName.OccurrenceChunkIdsPlugin, (options)=>({
|
7387
7386
|
...options
|
7388
7387
|
}), "compilation"), ProgressPlugin = base_create(binding_.BuiltinPluginName.ProgressPlugin, (progress = {})=>"function" == typeof progress ? {
|
7389
7388
|
handler: (percentage, msg, items)=>{
|
@@ -8628,10 +8627,10 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
8628
8627
|
}, applyExperimentsDefaults = (experiments, { production, development })=>{
|
8629
8628
|
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);
|
8630
8629
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
8631
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.5.0-beta.
|
8630
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.5.0-beta.1"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
8632
8631
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName, inlineConst })=>{
|
8633
8632
|
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", [
|
8633
|
+
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, "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
8634
|
"..."
|
8636
8635
|
]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", inlineConst), D(parserOptions, "typeReexportsPresence", "no-tolerant");
|
8637
8636
|
})(module.parser.javascript, {
|
@@ -10271,7 +10270,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10271
10270
|
});
|
10272
10271
|
}
|
10273
10272
|
}
|
10274
|
-
let CORE_VERSION = "1.5.0-beta.
|
10273
|
+
let CORE_VERSION = "1.5.0-beta.1", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
10275
10274
|
|
10276
10275
|
Help:
|
10277
10276
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
@@ -11198,19 +11197,8 @@ Help:
|
|
11198
11197
|
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
|
11199
11198
|
}, function(queried) {
|
11200
11199
|
return async function(resolveData) {
|
11201
|
-
|
11202
|
-
|
11203
|
-
issuer: resolveData.issuer,
|
11204
|
-
issuerLayer: resolveData.issuerLayer ?? null
|
11205
|
-
},
|
11206
|
-
request: resolveData.request,
|
11207
|
-
context: resolveData.context,
|
11208
|
-
fileDependencies: [],
|
11209
|
-
missingDependencies: [],
|
11210
|
-
contextDependencies: []
|
11211
|
-
}, ret = await queried.promise(normalizedResolveData);
|
11212
|
-
return resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, [
|
11213
|
-
ret,
|
11200
|
+
return [
|
11201
|
+
await queried.promise(resolveData),
|
11214
11202
|
resolveData
|
11215
11203
|
];
|
11216
11204
|
};
|
@@ -11219,36 +11207,14 @@ Help:
|
|
11219
11207
|
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
|
11220
11208
|
}, function(queried) {
|
11221
11209
|
return async function(resolveData) {
|
11222
|
-
|
11223
|
-
contextInfo: {
|
11224
|
-
issuer: resolveData.issuer,
|
11225
|
-
issuerLayer: resolveData.issuerLayer ?? null
|
11226
|
-
},
|
11227
|
-
request: resolveData.request,
|
11228
|
-
context: resolveData.context,
|
11229
|
-
fileDependencies: [],
|
11230
|
-
missingDependencies: [],
|
11231
|
-
contextDependencies: []
|
11232
|
-
};
|
11233
|
-
return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
|
11210
|
+
return await queried.promise(resolveData), resolveData;
|
11234
11211
|
};
|
11235
11212
|
}),
|
11236
11213
|
registerNormalModuleFactoryResolveTaps: createTap2(binding_default().RegisterJsTapKind.NormalModuleFactoryResolve, function() {
|
11237
11214
|
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
|
11238
11215
|
}, function(queried) {
|
11239
11216
|
return async function(resolveData) {
|
11240
|
-
|
11241
|
-
contextInfo: {
|
11242
|
-
issuer: resolveData.issuer,
|
11243
|
-
issuerLayer: resolveData.issuerLayer ?? null
|
11244
|
-
},
|
11245
|
-
request: resolveData.request,
|
11246
|
-
context: resolveData.context,
|
11247
|
-
fileDependencies: [],
|
11248
|
-
missingDependencies: [],
|
11249
|
-
contextDependencies: []
|
11250
|
-
};
|
11251
|
-
return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
|
11217
|
+
return await queried.promise(resolveData), resolveData;
|
11252
11218
|
};
|
11253
11219
|
}),
|
11254
11220
|
registerNormalModuleFactoryResolveForSchemeTaps: createMapTap1(binding_default().RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
|
@@ -11264,11 +11230,10 @@ Help:
|
|
11264
11230
|
registerNormalModuleFactoryAfterResolveTaps: createTap2(binding_default().RegisterJsTapKind.NormalModuleFactoryAfterResolve, function() {
|
11265
11231
|
return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
|
11266
11232
|
}, function(queried) {
|
11267
|
-
return async function(
|
11268
|
-
let data = JSON.parse(arg);
|
11233
|
+
return async function(resolveData) {
|
11269
11234
|
return [
|
11270
|
-
await queried.promise(
|
11271
|
-
|
11235
|
+
await queried.promise(resolveData),
|
11236
|
+
resolveData
|
11272
11237
|
];
|
11273
11238
|
};
|
11274
11239
|
}),
|
@@ -11585,7 +11550,7 @@ Help:
|
|
11585
11550
|
obj.children = this.stats.map((stat, idx)=>{
|
11586
11551
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
11587
11552
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
11588
|
-
}), childOptions.version && (obj.rspackVersion = "1.5.0-beta.
|
11553
|
+
}), childOptions.version && (obj.rspackVersion = "1.5.0-beta.1", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
11589
11554
|
let mapError = (j, obj)=>({
|
11590
11555
|
...obj,
|
11591
11556
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
@@ -12485,7 +12450,7 @@ Help:
|
|
12485
12450
|
object.hash = context.getStatsCompilation(compilation).hash;
|
12486
12451
|
},
|
12487
12452
|
version: (object)=>{
|
12488
|
-
object.version = "5.75.0", object.rspackVersion = "1.5.0-beta.
|
12453
|
+
object.version = "5.75.0", object.rspackVersion = "1.5.0-beta.1";
|
12489
12454
|
},
|
12490
12455
|
env: (object, _compilation, _context, { _env })=>{
|
12491
12456
|
object.env = _env;
|
@@ -14065,24 +14030,6 @@ Help:
|
|
14065
14030
|
});
|
14066
14031
|
}
|
14067
14032
|
}
|
14068
|
-
class NormalModuleReplacementPlugin {
|
14069
|
-
resourceRegExp;
|
14070
|
-
newResource;
|
14071
|
-
constructor(resourceRegExp, newResource){
|
14072
|
-
this.resourceRegExp = resourceRegExp, this.newResource = newResource;
|
14073
|
-
}
|
14074
|
-
apply(compiler) {
|
14075
|
-
let { resourceRegExp, newResource } = this;
|
14076
|
-
compiler.hooks.normalModuleFactory.tap("NormalModuleReplacementPlugin", (nmf)=>{
|
14077
|
-
nmf.hooks.beforeResolve.tap("NormalModuleReplacementPlugin", (result)=>{
|
14078
|
-
resourceRegExp.test(result.request) && ("function" == typeof newResource ? newResource(result) : result.request = newResource);
|
14079
|
-
}), nmf.hooks.afterResolve.tap("NormalModuleReplacementPlugin", (result)=>{
|
14080
|
-
let createData = result.createData || {};
|
14081
|
-
resourceRegExp.test(createData.resource || "") && ("function" == typeof newResource ? newResource(result) : external_node_path_namespaceObject.posix.isAbsolute(newResource) || external_node_path_namespaceObject.win32.isAbsolute(newResource) ? createData.resource = newResource : createData.resource = external_node_path_namespaceObject.join(external_node_path_namespaceObject.dirname(createData.resource || ""), newResource));
|
14082
|
-
});
|
14083
|
-
});
|
14084
|
-
}
|
14085
|
-
}
|
14086
14033
|
var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"), CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
|
14087
14034
|
let filterToFunction = (item)=>{
|
14088
14035
|
if ("string" == typeof item) {
|
@@ -15020,7 +14967,7 @@ Help:
|
|
15020
14967
|
]), javascriptParserUrl = union([
|
15021
14968
|
literal("relative"),
|
15022
14969
|
schemas_boolean()
|
15023
|
-
]), exprContextCritical = schemas_boolean(), wrappedContextCritical = schemas_boolean(), wrappedContextRegExp = _instanceof(RegExp), exportsPresence = schemas_enum([
|
14970
|
+
]), exprContextCritical = schemas_boolean(), wrappedContextCritical = schemas_boolean(), unknownContextCritical = schemas_boolean(), wrappedContextRegExp = _instanceof(RegExp), exportsPresence = schemas_enum([
|
15024
14971
|
"error",
|
15025
14972
|
"warn",
|
15026
14973
|
"auto"
|
@@ -15048,6 +14995,7 @@ Help:
|
|
15048
14995
|
url: javascriptParserUrl,
|
15049
14996
|
exprContextCritical: exprContextCritical,
|
15050
14997
|
wrappedContextCritical: wrappedContextCritical,
|
14998
|
+
unknownContextCritical: unknownContextCritical,
|
15051
14999
|
wrappedContextRegExp: wrappedContextRegExp,
|
15052
15000
|
exportsPresence: exportsPresence,
|
15053
15001
|
importExportsPresence: importExportsPresence,
|
@@ -15815,7 +15763,7 @@ Help:
|
|
15815
15763
|
let _options = JSON.stringify(options || {});
|
15816
15764
|
return binding_default().transform(source, _options);
|
15817
15765
|
}
|
15818
|
-
let exports_rspackVersion = "1.5.0-beta.
|
15766
|
+
let exports_rspackVersion = "1.5.0-beta.1", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
15819
15767
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
15820
15768
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
15821
15769
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
@@ -16020,8 +15968,8 @@ Help:
|
|
16020
15968
|
...c.options.lazyCompilation
|
16021
15969
|
}, prefix = options.prefix || LAZY_COMPILATION_PREFIX;
|
16022
15970
|
options.prefix = `${prefix}__${i++}`;
|
16023
|
-
let activeModules = new
|
16024
|
-
middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler,
|
15971
|
+
let activeModules = new Set(), filesByKey = new Map();
|
15972
|
+
middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, activeModules, filesByKey, options.prefix)), applyPlugin(c, options, activeModules, filesByKey);
|
16025
15973
|
}
|
16026
15974
|
let keys = [
|
16027
15975
|
...middlewareByCompiler.keys()
|
@@ -16034,11 +15982,11 @@ Help:
|
|
16034
15982
|
};
|
16035
15983
|
}
|
16036
15984
|
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;
|
16037
|
-
let activeModules = new
|
15985
|
+
let activeModules = new Set(), filesByKey = new Map(), options = {
|
16038
15986
|
...compiler.options.experiments.lazyCompilation,
|
16039
15987
|
...compiler.options.lazyCompilation
|
16040
15988
|
};
|
16041
|
-
return applyPlugin(compiler,
|
15989
|
+
return applyPlugin(compiler, options, activeModules, filesByKey), lazyCompilationMiddlewareInternal(compiler, activeModules, filesByKey, options.prefix || LAZY_COMPILATION_PREFIX);
|
16042
15990
|
},
|
16043
15991
|
swc: {
|
16044
15992
|
minify: minify,
|
@@ -16062,7 +16010,8 @@ Help:
|
|
16062
16010
|
createNativePlugin: function(name, resolve, affectedHooks) {
|
16063
16011
|
if (INTERNAL_PLUGIN_NAMES.includes(name)) throw Error(`Cannot register native plugin with name '${name}', it conflicts with internal plugin names.`);
|
16064
16012
|
return base_create(name, resolve, affectedHooks);
|
16065
|
-
}
|
16013
|
+
},
|
16014
|
+
VirtualModulesPlugin: VirtualModulesPlugin
|
16066
16015
|
};
|
16067
16016
|
function createCompiler(userOptions) {
|
16068
16017
|
var options;
|
@@ -16121,7 +16070,7 @@ Help:
|
|
16121
16070
|
}, exports_namespaceObject);
|
16122
16071
|
src_fn.rspack = src_fn, src_fn.webpack = src_fn;
|
16123
16072
|
let src_rspack = src_fn, src_0 = src_rspack;
|
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.
|
16073
|
+
})(), 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 === [
|
16125
16074
|
"AsyncDependenciesBlock",
|
16126
16075
|
"BannerPlugin",
|
16127
16076
|
"CircularDependencyRspackPlugin",
|
@@ -16170,7 +16119,6 @@ Help:
|
|
16170
16119
|
"SwcJsMinimizerRspackPlugin",
|
16171
16120
|
"Template",
|
16172
16121
|
"ValidationError",
|
16173
|
-
"VirtualModulesPlugin",
|
16174
16122
|
"WarnCaseSensitiveModulesPlugin",
|
16175
16123
|
"WebpackError",
|
16176
16124
|
"WebpackOptionsApply",
|
package/dist/schema/config.d.ts
CHANGED
@@ -37,9 +37,9 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
|
|
37
37
|
baseUri: z.ZodOptional<z.ZodString>;
|
38
38
|
chunkLoading: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodUnion<[z.ZodEnum<{
|
39
39
|
import: "import";
|
40
|
-
require: "require";
|
41
40
|
jsonp: "jsonp";
|
42
41
|
"import-scripts": "import-scripts";
|
42
|
+
require: "require";
|
43
43
|
"async-node": "async-node";
|
44
44
|
}>, z.ZodString]>]>>;
|
45
45
|
asyncChunks: z.ZodOptional<z.ZodBoolean>;
|
@@ -219,16 +219,16 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
|
|
219
219
|
chunkFormat: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodString]>>;
|
220
220
|
chunkLoading: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodUnion<[z.ZodEnum<{
|
221
221
|
import: "import";
|
222
|
-
require: "require";
|
223
222
|
jsonp: "jsonp";
|
224
223
|
"import-scripts": "import-scripts";
|
224
|
+
require: "require";
|
225
225
|
"async-node": "async-node";
|
226
226
|
}>, z.ZodString]>]>>;
|
227
227
|
enabledChunkLoadingTypes: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<{
|
228
228
|
import: "import";
|
229
|
-
require: "require";
|
230
229
|
jsonp: "jsonp";
|
231
230
|
"import-scripts": "import-scripts";
|
231
|
+
require: "require";
|
232
232
|
"async-node": "async-node";
|
233
233
|
}>, z.ZodString]>>>;
|
234
234
|
trustedTypes: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<true>, z.ZodString]>, z.ZodObject<{
|
@@ -250,9 +250,9 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
|
|
250
250
|
asyncChunks: z.ZodOptional<z.ZodBoolean>;
|
251
251
|
workerChunkLoading: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodUnion<[z.ZodEnum<{
|
252
252
|
import: "import";
|
253
|
-
require: "require";
|
254
253
|
jsonp: "jsonp";
|
255
254
|
"import-scripts": "import-scripts";
|
255
|
+
require: "require";
|
256
256
|
"async-node": "async-node";
|
257
257
|
}>, z.ZodString]>]>>;
|
258
258
|
workerWasmLoading: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodUnion<[z.ZodEnum<{
|
@@ -738,6 +738,7 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
|
|
738
738
|
url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodBoolean]>>;
|
739
739
|
exprContextCritical: z.ZodOptional<z.ZodBoolean>;
|
740
740
|
wrappedContextCritical: z.ZodOptional<z.ZodBoolean>;
|
741
|
+
unknownContextCritical: z.ZodOptional<z.ZodBoolean>;
|
741
742
|
wrappedContextRegExp: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
|
742
743
|
exportsPresence: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
743
744
|
auto: "auto";
|
@@ -789,6 +790,7 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
|
|
789
790
|
url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodBoolean]>>;
|
790
791
|
exprContextCritical: z.ZodOptional<z.ZodBoolean>;
|
791
792
|
wrappedContextCritical: z.ZodOptional<z.ZodBoolean>;
|
793
|
+
unknownContextCritical: z.ZodOptional<z.ZodBoolean>;
|
792
794
|
wrappedContextRegExp: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
|
793
795
|
exportsPresence: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
794
796
|
auto: "auto";
|
@@ -840,6 +842,7 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
|
|
840
842
|
url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodBoolean]>>;
|
841
843
|
exprContextCritical: z.ZodOptional<z.ZodBoolean>;
|
842
844
|
wrappedContextCritical: z.ZodOptional<z.ZodBoolean>;
|
845
|
+
unknownContextCritical: z.ZodOptional<z.ZodBoolean>;
|
843
846
|
wrappedContextRegExp: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
|
844
847
|
exportsPresence: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
845
848
|
auto: "auto";
|
@@ -891,6 +894,7 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
|
|
891
894
|
url: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"relative">, z.ZodBoolean]>>;
|
892
895
|
exprContextCritical: z.ZodOptional<z.ZodBoolean>;
|
893
896
|
wrappedContextCritical: z.ZodOptional<z.ZodBoolean>;
|
897
|
+
unknownContextCritical: z.ZodOptional<z.ZodBoolean>;
|
894
898
|
wrappedContextRegExp: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
|
895
899
|
exportsPresence: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
896
900
|
auto: "auto";
|
package/dist/worker.js
CHANGED
@@ -27,7 +27,7 @@ var __webpack_modules__ = {
|
|
27
27
|
},
|
28
28
|
"./src/util/cleverMerge.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
29
29
|
__webpack_require__.d(__webpack_exports__, {
|
30
|
-
|
30
|
+
ks: ()=>cleverMerge
|
31
31
|
});
|
32
32
|
let DYNAMIC_INFO = Symbol("cleverMerge dynamic info"), mergeCache = new WeakMap(), DELETE = Symbol("DELETE"), cachedCleverMerge = (first, second)=>{
|
33
33
|
if (void 0 === second) return first;
|
@@ -206,7 +206,7 @@ var __webpack_modules__ = {
|
|
206
206
|
"./src/util/createHash.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
207
207
|
let createMd4, createXxhash64;
|
208
208
|
__webpack_require__.d(__webpack_exports__, {
|
209
|
-
|
209
|
+
n: ()=>createHash
|
210
210
|
});
|
211
211
|
let external_node_crypto_namespaceObject = require("node:crypto");
|
212
212
|
var external_node_crypto_default = __webpack_require__.n(external_node_crypto_namespaceObject), external_node_util_ = __webpack_require__("node:util");
|
@@ -464,7 +464,7 @@ for(var __webpack_i__ in (()=>{
|
|
464
464
|
default: ()=>loader_runner_worker
|
465
465
|
});
|
466
466
|
let external_node_querystring_namespaceObject = require("node:querystring");
|
467
|
-
var
|
467
|
+
var external_node_querystring_default = __webpack_require__.n(external_node_querystring_namespaceObject), external_node_util_ = __webpack_require__("node:util");
|
468
468
|
let external_node_worker_threads_namespaceObject = require("node:worker_threads");
|
469
469
|
var binding_ = __webpack_require__("@rspack/binding"), createHash = __webpack_require__("./src/util/createHash.ts");
|
470
470
|
let external_node_path_namespaceObject = require("node:path");
|
@@ -592,7 +592,6 @@ for(var __webpack_i__ in (()=>{
|
|
592
592
|
function isWorkerResponseMessage(message) {
|
593
593
|
return "response" === message.type;
|
594
594
|
}
|
595
|
-
var service_RequestType = ((RequestType = {}).AddDependency = "AddDependency", RequestType.AddContextDependency = "AddContextDependency", RequestType.AddMissingDependency = "AddMissingDependency", RequestType.AddBuildDependency = "AddBuildDependency", RequestType.GetDependencies = "GetDependencies", RequestType.GetContextDependencies = "GetContextDependencies", RequestType.GetMissingDependencies = "GetMissingDependencies", RequestType.ClearDependencies = "ClearDependencies", RequestType.Resolve = "Resolve", RequestType.GetResolve = "GetResolve", RequestType.GetLogger = "GetLogger", RequestType.EmitError = "EmitError", RequestType.EmitWarning = "EmitWarning", RequestType.EmitFile = "EmitFile", RequestType.EmitDiagnostic = "EmitDiagnostic", RequestType.SetCacheable = "SetCacheable", RequestType.ImportModule = "ImportModule", RequestType.UpdateLoaderObjects = "UpdateLoaderObjects", RequestType.CompilationGetPath = "CompilationGetPath", RequestType.CompilationGetPathWithInfo = "CompilationGetPathWithInfo", RequestType.CompilationGetAssetPath = "CompilationGetAssetPath", RequestType.CompilationGetAssetPathWithInfo = "CompilationGetAssetPathWithInfo", RequestType), service_RequestSyncType = ((RequestSyncType = {}).WaitForPendingRequest = "WaitForPendingRequest", RequestSyncType);
|
596
595
|
function serializeError(error) {
|
597
596
|
if (error instanceof Error || error && "object" == typeof error && "message" in error) return {
|
598
597
|
...error,
|
@@ -657,21 +656,21 @@ for(var __webpack_i__ in (()=>{
|
|
657
656
|
return idx < 0 ? path : idx === idx2 ? path.slice(0, idx + 1) : path.slice(0, idx);
|
658
657
|
}(resourcePath) : null, pendingDependencyRequest = [];
|
659
658
|
loaderContext.parallel = !0, loaderContext.dependency = loaderContext.addDependency = function(file) {
|
660
|
-
pendingDependencyRequest.push(sendRequest(
|
659
|
+
pendingDependencyRequest.push(sendRequest("AddDependency", file));
|
661
660
|
}, loaderContext.addContextDependency = function(context) {
|
662
|
-
pendingDependencyRequest.push(sendRequest(
|
661
|
+
pendingDependencyRequest.push(sendRequest("AddContextDependency", context));
|
663
662
|
}, loaderContext.addBuildDependency = function(file) {
|
664
|
-
pendingDependencyRequest.push(sendRequest(
|
663
|
+
pendingDependencyRequest.push(sendRequest("AddBuildDependency", file));
|
665
664
|
}, loaderContext.getDependencies = function() {
|
666
|
-
return waitForPendingRequest(pendingDependencyRequest), sendRequest(
|
665
|
+
return waitForPendingRequest(pendingDependencyRequest), sendRequest("GetDependencies").wait();
|
667
666
|
}, loaderContext.getContextDependencies = function() {
|
668
|
-
return waitForPendingRequest(pendingDependencyRequest), sendRequest(
|
667
|
+
return waitForPendingRequest(pendingDependencyRequest), sendRequest("GetContextDependencies").wait();
|
669
668
|
}, loaderContext.getMissingDependencies = function() {
|
670
|
-
return waitForPendingRequest(pendingDependencyRequest), sendRequest(
|
669
|
+
return waitForPendingRequest(pendingDependencyRequest), sendRequest("GetMissingDependencies").wait();
|
671
670
|
}, loaderContext.clearDependencies = function() {
|
672
|
-
pendingDependencyRequest.push(sendRequest(
|
671
|
+
pendingDependencyRequest.push(sendRequest("ClearDependencies"));
|
673
672
|
}, loaderContext.resolve = function(context, request, callback) {
|
674
|
-
sendRequest(
|
673
|
+
sendRequest("Resolve", context, request).then((result)=>{
|
675
674
|
callback(null, result);
|
676
675
|
}, (err)=>{
|
677
676
|
callback(err);
|
@@ -679,13 +678,13 @@ for(var __webpack_i__ in (()=>{
|
|
679
678
|
}, loaderContext.getResolve = function(options) {
|
680
679
|
return (context, request, callback)=>{
|
681
680
|
if (!callback) return new Promise((resolve, reject)=>{
|
682
|
-
sendRequest(
|
681
|
+
sendRequest("GetResolve", options, context, request).then((result)=>{
|
683
682
|
resolve(result);
|
684
683
|
}, (err)=>{
|
685
684
|
reject(err);
|
686
685
|
});
|
687
686
|
});
|
688
|
-
sendRequest(
|
687
|
+
sendRequest("GetResolve", options, context, request).then((result)=>{
|
689
688
|
callback(null, result);
|
690
689
|
}, (err)=>{
|
691
690
|
callback(err);
|
@@ -694,96 +693,96 @@ for(var __webpack_i__ in (()=>{
|
|
694
693
|
}, loaderContext.getLogger = function(name) {
|
695
694
|
return {
|
696
695
|
error (...args) {
|
697
|
-
sendRequest(
|
696
|
+
sendRequest("GetLogger", "error", name, args);
|
698
697
|
},
|
699
698
|
warn (...args) {
|
700
|
-
sendRequest(
|
699
|
+
sendRequest("GetLogger", "warn", name, args);
|
701
700
|
},
|
702
701
|
info (...args) {
|
703
|
-
sendRequest(
|
702
|
+
sendRequest("GetLogger", "info", name, args);
|
704
703
|
},
|
705
704
|
log (...args) {
|
706
|
-
sendRequest(
|
705
|
+
sendRequest("GetLogger", "log", name, args);
|
707
706
|
},
|
708
707
|
debug (...args) {
|
709
|
-
sendRequest(
|
708
|
+
sendRequest("GetLogger", "debug", name, args);
|
710
709
|
},
|
711
710
|
assert (assertion, ...args) {
|
712
|
-
assertion || sendRequest(
|
711
|
+
assertion || sendRequest("GetLogger", "error", name, args);
|
713
712
|
},
|
714
713
|
trace () {
|
715
|
-
sendRequest(
|
714
|
+
sendRequest("GetLogger", "trace", name, [
|
716
715
|
"Trace"
|
717
716
|
]);
|
718
717
|
},
|
719
718
|
clear () {
|
720
|
-
sendRequest(
|
719
|
+
sendRequest("GetLogger", "clear", name);
|
721
720
|
},
|
722
721
|
status (...args) {
|
723
|
-
sendRequest(
|
722
|
+
sendRequest("GetLogger", "status", name, args);
|
724
723
|
},
|
725
724
|
group (...args) {
|
726
|
-
sendRequest(
|
725
|
+
sendRequest("GetLogger", "group", name, args);
|
727
726
|
},
|
728
727
|
groupCollapsed (...args) {
|
729
|
-
sendRequest(
|
728
|
+
sendRequest("GetLogger", "groupCollapsed", name, args);
|
730
729
|
},
|
731
730
|
groupEnd (...args) {
|
732
|
-
sendRequest(
|
731
|
+
sendRequest("GetLogger", "groupEnd", name, args);
|
733
732
|
},
|
734
733
|
profile (label) {
|
735
|
-
sendRequest(
|
734
|
+
sendRequest("GetLogger", "profile", name, [
|
736
735
|
label
|
737
736
|
]);
|
738
737
|
},
|
739
738
|
profileEnd (label) {
|
740
|
-
sendRequest(
|
739
|
+
sendRequest("GetLogger", "profileEnd", name, [
|
741
740
|
label
|
742
741
|
]);
|
743
742
|
},
|
744
743
|
time (label) {
|
745
|
-
sendRequest(
|
744
|
+
sendRequest("GetLogger", "time", name, [
|
746
745
|
label
|
747
746
|
]);
|
748
747
|
},
|
749
748
|
timeEnd (label) {
|
750
|
-
sendRequest(
|
749
|
+
sendRequest("GetLogger", "timeEnd", name, [
|
751
750
|
label
|
752
751
|
]);
|
753
752
|
},
|
754
753
|
timeLog (label, ...args) {
|
755
|
-
sendRequest(
|
754
|
+
sendRequest("GetLogger", "timeLog", name, [
|
756
755
|
label,
|
757
756
|
...args
|
758
757
|
]);
|
759
758
|
},
|
760
759
|
timeAggregate (label) {
|
761
|
-
sendRequest(
|
760
|
+
sendRequest("GetLogger", "timeAggregate", name, [
|
762
761
|
label
|
763
762
|
]);
|
764
763
|
},
|
765
764
|
timeAggregateEnd (label) {
|
766
|
-
sendRequest(
|
765
|
+
sendRequest("GetLogger", "timeAggregateEnd", name, [
|
767
766
|
label
|
768
767
|
]);
|
769
768
|
}
|
770
769
|
};
|
771
770
|
}, loaderContext.emitError = function(err) {
|
772
|
-
sendRequest(
|
771
|
+
sendRequest("EmitError", serializeError(err));
|
773
772
|
}, loaderContext.emitWarning = function(warning) {
|
774
|
-
sendRequest(
|
773
|
+
sendRequest("EmitWarning", serializeError(warning));
|
775
774
|
}, loaderContext.emitFile = function(name, content, sourceMap, assetInfo) {
|
776
|
-
sendRequest(
|
775
|
+
sendRequest("EmitFile", name, content, sourceMap, assetInfo);
|
777
776
|
}, loaderContext.experiments = {
|
778
777
|
emitDiagnostic (diagnostic) {
|
779
|
-
sendRequest(
|
778
|
+
sendRequest("EmitDiagnostic", diagnostic);
|
780
779
|
}
|
781
780
|
};
|
782
781
|
let getAbsolutify = memoize(()=>absolutify.bindCache({})), getAbsolutifyInContext = memoize(()=>absolutify.bindContextCache(contextDirectory, {})), getContextify = memoize(()=>contextify.bindCache({})), getContextifyInContext = memoize(()=>contextify.bindContextCache(contextDirectory, {}));
|
783
782
|
loaderContext.utils = {
|
784
783
|
absolutify: (context, request)=>context === contextDirectory ? getAbsolutifyInContext()(request) : getAbsolutify()(context, request),
|
785
784
|
contextify: (context, request)=>context === contextDirectory ? getContextifyInContext()(request) : getContextify()(context, request),
|
786
|
-
createHash: (type)=>(0, createHash.
|
785
|
+
createHash: (type)=>(0, createHash.n)(type || loaderContext._compilation.outputOptions.hashFunction)
|
787
786
|
}, loaderContext._compiler = {
|
788
787
|
...loaderContext._compiler,
|
789
788
|
rspack: {
|
@@ -793,16 +792,16 @@ for(var __webpack_i__ in (()=>{
|
|
793
792
|
},
|
794
793
|
webpack: {
|
795
794
|
util: {
|
796
|
-
createHash: __webpack_require__("./src/util/createHash.ts").
|
797
|
-
cleverMerge: __webpack_require__("./src/util/cleverMerge.ts").
|
795
|
+
createHash: __webpack_require__("./src/util/createHash.ts").n,
|
796
|
+
cleverMerge: __webpack_require__("./src/util/cleverMerge.ts").ks
|
798
797
|
}
|
799
798
|
}
|
800
799
|
}, loaderContext._compilation = {
|
801
800
|
...loaderContext._compilation,
|
802
|
-
getPath: (filename, data)=>sendRequest(
|
803
|
-
getPathWithInfo: (filename, data)=>sendRequest(
|
804
|
-
getAssetPath: (filename, data)=>sendRequest(
|
805
|
-
getAssetPathWithInfo: (filename, data)=>sendRequest(
|
801
|
+
getPath: (filename, data)=>sendRequest("CompilationGetPath", filename, data).wait(),
|
802
|
+
getPathWithInfo: (filename, data)=>sendRequest("CompilationGetPathWithInfo", filename, data).wait(),
|
803
|
+
getAssetPath: (filename, data)=>sendRequest("CompilationGetAssetPath", filename, data).wait(),
|
804
|
+
getAssetPathWithInfo: (filename, data)=>sendRequest("CompilationGetAssetPathWithInfo", filename, data).wait()
|
806
805
|
};
|
807
806
|
let _module = loaderContext._module;
|
808
807
|
loaderContext._module = {
|
@@ -814,13 +813,13 @@ for(var __webpack_i__ in (()=>{
|
|
814
813
|
rawRequest: _module.rawRequest
|
815
814
|
}, loaderContext.importModule = function(request, options, callback) {
|
816
815
|
if (!callback) return new Promise((resolve, reject)=>{
|
817
|
-
sendRequest(
|
816
|
+
sendRequest("ImportModule", request, options).then((result)=>{
|
818
817
|
resolve(result);
|
819
818
|
}, (err)=>{
|
820
819
|
reject(err);
|
821
820
|
});
|
822
821
|
});
|
823
|
-
sendRequest(
|
822
|
+
sendRequest("ImportModule", request, options).then((result)=>{
|
824
823
|
callback(null, result);
|
825
824
|
}, (err)=>{
|
826
825
|
callback(err);
|
@@ -855,7 +854,7 @@ for(var __webpack_i__ in (()=>{
|
|
855
854
|
else options = external_node_querystring_default().parse(options);
|
856
855
|
return null == options && (options = {}), options;
|
857
856
|
}, loaderContext.cacheable = function(flag) {
|
858
|
-
!1 === flag && sendRequest(
|
857
|
+
!1 === flag && sendRequest("SetCacheable", !1);
|
859
858
|
}, Object.defineProperty(loaderContext, "data", {
|
860
859
|
enumerable: !0,
|
861
860
|
get: ()=>loaderContext.loaders[loaderContext.loaderIndex].loaderItem.data,
|
@@ -898,7 +897,7 @@ for(var __webpack_i__ in (()=>{
|
|
898
897
|
}(args1[0]) : raw && "string" == typeof args1[0] && (args1[0] = Buffer.from(args1[0], "utf-8")), raw && args1[0] instanceof Uint8Array && !Buffer.isBuffer(args1[0]) && (args1[0] = Buffer.from(args1[0].buffer)), args = await utils_runSyncOrAsync(fn, loaderContext, args) || []);
|
899
898
|
}
|
900
899
|
}
|
901
|
-
return sendRequest(
|
900
|
+
return sendRequest("UpdateLoaderObjects", loaderContext.loaders.map((item)=>({
|
902
901
|
data: item.loaderItem.data,
|
903
902
|
normalExecuted: item.normalExecuted,
|
904
903
|
pitchExecuted: item.pitchExecuted
|
@@ -936,7 +935,7 @@ for(var __webpack_i__ in (()=>{
|
|
936
935
|
resolve(data);
|
937
936
|
};
|
938
937
|
});
|
939
|
-
return result.wait = ()=>sendRequest.sync(
|
938
|
+
return result.wait = ()=>sendRequest.sync("WaitForPendingRequest", id), result.id = id, result;
|
940
939
|
};
|
941
940
|
return sendRequest.sync = (workerSyncPort1 = workerSyncPort, (requestType, ...args)=>{
|
942
941
|
let id = nextId++, sharedBuffer = new SharedArrayBuffer(8), sharedBufferView = new Int32Array(sharedBuffer);
|
@@ -954,7 +953,7 @@ for(var __webpack_i__ in (()=>{
|
|
954
953
|
if (isWorkerResponseMessage(message)) return message.data;
|
955
954
|
throw message.error;
|
956
955
|
}), sendRequest;
|
957
|
-
}(workerData.workerPort, workerData.workerSyncPort), waitFor = (sendRequest = sendRequest1, (requests)=>sendRequest.sync(
|
956
|
+
}(workerData.workerPort, workerData.workerSyncPort), waitFor = (sendRequest = sendRequest1, (requests)=>sendRequest.sync("WaitForPendingRequest", (Array.isArray(requests) ? requests : [
|
958
957
|
requests
|
959
958
|
]).map((request)=>request.id)));
|
960
959
|
loaderImpl(workerOptions, sendRequest1, waitFor).then(async (data)=>{
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspack/core",
|
3
|
-
"version": "1.5.0-beta.
|
3
|
+
"version": "1.5.0-beta.1",
|
4
4
|
"webpackVersion": "5.75.0",
|
5
5
|
"license": "MIT",
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
@@ -38,14 +38,14 @@
|
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
40
|
"@ast-grep/napi": "^0.39.1",
|
41
|
-
"@rsbuild/
|
42
|
-
"@rslib/core": "0.
|
41
|
+
"@rsbuild/plugin-node-polyfill": "^1.4.1",
|
42
|
+
"@rslib/core": "0.12.1",
|
43
43
|
"@swc/types": "0.1.23",
|
44
|
-
"@rsbuild/plugin-node-polyfill": "^1.3.0",
|
45
44
|
"@types/graceful-fs": "4.1.9",
|
46
45
|
"@types/watchpack": "^2.4.4",
|
47
46
|
"browserslist-load-config": "^1.0.0",
|
48
47
|
"enhanced-resolve": "5.18.2",
|
48
|
+
"glob-to-regexp": "^0.4.1",
|
49
49
|
"graceful-fs": "^4.2.11",
|
50
50
|
"memfs": "4.36.0",
|
51
51
|
"prebundle": "^1.4.1",
|
@@ -54,14 +54,13 @@
|
|
54
54
|
"typescript": "^5.9.2",
|
55
55
|
"watchpack": "^2.4.4",
|
56
56
|
"webpack-sources": "3.3.3",
|
57
|
-
"glob-to-regexp": "^0.4.1",
|
58
57
|
"zod": "^3.25.76",
|
59
58
|
"zod-validation-error": "3.5.3"
|
60
59
|
},
|
61
60
|
"dependencies": {
|
62
|
-
"@module-federation/runtime-tools": "0.
|
61
|
+
"@module-federation/runtime-tools": "0.18.0",
|
63
62
|
"@rspack/lite-tapable": "1.0.1",
|
64
|
-
"@rspack/binding": "1.5.0-beta.
|
63
|
+
"@rspack/binding": "1.5.0-beta.1"
|
65
64
|
},
|
66
65
|
"peerDependencies": {
|
67
66
|
"@swc/helpers": ">=0.5.1"
|
@@ -1,29 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* The following code is modified based on
|
3
|
-
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/NormalModuleReplacementPlugin.js
|
4
|
-
*
|
5
|
-
* MIT Licensed
|
6
|
-
* Author Tobias Koppers @sokra
|
7
|
-
* Copyright (c) JS Foundation and other contributors
|
8
|
-
* https://github.com/webpack/webpack/blob/main/LICENSE
|
9
|
-
*/
|
10
|
-
import type { Compiler } from "../Compiler";
|
11
|
-
import type { ResolveData } from "../Module";
|
12
|
-
type ModuleReplacer = (createData: ResolveData) => void;
|
13
|
-
export declare class NormalModuleReplacementPlugin {
|
14
|
-
readonly resourceRegExp: RegExp;
|
15
|
-
readonly newResource: string | ModuleReplacer;
|
16
|
-
/**
|
17
|
-
* Create an instance of the plugin
|
18
|
-
* @param resourceRegExp the resource matcher
|
19
|
-
* @param newResource the resource replacement
|
20
|
-
*/
|
21
|
-
constructor(resourceRegExp: RegExp, newResource: string | ModuleReplacer);
|
22
|
-
/**
|
23
|
-
* Apply the plugin
|
24
|
-
* @param compiler the compiler instance
|
25
|
-
* @returns
|
26
|
-
*/
|
27
|
-
apply(compiler: Compiler): void;
|
28
|
-
}
|
29
|
-
export {};
|