@rspack-canary/browser 1.5.9-canary-ec64d52e-20251008173631 → 1.5.9-canary-b4bf7a8b-20251011023631
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/browser/{BrowserRequire.d.ts → BrowserRequirePlugin.d.ts} +10 -4
- package/dist/browser/index.d.ts +1 -1
- package/dist/config/normalization.d.ts +3 -0
- package/dist/config/types.d.ts +1 -0
- package/dist/container/ModuleFederationPlugin.d.ts +1 -1
- package/dist/index.mjs +44 -194
- package/dist/napi-binding.d.ts +0 -1
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/package.json +1 -1
|
@@ -12,12 +12,18 @@ interface BrowserRequirePluginOptions {
|
|
|
12
12
|
/**
|
|
13
13
|
* This function defines how to execute CommonJS code.
|
|
14
14
|
*/
|
|
15
|
-
execute
|
|
15
|
+
execute?: (code: string, runtime: CommonJsRuntime) => void;
|
|
16
|
+
/**
|
|
17
|
+
* This option provides a direct mapping from the module specifier to the module content, similar to the mechanism of a virtual module.
|
|
18
|
+
* If this option is not provided or the mapping result is undefined, it will fallback to resolving from memfs and run `execute`.
|
|
19
|
+
*/
|
|
20
|
+
modules?: Record<string, unknown> | ((id: string) => unknown);
|
|
16
21
|
}
|
|
17
22
|
/**
|
|
18
23
|
* This plugin inject browser-compatible `require` function to the `Compiler`.
|
|
19
|
-
* 1.
|
|
20
|
-
* 2.
|
|
24
|
+
* 1. This plugin makes it possible to use custom loaders in browser by providing a virtual module mechanism.
|
|
25
|
+
* 2. This plugin resolves the JavaScript in the memfs with Node.js resolution algorithm rather than in the host filesystem.
|
|
26
|
+
* 3. This plugin transform ESM to CommonJS which will be executed with a user-defined `execute` function.
|
|
21
27
|
*/
|
|
22
28
|
export declare class BrowserRequirePlugin {
|
|
23
29
|
private options;
|
|
@@ -25,7 +31,7 @@ export declare class BrowserRequirePlugin {
|
|
|
25
31
|
* This is an unsafe way to execute code in the browser using `new Function`.
|
|
26
32
|
* It is your responsibility to ensure that your application is not vulnerable to attacks due to this function.
|
|
27
33
|
*/
|
|
28
|
-
static unsafeExecute: (code: string, runtime: CommonJsRuntime) => void;
|
|
34
|
+
static unsafeExecute: ((code: string, runtime: CommonJsRuntime) => void) | undefined;
|
|
29
35
|
constructor(options: BrowserRequirePluginOptions);
|
|
30
36
|
apply(compiler: Compiler): void;
|
|
31
37
|
}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "../index";
|
|
2
2
|
export { BrowserHttpImportEsmPlugin } from "./BrowserHttpImportEsmPlugin";
|
|
3
|
-
export { BrowserRequirePlugin } from "./
|
|
3
|
+
export { BrowserRequirePlugin } from "./BrowserRequirePlugin";
|
|
4
4
|
export declare const builtinMemFs: {
|
|
5
5
|
fs: import("memfs").IFs;
|
|
6
6
|
volume: import("memfs").Volume;
|
|
@@ -105,6 +105,9 @@ export interface ExperimentsNormalized {
|
|
|
105
105
|
outputModule?: boolean;
|
|
106
106
|
topLevelAwait?: boolean;
|
|
107
107
|
css?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated This option is deprecated, layers is enabled since v1.6.0
|
|
110
|
+
*/
|
|
108
111
|
layers?: boolean;
|
|
109
112
|
incremental?: false | Incremental;
|
|
110
113
|
parallelCodeSplitting?: boolean;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface ModuleFederationPluginOptions extends Omit<ModuleFederationPlug
|
|
|
5
5
|
implementation?: string;
|
|
6
6
|
shareStrategy?: "version-first" | "loaded-first";
|
|
7
7
|
}
|
|
8
|
-
export type RuntimePlugins = string[];
|
|
8
|
+
export type RuntimePlugins = string[] | [string, Record<string, unknown>][];
|
|
9
9
|
export declare class ModuleFederationPlugin {
|
|
10
10
|
private _options;
|
|
11
11
|
constructor(_options: ModuleFederationPluginOptions);
|
package/dist/index.mjs
CHANGED
|
@@ -37617,7 +37617,6 @@ class EntryOptionPlugin {
|
|
|
37617
37617
|
asyncChunks: desc.asyncChunks,
|
|
37618
37618
|
library: desc.library
|
|
37619
37619
|
};
|
|
37620
|
-
if (void 0 !== desc.layer && !compiler.options.experiments.layers) throw new Error("'entryOptions.layer' is only allowed when 'experiments.layers' is enabled");
|
|
37621
37620
|
return options;
|
|
37622
37621
|
}
|
|
37623
37622
|
}
|
|
@@ -38274,7 +38273,7 @@ function trace_define_property(obj, key, value) {
|
|
|
38274
38273
|
else obj[key] = value;
|
|
38275
38274
|
return obj;
|
|
38276
38275
|
}
|
|
38277
|
-
class
|
|
38276
|
+
class trace_JavaScriptTracer {
|
|
38278
38277
|
static async initJavaScriptTrace(layer, output) {
|
|
38279
38278
|
const { Session } = await Promise.resolve().then(function() {
|
|
38280
38279
|
var e = new Error("Cannot find module 'node:inspector'");
|
|
@@ -38393,13 +38392,13 @@ class JavaScriptTracer {
|
|
|
38393
38392
|
});
|
|
38394
38393
|
}
|
|
38395
38394
|
}
|
|
38396
|
-
trace_define_property(
|
|
38397
|
-
trace_define_property(
|
|
38398
|
-
trace_define_property(
|
|
38399
|
-
trace_define_property(
|
|
38400
|
-
trace_define_property(
|
|
38401
|
-
trace_define_property(
|
|
38402
|
-
trace_define_property(
|
|
38395
|
+
trace_define_property(trace_JavaScriptTracer, "state", "uninitialized");
|
|
38396
|
+
trace_define_property(trace_JavaScriptTracer, "startTime", void 0);
|
|
38397
|
+
trace_define_property(trace_JavaScriptTracer, "events", void 0);
|
|
38398
|
+
trace_define_property(trace_JavaScriptTracer, "layer", void 0);
|
|
38399
|
+
trace_define_property(trace_JavaScriptTracer, "output", void 0);
|
|
38400
|
+
trace_define_property(trace_JavaScriptTracer, "session", void 0);
|
|
38401
|
+
trace_define_property(trace_JavaScriptTracer, "counter", 10000);
|
|
38403
38402
|
var crypto_browserify = __webpack_require__("../../node_modules/.pnpm/crypto-browserify@3.12.1/node_modules/crypto-browserify/index.js");
|
|
38404
38403
|
const CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/;
|
|
38405
38404
|
function createMessage(method) {
|
|
@@ -39012,8 +39011,8 @@ async function runLoaders(compiler, context) {
|
|
|
39012
39011
|
const loaderState = context.loaderState;
|
|
39013
39012
|
const pitch = loaderState === external_rspack_wasi_browser_js_.JsLoaderState.Pitching;
|
|
39014
39013
|
const { resource } = context;
|
|
39015
|
-
const uuid =
|
|
39016
|
-
|
|
39014
|
+
const uuid = trace_JavaScriptTracer.uuid();
|
|
39015
|
+
trace_JavaScriptTracer.startAsync({
|
|
39017
39016
|
name: "run_js_loaders",
|
|
39018
39017
|
processName: LOADER_PROCESS_NAME,
|
|
39019
39018
|
uuid,
|
|
@@ -39067,7 +39066,7 @@ async function runLoaders(compiler, context) {
|
|
|
39067
39066
|
context.cacheable = true;
|
|
39068
39067
|
};
|
|
39069
39068
|
loaderContext.importModule = function(request, userOptions, callback) {
|
|
39070
|
-
|
|
39069
|
+
trace_JavaScriptTracer.startAsync({
|
|
39071
39070
|
name: "importModule",
|
|
39072
39071
|
processName: LOADER_PROCESS_NAME,
|
|
39073
39072
|
uuid,
|
|
@@ -39081,7 +39080,7 @@ async function runLoaders(compiler, context) {
|
|
|
39081
39080
|
function finalCallback(onError, onDone) {
|
|
39082
39081
|
return function(err, res) {
|
|
39083
39082
|
if (err) {
|
|
39084
|
-
|
|
39083
|
+
trace_JavaScriptTracer.endAsync({
|
|
39085
39084
|
name: "importModule",
|
|
39086
39085
|
processName: LOADER_PROCESS_NAME,
|
|
39087
39086
|
uuid,
|
|
@@ -39097,7 +39096,7 @@ async function runLoaders(compiler, context) {
|
|
|
39097
39096
|
for (const dep of res.missingDependencies)context.addMissingDependency(dep);
|
|
39098
39097
|
for (const dep of res.fileDependencies)context.addDependency(dep);
|
|
39099
39098
|
if (false === res.cacheable) context.cacheable(false);
|
|
39100
|
-
|
|
39099
|
+
trace_JavaScriptTracer.endAsync({
|
|
39101
39100
|
name: "importModule",
|
|
39102
39101
|
processName: LOADER_PROCESS_NAME,
|
|
39103
39102
|
uuid,
|
|
@@ -39483,7 +39482,7 @@ async function runLoaders(compiler, context) {
|
|
|
39483
39482
|
const pitch = loaderState === external_rspack_wasi_browser_js_.JsLoaderState.Pitching;
|
|
39484
39483
|
const loaderName = extractLoaderName(currentLoaderObject.request);
|
|
39485
39484
|
let result;
|
|
39486
|
-
|
|
39485
|
+
trace_JavaScriptTracer.startAsync({
|
|
39487
39486
|
name: loaderName,
|
|
39488
39487
|
trackName: loaderName,
|
|
39489
39488
|
processName: LOADER_PROCESS_NAME,
|
|
@@ -39502,7 +39501,7 @@ async function runLoaders(compiler, context) {
|
|
|
39502
39501
|
if (loaderState === external_rspack_wasi_browser_js_.JsLoaderState.Normal) convertArgs(args, !!(null == currentLoaderObject ? void 0 : currentLoaderObject.raw));
|
|
39503
39502
|
result = await utils_runSyncOrAsync(fn, loaderContext, args) || [];
|
|
39504
39503
|
}
|
|
39505
|
-
|
|
39504
|
+
trace_JavaScriptTracer.endAsync({
|
|
39506
39505
|
name: loaderName,
|
|
39507
39506
|
trackName: loaderName,
|
|
39508
39507
|
processName: LOADER_PROCESS_NAME,
|
|
@@ -39584,7 +39583,7 @@ async function runLoaders(compiler, context) {
|
|
|
39584
39583
|
context.__internal__error = error;
|
|
39585
39584
|
} else context.__internal__error = e;
|
|
39586
39585
|
}
|
|
39587
|
-
|
|
39586
|
+
trace_JavaScriptTracer.endAsync({
|
|
39588
39587
|
name: "run_js_loaders",
|
|
39589
39588
|
uuid,
|
|
39590
39589
|
args: {
|
|
@@ -46607,7 +46606,7 @@ const applyExperimentsDefaults = (experiments, { development })=>{
|
|
|
46607
46606
|
D(experiments, "lazyCompilation", false);
|
|
46608
46607
|
D(experiments, "asyncWebAssembly", experiments.futureDefaults);
|
|
46609
46608
|
D(experiments, "css", experiments.futureDefaults ? true : void 0);
|
|
46610
|
-
|
|
46609
|
+
if ("layers" in experiments) console.warn("`experiments.layers` config has been deprecated and will be removed in Rspack v2.0. Feature layers will be always enabled. Please remove this option from your Rspack configuration.");
|
|
46611
46610
|
if (false === 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.");
|
|
46612
46611
|
D(experiments, "topLevelAwait", true);
|
|
46613
46612
|
D(experiments, "buildHttp", void 0);
|
|
@@ -46644,7 +46643,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
|
|
|
46644
46643
|
if ("object" == typeof rspackFuture) {
|
|
46645
46644
|
D(rspackFuture, "bundlerInfo", {});
|
|
46646
46645
|
if ("object" == typeof rspackFuture.bundlerInfo) {
|
|
46647
|
-
D(rspackFuture.bundlerInfo, "version", "1.5.9-canary-
|
|
46646
|
+
D(rspackFuture.bundlerInfo, "version", "1.5.9-canary-b4bf7a8b-20251011023631");
|
|
46648
46647
|
D(rspackFuture.bundlerInfo, "bundler", "rspack");
|
|
46649
46648
|
D(rspackFuture.bundlerInfo, "force", !library);
|
|
46650
46649
|
}
|
|
@@ -49322,166 +49321,6 @@ const createNormalModuleFactoryHooksRegisters = (getCompiler, createTap, createM
|
|
|
49322
49321
|
};
|
|
49323
49322
|
})
|
|
49324
49323
|
});
|
|
49325
|
-
function traceHookPlugin_define_property(obj, key, value) {
|
|
49326
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
49327
|
-
value: value,
|
|
49328
|
-
enumerable: true,
|
|
49329
|
-
configurable: true,
|
|
49330
|
-
writable: true
|
|
49331
|
-
});
|
|
49332
|
-
else obj[key] = value;
|
|
49333
|
-
return obj;
|
|
49334
|
-
}
|
|
49335
|
-
const traceHookPlugin_PLUGIN_NAME = "TraceHookPlugin";
|
|
49336
|
-
const PLUGIN_PROCESS_NAME = "Plugin Analysis";
|
|
49337
|
-
const makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
|
|
49338
|
-
register: (tapInfo)=>{
|
|
49339
|
-
const { name, type, fn: internalFn } = tapInfo;
|
|
49340
|
-
const newFn = name === traceHookPlugin_PLUGIN_NAME ? internalFn : makeNewTraceTapFn(compilerName, hookName, tracer, {
|
|
49341
|
-
name,
|
|
49342
|
-
type,
|
|
49343
|
-
fn: internalFn
|
|
49344
|
-
});
|
|
49345
|
-
return {
|
|
49346
|
-
...tapInfo,
|
|
49347
|
-
fn: newFn
|
|
49348
|
-
};
|
|
49349
|
-
}
|
|
49350
|
-
});
|
|
49351
|
-
const interceptAllHooksFor = (instance, tracer, logLabel)=>{
|
|
49352
|
-
if (Reflect.has(instance, "hooks")) for (const hookName of Object.keys(instance.hooks)){
|
|
49353
|
-
const hook = instance.hooks[hookName];
|
|
49354
|
-
if (hook && !hook._fakeHook) hook.intercept(makeInterceptorFor(logLabel, tracer)(hookName));
|
|
49355
|
-
}
|
|
49356
|
-
};
|
|
49357
|
-
const makeNewTraceTapFn = (compilerName, hookName, tracer, { name: pluginName, type, fn })=>{
|
|
49358
|
-
switch(type){
|
|
49359
|
-
case "promise":
|
|
49360
|
-
return (...args)=>{
|
|
49361
|
-
const uuid = tracer.uuid();
|
|
49362
|
-
tracer.startAsync({
|
|
49363
|
-
name: hookName,
|
|
49364
|
-
trackName: pluginName,
|
|
49365
|
-
processName: PLUGIN_PROCESS_NAME,
|
|
49366
|
-
uuid,
|
|
49367
|
-
args: {
|
|
49368
|
-
compilerName,
|
|
49369
|
-
hookName,
|
|
49370
|
-
pluginName
|
|
49371
|
-
}
|
|
49372
|
-
});
|
|
49373
|
-
const promise = fn(...args);
|
|
49374
|
-
return promise.then((r)=>{
|
|
49375
|
-
tracer.endAsync({
|
|
49376
|
-
name: hookName,
|
|
49377
|
-
trackName: pluginName,
|
|
49378
|
-
processName: PLUGIN_PROCESS_NAME,
|
|
49379
|
-
uuid,
|
|
49380
|
-
args: {
|
|
49381
|
-
compilerName,
|
|
49382
|
-
hookName,
|
|
49383
|
-
pluginName
|
|
49384
|
-
}
|
|
49385
|
-
});
|
|
49386
|
-
return r;
|
|
49387
|
-
});
|
|
49388
|
-
};
|
|
49389
|
-
case "async":
|
|
49390
|
-
return (...args)=>{
|
|
49391
|
-
const uuid = tracer.uuid();
|
|
49392
|
-
tracer.startAsync({
|
|
49393
|
-
name: hookName,
|
|
49394
|
-
trackName: pluginName,
|
|
49395
|
-
processName: PLUGIN_PROCESS_NAME,
|
|
49396
|
-
uuid,
|
|
49397
|
-
args: {
|
|
49398
|
-
compilerName,
|
|
49399
|
-
hookName,
|
|
49400
|
-
pluginName
|
|
49401
|
-
}
|
|
49402
|
-
});
|
|
49403
|
-
const callback = args.pop();
|
|
49404
|
-
fn(...args, (...r)=>{
|
|
49405
|
-
tracer.endAsync({
|
|
49406
|
-
name: hookName,
|
|
49407
|
-
trackName: pluginName,
|
|
49408
|
-
processName: PLUGIN_PROCESS_NAME,
|
|
49409
|
-
uuid,
|
|
49410
|
-
args: {
|
|
49411
|
-
compilerName,
|
|
49412
|
-
hookName,
|
|
49413
|
-
pluginName
|
|
49414
|
-
}
|
|
49415
|
-
});
|
|
49416
|
-
callback(...r);
|
|
49417
|
-
});
|
|
49418
|
-
};
|
|
49419
|
-
case "sync":
|
|
49420
|
-
return (...args)=>{
|
|
49421
|
-
const uuid = tracer.uuid();
|
|
49422
|
-
if (pluginName === traceHookPlugin_PLUGIN_NAME) return fn(...args);
|
|
49423
|
-
tracer.startAsync({
|
|
49424
|
-
name: hookName,
|
|
49425
|
-
trackName: pluginName,
|
|
49426
|
-
processName: PLUGIN_PROCESS_NAME,
|
|
49427
|
-
uuid,
|
|
49428
|
-
args: {
|
|
49429
|
-
compilerName,
|
|
49430
|
-
hookName,
|
|
49431
|
-
pluginName
|
|
49432
|
-
}
|
|
49433
|
-
});
|
|
49434
|
-
let r;
|
|
49435
|
-
try {
|
|
49436
|
-
r = fn(...args);
|
|
49437
|
-
} catch (err) {
|
|
49438
|
-
tracer.endAsync({
|
|
49439
|
-
name: hookName,
|
|
49440
|
-
trackName: pluginName,
|
|
49441
|
-
processName: PLUGIN_PROCESS_NAME,
|
|
49442
|
-
uuid,
|
|
49443
|
-
args: {
|
|
49444
|
-
hookName,
|
|
49445
|
-
pluginName
|
|
49446
|
-
}
|
|
49447
|
-
});
|
|
49448
|
-
throw err;
|
|
49449
|
-
}
|
|
49450
|
-
tracer.endAsync({
|
|
49451
|
-
name: hookName,
|
|
49452
|
-
trackName: pluginName,
|
|
49453
|
-
processName: PLUGIN_PROCESS_NAME,
|
|
49454
|
-
uuid,
|
|
49455
|
-
args: {
|
|
49456
|
-
compilerName,
|
|
49457
|
-
hookName,
|
|
49458
|
-
pluginName
|
|
49459
|
-
}
|
|
49460
|
-
});
|
|
49461
|
-
return r;
|
|
49462
|
-
};
|
|
49463
|
-
default:
|
|
49464
|
-
return fn;
|
|
49465
|
-
}
|
|
49466
|
-
};
|
|
49467
|
-
let compilerId = 0;
|
|
49468
|
-
class TraceHookPlugin {
|
|
49469
|
-
apply(compiler) {
|
|
49470
|
-
const compilerName = compiler.name || (compilerId++).toString();
|
|
49471
|
-
for (const hookName of Object.keys(compiler.hooks)){
|
|
49472
|
-
const hook = compiler.hooks[hookName];
|
|
49473
|
-
if (hook) hook.intercept(makeInterceptorFor(compilerName, JavaScriptTracer)(hookName));
|
|
49474
|
-
}
|
|
49475
|
-
compiler.hooks.compilation.tap(traceHookPlugin_PLUGIN_NAME, (compilation, { normalModuleFactory, contextModuleFactory })=>{
|
|
49476
|
-
interceptAllHooksFor(compilation, JavaScriptTracer, "Compilation");
|
|
49477
|
-
interceptAllHooksFor(normalModuleFactory, JavaScriptTracer, "Normal Module Factory");
|
|
49478
|
-
interceptAllHooksFor(contextModuleFactory, JavaScriptTracer, "Context Module Factory");
|
|
49479
|
-
});
|
|
49480
|
-
}
|
|
49481
|
-
constructor(){
|
|
49482
|
-
traceHookPlugin_define_property(this, "name", traceHookPlugin_PLUGIN_NAME);
|
|
49483
|
-
}
|
|
49484
|
-
}
|
|
49485
49324
|
__webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
49486
49325
|
const checkVersion = ()=>{};
|
|
49487
49326
|
function NativeWatchFileSystem_check_private_redeclaration(obj, privateCollection) {
|
|
@@ -50550,7 +50389,6 @@ class Compiler {
|
|
|
50550
50389
|
this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader);
|
|
50551
50390
|
new JsLoaderRspackPlugin(this).apply(this);
|
|
50552
50391
|
new ExecuteModulePlugin().apply(this);
|
|
50553
|
-
new TraceHookPlugin().apply(this);
|
|
50554
50392
|
}
|
|
50555
50393
|
}
|
|
50556
50394
|
function build(callback) {
|
|
@@ -50745,7 +50583,7 @@ class MultiStats {
|
|
|
50745
50583
|
return obj;
|
|
50746
50584
|
});
|
|
50747
50585
|
if (childOptions.version) {
|
|
50748
|
-
obj.rspackVersion = "1.5.9-canary-
|
|
50586
|
+
obj.rspackVersion = "1.5.9-canary-b4bf7a8b-20251011023631";
|
|
50749
50587
|
obj.version = "5.75.0";
|
|
50750
50588
|
}
|
|
50751
50589
|
if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
|
|
@@ -52053,7 +51891,7 @@ const SIMPLE_EXTRACTORS = {
|
|
|
52053
51891
|
},
|
|
52054
51892
|
version: (object)=>{
|
|
52055
51893
|
object.version = "5.75.0";
|
|
52056
|
-
object.rspackVersion = "1.5.9-canary-
|
|
51894
|
+
object.rspackVersion = "1.5.9-canary-b4bf7a8b-20251011023631";
|
|
52057
51895
|
},
|
|
52058
51896
|
env: (object, _compilation, _context, { _env })=>{
|
|
52059
51897
|
object.env = _env;
|
|
@@ -56123,8 +55961,12 @@ function getDefaultEntryRuntime(paths, options, compiler) {
|
|
|
56123
55961
|
const runtimePluginVars = [];
|
|
56124
55962
|
for(let i = 0; i < runtimePlugins.length; i++){
|
|
56125
55963
|
const runtimePluginVar = `__module_federation_runtime_plugin_${i}__`;
|
|
56126
|
-
|
|
56127
|
-
|
|
55964
|
+
const pluginSpec = runtimePlugins[i];
|
|
55965
|
+
const pluginPath = Array.isArray(pluginSpec) ? pluginSpec[0] : pluginSpec;
|
|
55966
|
+
const pluginParams = Array.isArray(pluginSpec) ? pluginSpec[1] : void 0;
|
|
55967
|
+
runtimePluginImports.push(`import ${runtimePluginVar} from ${JSON.stringify(pluginPath)}`);
|
|
55968
|
+
const paramsCode = void 0 === pluginParams ? "undefined" : JSON.stringify(pluginParams);
|
|
55969
|
+
runtimePluginVars.push(`${runtimePluginVar}(${paramsCode})`);
|
|
56128
55970
|
}
|
|
56129
55971
|
const content = [
|
|
56130
55972
|
`import __module_federation_bundler_runtime__ from ${JSON.stringify(paths.bundlerRuntime)}`,
|
|
@@ -56133,7 +55975,7 @@ function getDefaultEntryRuntime(paths, options, compiler) {
|
|
|
56133
55975
|
`const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
|
|
56134
55976
|
`const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
|
|
56135
55977
|
`const __module_federation_share_strategy__ = ${JSON.stringify(options.shareStrategy ?? "version-first")}`,
|
|
56136
|
-
'if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){var __webpack_require___remotesLoadingData,__webpack_require___remotesLoadingData1,__webpack_require___initializeSharingData,__webpack_require___consumesLoadingData,__webpack_require___consumesLoadingData1,__webpack_require___initializeExposesData,__webpack_require___consumesLoadingData2;const override=(obj,key,value)=>{if(!obj)return;if(obj[key])obj[key]=value};const merge=(obj,key,fn)=>{const value=fn();if(Array.isArray(value)){var _obj,_key;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1;var _1;(_1=(_obj1=obj)[_key1=key])!==null&&_1!==void 0?_1:_obj1[_key1]={};Object.assign(obj[key],value)}};const early=(obj,key,initial)=>{var _obj,_key;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};var __webpack_require___remotesLoadingData_chunkMapping;const remotesLoadingChunkMapping=(__webpack_require___remotesLoadingData_chunkMapping=(__webpack_require___remotesLoadingData=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData===void 0?void 0:__webpack_require___remotesLoadingData.chunkMapping)!==null&&__webpack_require___remotesLoadingData_chunkMapping!==void 0?__webpack_require___remotesLoadingData_chunkMapping:{};var __webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping;const remotesLoadingModuleIdToRemoteDataMapping=(__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping=(__webpack_require___remotesLoadingData1=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData1===void 0?void 0:__webpack_require___remotesLoadingData1.moduleIdToRemoteDataMapping)!==null&&__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping!==void 0?__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping:{};var __webpack_require___initializeSharingData_scopeToSharingDataMapping;const initializeSharingScopeToInitDataMapping=(__webpack_require___initializeSharingData_scopeToSharingDataMapping=(__webpack_require___initializeSharingData=__webpack_require__.initializeSharingData)===null||__webpack_require___initializeSharingData===void 0?void 0:__webpack_require___initializeSharingData.scopeToSharingDataMapping)!==null&&__webpack_require___initializeSharingData_scopeToSharingDataMapping!==void 0?__webpack_require___initializeSharingData_scopeToSharingDataMapping:{};var __webpack_require___consumesLoadingData_chunkMapping;const consumesLoadingChunkMapping=(__webpack_require___consumesLoadingData_chunkMapping=(__webpack_require___consumesLoadingData=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData===void 0?void 0:__webpack_require___consumesLoadingData.chunkMapping)!==null&&__webpack_require___consumesLoadingData_chunkMapping!==void 0?__webpack_require___consumesLoadingData_chunkMapping:{};var __webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping;const consumesLoadingModuleToConsumeDataMapping=(__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping=(__webpack_require___consumesLoadingData1=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData1===void 0?void 0:__webpack_require___consumesLoadingData1.moduleIdToConsumeDataMapping)!==null&&__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping!==void 0?__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping:{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens={};const containerShareScope=(__webpack_require___initializeExposesData=__webpack_require__.initializeExposesData)===null||__webpack_require___initializeExposesData===void 0?void 0:__webpack_require___initializeExposesData.shareScope;for(const key in __module_federation_bundler_runtime__){__webpack_require__.federation[key]=__module_federation_bundler_runtime__[key]}early(__webpack_require__.federation,"consumesLoadingModuleToHandlerMapping",()=>{const consumesLoadingModuleToHandlerMapping={};for(let[moduleId,data]of Object.entries(consumesLoadingModuleToConsumeDataMapping)){consumesLoadingModuleToHandlerMapping[moduleId]={getter:data.fallback,shareInfo:{shareConfig:{fixedDependencies:false,requiredVersion:data.requiredVersion,strictVersion:data.strictVersion,singleton:data.singleton,eager:data.eager},scope:[data.shareScope]},shareKey:data.shareKey}}return consumesLoadingModuleToHandlerMapping});early(__webpack_require__.federation,"initOptions",()=>({}));early(__webpack_require__.federation.initOptions,"name",()=>__module_federation_container_name__);early(__webpack_require__.federation.initOptions,"shareStrategy",()=>__module_federation_share_strategy__);early(__webpack_require__.federation.initOptions,"shared",()=>{const shared={};for(let[scope,stages]of Object.entries(initializeSharingScopeToInitDataMapping)){for(let stage of stages){if(typeof stage==="object"&&stage!==null){const{name,version,factory,eager,singleton,requiredVersion,strictVersion}=stage;const shareConfig={};const isValidValue=function(val){return typeof val!=="undefined"};if(isValidValue(singleton)){shareConfig.singleton=singleton}if(isValidValue(requiredVersion)){shareConfig.requiredVersion=requiredVersion}if(isValidValue(eager)){shareConfig.eager=eager}if(isValidValue(strictVersion)){shareConfig.strictVersion=strictVersion}const options={version,scope:[scope],shareConfig,get:factory};if(shared[name]){shared[name].push(options)}else{shared[name]=[options]}}}}return shared});merge(__webpack_require__.federation.initOptions,"remotes",()=>Object.values(__module_federation_remote_infos__).flat().filter(remote=>remote.externalType==="script"));merge(__webpack_require__.federation.initOptions,"plugins",()=>__module_federation_runtime_plugins__);early(__webpack_require__.federation,"bundlerRuntimeOptions",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions,"remotes",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>remotesLoadingChunkMapping);early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{const remotesLoadingIdToExternalAndNameMappingMapping={};for(let[moduleId,data]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){remotesLoadingIdToExternalAndNameMappingMapping[moduleId]=[data.shareScope,data.name,data.externalModuleId,data.remoteName]}return remotesLoadingIdToExternalAndNameMappingMapping});early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>__webpack_require__);merge(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{const idToRemoteMap={};for(let[id,remoteData]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){const info=__module_federation_remote_infos__[remoteData.remoteName];if(info)idToRemoteMap[id]=info}return idToRemoteMap});override(__webpack_require__,"S",__webpack_require__.federation.bundlerRuntime.S);if(__webpack_require__.federation.attachShareScopeMap){__webpack_require__.federation.attachShareScopeMap(__webpack_require__)}override(__webpack_require__.f,"remotes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.remotes({chunkId,promises,chunkMapping:remotesLoadingChunkMapping,idToExternalAndNameMapping:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:__webpack_require__}));override(__webpack_require__.f,"consumes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.consumes({chunkId,promises,chunkMapping:consumesLoadingChunkMapping,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping,installedModules:consumesLoadinginstalledModules,webpackRequire:__webpack_require__}));override(__webpack_require__,"I",(name,initScope)=>__webpack_require__.federation.bundlerRuntime.I({shareScopeName:name,initScope,initPromises:initializeSharingInitPromises,initTokens:initializeSharingInitTokens,webpackRequire:__webpack_require__}));override(__webpack_require__,"initContainer",(shareScope,initScope,remoteEntryInitOptions)=>__webpack_require__.federation.bundlerRuntime.initContainerEntry({shareScope,initScope,remoteEntryInitOptions,shareScopeKey:containerShareScope,webpackRequire:__webpack_require__}));override(__webpack_require__,"getContainer",(module1,getScope)=>{var moduleMap=__webpack_require__.initializeExposesData.moduleMap;__webpack_require__.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module1)?moduleMap[module1]():Promise.resolve().then(()=>{throw new Error(\'Module "\'+module1+\'" does not exist in container.\')});__webpack_require__.R=undefined;return getScope});__webpack_require__.federation.instance=__webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);if((__webpack_require___consumesLoadingData2=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData2===void 0?void 0:__webpack_require___consumesLoadingData2.initialConsumes){__webpack_require__.federation.bundlerRuntime.installInitialConsumes({webpackRequire:__webpack_require__,installedModules:consumesLoadinginstalledModules,initialConsumes:__webpack_require__.consumesLoadingData.initialConsumes,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping})}}'
|
|
55978
|
+
'if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){var __webpack_require___remotesLoadingData,__webpack_require___remotesLoadingData1,__webpack_require___initializeSharingData,__webpack_require___consumesLoadingData,__webpack_require___consumesLoadingData1,__webpack_require___initializeExposesData,__webpack_require___consumesLoadingData2;const override=(obj,key,value)=>{if(!obj)return;if(obj[key])obj[key]=value};const merge=(obj,key,fn)=>{const value=fn();if(Array.isArray(value)){var _obj,_key;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1;var _1;(_1=(_obj1=obj)[_key1=key])!==null&&_1!==void 0?_1:_obj1[_key1]={};Object.assign(obj[key],value)}};const early=(obj,key,initial)=>{var _obj,_key;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};var __webpack_require___remotesLoadingData_chunkMapping;const remotesLoadingChunkMapping=(__webpack_require___remotesLoadingData_chunkMapping=(__webpack_require___remotesLoadingData=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData===void 0?void 0:__webpack_require___remotesLoadingData.chunkMapping)!==null&&__webpack_require___remotesLoadingData_chunkMapping!==void 0?__webpack_require___remotesLoadingData_chunkMapping:{};var __webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping;const remotesLoadingModuleIdToRemoteDataMapping=(__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping=(__webpack_require___remotesLoadingData1=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData1===void 0?void 0:__webpack_require___remotesLoadingData1.moduleIdToRemoteDataMapping)!==null&&__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping!==void 0?__webpack_require___remotesLoadingData_moduleIdToRemoteDataMapping:{};var __webpack_require___initializeSharingData_scopeToSharingDataMapping;const initializeSharingScopeToInitDataMapping=(__webpack_require___initializeSharingData_scopeToSharingDataMapping=(__webpack_require___initializeSharingData=__webpack_require__.initializeSharingData)===null||__webpack_require___initializeSharingData===void 0?void 0:__webpack_require___initializeSharingData.scopeToSharingDataMapping)!==null&&__webpack_require___initializeSharingData_scopeToSharingDataMapping!==void 0?__webpack_require___initializeSharingData_scopeToSharingDataMapping:{};var __webpack_require___consumesLoadingData_chunkMapping;const consumesLoadingChunkMapping=(__webpack_require___consumesLoadingData_chunkMapping=(__webpack_require___consumesLoadingData=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData===void 0?void 0:__webpack_require___consumesLoadingData.chunkMapping)!==null&&__webpack_require___consumesLoadingData_chunkMapping!==void 0?__webpack_require___consumesLoadingData_chunkMapping:{};var __webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping;const consumesLoadingModuleToConsumeDataMapping=(__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping=(__webpack_require___consumesLoadingData1=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData1===void 0?void 0:__webpack_require___consumesLoadingData1.moduleIdToConsumeDataMapping)!==null&&__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping!==void 0?__webpack_require___consumesLoadingData_moduleIdToConsumeDataMapping:{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens={};const containerShareScope=(__webpack_require___initializeExposesData=__webpack_require__.initializeExposesData)===null||__webpack_require___initializeExposesData===void 0?void 0:__webpack_require___initializeExposesData.shareScope;for(const key in __module_federation_bundler_runtime__){__webpack_require__.federation[key]=__module_federation_bundler_runtime__[key]}early(__webpack_require__.federation,"consumesLoadingModuleToHandlerMapping",()=>{const consumesLoadingModuleToHandlerMapping={};for(let[moduleId,data]of Object.entries(consumesLoadingModuleToConsumeDataMapping)){consumesLoadingModuleToHandlerMapping[moduleId]={getter:data.fallback,shareInfo:{shareConfig:{fixedDependencies:false,requiredVersion:data.requiredVersion,strictVersion:data.strictVersion,singleton:data.singleton,eager:data.eager},scope:[data.shareScope]},shareKey:data.shareKey}}return consumesLoadingModuleToHandlerMapping});early(__webpack_require__.federation,"initOptions",()=>({}));early(__webpack_require__.federation.initOptions,"name",()=>__module_federation_container_name__);early(__webpack_require__.federation.initOptions,"shareStrategy",()=>__module_federation_share_strategy__);early(__webpack_require__.federation.initOptions,"shared",()=>{const shared={};for(let[scope,stages]of Object.entries(initializeSharingScopeToInitDataMapping)){for(let stage of stages){if(typeof stage==="object"&&stage!==null){const{name,version,factory,eager,singleton,requiredVersion,strictVersion}=stage;const shareConfig={};const isValidValue=function(val){return typeof val!=="undefined"};if(isValidValue(singleton)){shareConfig.singleton=singleton}if(isValidValue(requiredVersion)){shareConfig.requiredVersion=requiredVersion}if(isValidValue(eager)){shareConfig.eager=eager}if(isValidValue(strictVersion)){shareConfig.strictVersion=strictVersion}const options={version,scope:[scope],shareConfig,get:factory};if(shared[name]){shared[name].push(options)}else{shared[name]=[options]}}}}return shared});merge(__webpack_require__.federation.initOptions,"remotes",()=>Object.values(__module_federation_remote_infos__).flat().filter(remote=>remote.externalType==="script"));merge(__webpack_require__.federation.initOptions,"plugins",()=>__module_federation_runtime_plugins__);early(__webpack_require__.federation,"bundlerRuntimeOptions",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions,"remotes",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>remotesLoadingChunkMapping);early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"remoteInfos",()=>__module_federation_remote_infos__);early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{const remotesLoadingIdToExternalAndNameMappingMapping={};for(let[moduleId,data]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){remotesLoadingIdToExternalAndNameMappingMapping[moduleId]=[data.shareScope,data.name,data.externalModuleId,data.remoteName]}return remotesLoadingIdToExternalAndNameMappingMapping});early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>__webpack_require__);merge(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{const idToRemoteMap={};for(let[id,remoteData]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){const info=__module_federation_remote_infos__[remoteData.remoteName];if(info)idToRemoteMap[id]=info}return idToRemoteMap});override(__webpack_require__,"S",__webpack_require__.federation.bundlerRuntime.S);if(__webpack_require__.federation.attachShareScopeMap){__webpack_require__.federation.attachShareScopeMap(__webpack_require__)}override(__webpack_require__.f,"remotes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.remotes({chunkId,promises,chunkMapping:remotesLoadingChunkMapping,idToExternalAndNameMapping:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:__webpack_require__}));override(__webpack_require__.f,"consumes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.consumes({chunkId,promises,chunkMapping:consumesLoadingChunkMapping,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping,installedModules:consumesLoadinginstalledModules,webpackRequire:__webpack_require__}));override(__webpack_require__,"I",(name,initScope)=>__webpack_require__.federation.bundlerRuntime.I({shareScopeName:name,initScope,initPromises:initializeSharingInitPromises,initTokens:initializeSharingInitTokens,webpackRequire:__webpack_require__}));override(__webpack_require__,"initContainer",(shareScope,initScope,remoteEntryInitOptions)=>__webpack_require__.federation.bundlerRuntime.initContainerEntry({shareScope,initScope,remoteEntryInitOptions,shareScopeKey:containerShareScope,webpackRequire:__webpack_require__}));override(__webpack_require__,"getContainer",(module1,getScope)=>{var moduleMap=__webpack_require__.initializeExposesData.moduleMap;__webpack_require__.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module1)?moduleMap[module1]():Promise.resolve().then(()=>{throw new Error(\'Module "\'+module1+\'" does not exist in container.\')});__webpack_require__.R=undefined;return getScope});__webpack_require__.federation.instance=__webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);if((__webpack_require___consumesLoadingData2=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData2===void 0?void 0:__webpack_require___consumesLoadingData2.initialConsumes){__webpack_require__.federation.bundlerRuntime.installInitialConsumes({webpackRequire:__webpack_require__,installedModules:consumesLoadinginstalledModules,initialConsumes:__webpack_require__.consumesLoadingData.initialConsumes,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping})}}'
|
|
56137
55979
|
].join(";");
|
|
56138
55980
|
return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
|
|
56139
55981
|
}
|
|
@@ -56518,7 +56360,7 @@ function transformSync(source, options) {
|
|
|
56518
56360
|
const _options = JSON.stringify(options || {});
|
|
56519
56361
|
return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
|
|
56520
56362
|
}
|
|
56521
|
-
const exports_rspackVersion = "1.5.9-canary-
|
|
56363
|
+
const exports_rspackVersion = "1.5.9-canary-b4bf7a8b-20251011023631";
|
|
56522
56364
|
const exports_version = "5.75.0";
|
|
56523
56365
|
const exports_WebpackError = Error;
|
|
56524
56366
|
const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
|
|
@@ -56575,13 +56417,13 @@ const sharing = {
|
|
|
56575
56417
|
const exports_experiments = {
|
|
56576
56418
|
globalTrace: {
|
|
56577
56419
|
async register (filter, layer, output) {
|
|
56578
|
-
await
|
|
56420
|
+
await trace_JavaScriptTracer.initJavaScriptTrace(layer, output);
|
|
56579
56421
|
(0, external_rspack_wasi_browser_js_.registerGlobalTrace)(filter, layer, output);
|
|
56580
|
-
|
|
56422
|
+
trace_JavaScriptTracer.initCpuProfiler();
|
|
56581
56423
|
},
|
|
56582
56424
|
async cleanup () {
|
|
56583
|
-
await
|
|
56584
|
-
await (0, external_rspack_wasi_browser_js_.syncTraceEvent)(
|
|
56425
|
+
await trace_JavaScriptTracer.cleanupJavaScriptTrace();
|
|
56426
|
+
await (0, external_rspack_wasi_browser_js_.syncTraceEvent)(trace_JavaScriptTracer.events);
|
|
56585
56427
|
(0, external_rspack_wasi_browser_js_.cleanupGlobalTrace)();
|
|
56586
56428
|
}
|
|
56587
56429
|
},
|
|
@@ -56823,7 +56665,7 @@ function toHttpUrl(request) {
|
|
|
56823
56665
|
return;
|
|
56824
56666
|
}
|
|
56825
56667
|
}
|
|
56826
|
-
function
|
|
56668
|
+
function BrowserRequirePlugin_define_property(obj, key, value) {
|
|
56827
56669
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
56828
56670
|
value: value,
|
|
56829
56671
|
enumerable: true,
|
|
@@ -56839,8 +56681,16 @@ const unsafeExecute = (code, runtime)=>{
|
|
|
56839
56681
|
};
|
|
56840
56682
|
class BrowserRequirePlugin {
|
|
56841
56683
|
apply(compiler) {
|
|
56842
|
-
const execute = this.options
|
|
56684
|
+
const { execute, modules } = this.options;
|
|
56843
56685
|
compiler.__internal_browser_require = function browserRequire(id) {
|
|
56686
|
+
if ("function" == typeof modules) {
|
|
56687
|
+
const module = modules(id);
|
|
56688
|
+
if (module) return module;
|
|
56689
|
+
} else if ("object" == typeof modules) {
|
|
56690
|
+
const module = modules[id];
|
|
56691
|
+
if (module) return module;
|
|
56692
|
+
}
|
|
56693
|
+
if (!execute) throw Error(`You should provide 'execute' option if there's no mapping for module '${id}'`);
|
|
56844
56694
|
const { path: loaderPath } = (0, external_rspack_wasi_browser_js_.sync)("", id);
|
|
56845
56695
|
if (!loaderPath) throw new Error(`Cannot find loader of ${id}`);
|
|
56846
56696
|
const data = browser_fs["default"].readFileSync(loaderPath);
|
|
@@ -56863,11 +56713,11 @@ class BrowserRequirePlugin {
|
|
|
56863
56713
|
};
|
|
56864
56714
|
}
|
|
56865
56715
|
constructor(options){
|
|
56866
|
-
|
|
56716
|
+
BrowserRequirePlugin_define_property(this, "options", void 0);
|
|
56867
56717
|
this.options = options;
|
|
56868
56718
|
}
|
|
56869
56719
|
}
|
|
56870
|
-
|
|
56720
|
+
BrowserRequirePlugin_define_property(BrowserRequirePlugin, "unsafeExecute", unsafeExecute);
|
|
56871
56721
|
const builtinMemFs = {
|
|
56872
56722
|
fs: browser_fs.fs,
|
|
56873
56723
|
volume: browser_fs.volume
|
package/dist/napi-binding.d.ts
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/browser",
|
|
3
|
-
"version": "1.5.9-canary-
|
|
3
|
+
"version": "1.5.9-canary-b4bf7a8b-20251011023631",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",
|