@rspack/core 2.0.5 → 2.0.7
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/compiled/@rspack/lite-tapable/dist/index.d.ts +4 -4
- package/compiled/@rspack/lite-tapable/package.json +1 -1
- package/compiled/connect-next/package.json +1 -1
- package/dist/612.js +32 -0
- package/dist/RuntimeGlobals.d.ts +52 -48
- package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +33 -0
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +6 -0
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +11 -0
- package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +16 -0
- package/dist/builtin-plugin/index.d.ts +2 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +2 -2
- package/dist/config/normalization.d.ts +1 -0
- package/dist/config/types.d.ts +41 -20
- package/dist/exports.d.ts +7 -3
- package/dist/index.js +370 -210
- package/dist/sharing/IndependentSharedPlugin.d.ts +3 -0
- package/dist/sharing/SharedContainerPlugin.d.ts +1 -1
- package/dist/sharing/TreeShakingSharedPlugin.d.ts +4 -1
- package/dist/worker.js +1 -18
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -4,37 +4,11 @@ import { createRequire, createRequire as __rspack_createRequire } from "node:mod
|
|
|
4
4
|
import node_path, { isAbsolute, join, relative, resolve as external_node_path_resolve, sep } from "node:path";
|
|
5
5
|
import node_querystring from "node:querystring";
|
|
6
6
|
import node_fs, { readFileSync } from "node:fs";
|
|
7
|
+
import { __webpack_require__ } from "./612.js";
|
|
7
8
|
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
8
9
|
import * as __rspack_external_node_util_1b29d436 from "node:util";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
12
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
13
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
14
|
-
exports: {}
|
|
15
|
-
};
|
|
16
|
-
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
17
|
-
}
|
|
18
|
-
__webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
19
|
-
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
20
|
-
return __webpack_require__.d(getter, {
|
|
21
|
-
a: getter
|
|
22
|
-
}), getter;
|
|
23
|
-
}, __webpack_require__.d = (exports, definition)=>{
|
|
24
|
-
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, {
|
|
25
|
-
enumerable: !0,
|
|
26
|
-
get: definition[key]
|
|
27
|
-
});
|
|
28
|
-
}, __webpack_require__.add = function(modules) {
|
|
29
|
-
Object.assign(__webpack_require__.m, modules);
|
|
30
|
-
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
|
|
31
|
-
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
32
|
-
value: 'Module'
|
|
33
|
-
}), Object.defineProperty(exports, '__esModule', {
|
|
34
|
-
value: !0
|
|
35
|
-
});
|
|
36
|
-
}, __webpack_require__.add({
|
|
37
|
-
"../../node_modules/.pnpm/enhanced-resolve@5.21.3/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
10
|
+
__webpack_require__.add({
|
|
11
|
+
"../../node_modules/.pnpm/enhanced-resolve@5.22.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
38
12
|
let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
|
|
39
13
|
let idx = path.length - 1;
|
|
40
14
|
for(; idx >= 0;){
|
|
@@ -113,9 +87,34 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
|
113
87
|
}
|
|
114
88
|
return this._storeResult(strPath, null, result), this._enterSyncModeWhenIdle(), callbacks && runCallbacks(callbacks, null, result), result;
|
|
115
89
|
}
|
|
116
|
-
purge(what) {
|
|
117
|
-
if (
|
|
90
|
+
purge(what, options) {
|
|
91
|
+
if (null == what) {
|
|
92
|
+
if (0 !== this._mode) {
|
|
93
|
+
for (let level of (this._data.clear(), this._levels))level.clear();
|
|
94
|
+
this._enterIdleMode();
|
|
95
|
+
}
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (null != options && !0 === options.exact) {
|
|
99
|
+
if ("string" == typeof what || Buffer.isBuffer(what) || what instanceof URL || "number" == typeof what) {
|
|
100
|
+
let strWhat = "string" != typeof what ? what.toString() : what, data = this._data.get(strWhat);
|
|
101
|
+
void 0 !== data && (this._data.delete(strWhat), data.level.delete(strWhat));
|
|
102
|
+
} else for (let item of what){
|
|
103
|
+
let strItem = "string" != typeof item ? item.toString() : item, data = this._data.get(strItem);
|
|
104
|
+
void 0 !== data && (this._data.delete(strItem), data.level.delete(strItem));
|
|
105
|
+
}
|
|
106
|
+
0 === this._data.size && this._enterIdleMode();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if ("string" == typeof what || Buffer.isBuffer(what) || what instanceof URL || "number" == typeof what) {
|
|
118
110
|
let strWhat = "string" != typeof what ? what.toString() : what;
|
|
111
|
+
if ("" === strWhat) {
|
|
112
|
+
if (0 !== this._mode) {
|
|
113
|
+
for (let level of (this._data.clear(), this._levels))level.clear();
|
|
114
|
+
this._enterIdleMode();
|
|
115
|
+
}
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
119
118
|
for (let [key, data] of this._data)key.startsWith(strWhat) && (this._data.delete(key), data.level.delete(key));
|
|
120
119
|
0 === this._data.size && this._enterIdleMode();
|
|
121
120
|
} else {
|
|
@@ -128,13 +127,10 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
|
128
127
|
}
|
|
129
128
|
0 === this._data.size && this._enterIdleMode();
|
|
130
129
|
}
|
|
131
|
-
else if (0 !== this._mode) {
|
|
132
|
-
for (let level of (this._data.clear(), this._levels))level.clear();
|
|
133
|
-
this._enterIdleMode();
|
|
134
|
-
}
|
|
135
130
|
}
|
|
136
131
|
purgeParent(what) {
|
|
137
|
-
if (
|
|
132
|
+
if (null == what) this.purge();
|
|
133
|
+
else if ("string" == typeof what || Buffer.isBuffer(what) || what instanceof URL || "number" == typeof what) {
|
|
138
134
|
let strWhat = "string" != typeof what ? what.toString() : what;
|
|
139
135
|
this.purge(dirname(strWhat));
|
|
140
136
|
} else {
|
|
@@ -145,7 +141,6 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
|
145
141
|
}
|
|
146
142
|
this.purge(set);
|
|
147
143
|
}
|
|
148
|
-
else this.purge();
|
|
149
144
|
}
|
|
150
145
|
_storeResult(path, err, result) {
|
|
151
146
|
if (this._data.has(path)) return;
|
|
@@ -234,8 +229,8 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
|
234
229
|
let realpathSync = this._realpathBackend.provideSync;
|
|
235
230
|
this.realpathSync = realpathSync;
|
|
236
231
|
}
|
|
237
|
-
purge(what) {
|
|
238
|
-
this._statBackend.purge(what), this._lstatBackend.purge(what), this._readdirBackend.purgeParent(what), this._readFileBackend.purge(what), this._readlinkBackend.purge(what), this._readJsonBackend.purge(what), this._realpathBackend.purge(what);
|
|
232
|
+
purge(what, options) {
|
|
233
|
+
this._statBackend.purge(what, options), this._lstatBackend.purge(what, options), null != options && !0 === options.exact ? this._readdirBackend.purge(what, options) : this._readdirBackend.purgeParent(what), this._readFileBackend.purge(what, options), this._readlinkBackend.purge(what, options), this._readJsonBackend.purge(what, options), this._realpathBackend.purge(what, options);
|
|
239
234
|
}
|
|
240
235
|
};
|
|
241
236
|
},
|
|
@@ -243,7 +238,7 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
|
243
238
|
module.exports = __rspack_createRequire_require("process");
|
|
244
239
|
}
|
|
245
240
|
});
|
|
246
|
-
var browserslistTargetHandler_namespaceObject = {};
|
|
241
|
+
var RuntimeGlobals, key, StatsErrorCode, browserslistTargetHandler_namespaceObject = {};
|
|
247
242
|
__webpack_require__.r(browserslistTargetHandler_namespaceObject), __webpack_require__.d(browserslistTargetHandler_namespaceObject, {
|
|
248
243
|
resolve: ()=>browserslistTargetHandler_resolve
|
|
249
244
|
});
|
|
@@ -252,6 +247,7 @@ __webpack_require__.r(exports_namespaceObject), __webpack_require__.d(exports_na
|
|
|
252
247
|
AsyncDependenciesBlock: ()=>binding_namespaceObject.AsyncDependenciesBlock,
|
|
253
248
|
BannerPlugin: ()=>BannerPlugin,
|
|
254
249
|
CaseSensitivePlugin: ()=>CaseSensitivePlugin,
|
|
250
|
+
CircularCheckRspackPlugin: ()=>CircularCheckRspackPlugin,
|
|
255
251
|
CircularDependencyRspackPlugin: ()=>CircularDependencyRspackPlugin,
|
|
256
252
|
Compilation: ()=>Compilation,
|
|
257
253
|
Compiler: ()=>Compiler,
|
|
@@ -385,7 +381,7 @@ class HookBase {
|
|
|
385
381
|
queryStageRange(stageRange) {
|
|
386
382
|
return new QueriedHook(stageRange, this);
|
|
387
383
|
}
|
|
388
|
-
callAsyncStageRange(
|
|
384
|
+
callAsyncStageRange(_queried) {
|
|
389
385
|
throw Error('Hook should implement there own _callAsyncStageRange');
|
|
390
386
|
}
|
|
391
387
|
callAsync(...args) {
|
|
@@ -2490,6 +2486,28 @@ class CircularModulesInfoPlugin extends RspackBuiltinPlugin {
|
|
|
2490
2486
|
return createBuiltinPlugin(this.name, void 0);
|
|
2491
2487
|
}
|
|
2492
2488
|
}
|
|
2489
|
+
class CircularCheckRspackPlugin extends RspackBuiltinPlugin {
|
|
2490
|
+
name = binding_namespaceObject.BuiltinPluginName.CircularCheckRspackPlugin;
|
|
2491
|
+
_options;
|
|
2492
|
+
constructor(options = {}){
|
|
2493
|
+
super(), this._options = options;
|
|
2494
|
+
}
|
|
2495
|
+
raw(compiler) {
|
|
2496
|
+
let { failOnError, exclude, include, onDetected } = this._options;
|
|
2497
|
+
return createBuiltinPlugin(this.name, {
|
|
2498
|
+
failOnError,
|
|
2499
|
+
exclude,
|
|
2500
|
+
include,
|
|
2501
|
+
onDetected: onDetected ? (module, paths)=>{
|
|
2502
|
+
onDetected({
|
|
2503
|
+
module,
|
|
2504
|
+
paths,
|
|
2505
|
+
compilation: compiler.__internal__get_compilation()
|
|
2506
|
+
});
|
|
2507
|
+
} : void 0
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2493
2511
|
class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
|
|
2494
2512
|
name = binding_namespaceObject.BuiltinPluginName.CircularDependencyRspackPlugin;
|
|
2495
2513
|
_options;
|
|
@@ -2609,10 +2627,16 @@ class DeterministicChunkIdsPlugin extends RspackBuiltinPlugin {
|
|
|
2609
2627
|
}
|
|
2610
2628
|
}
|
|
2611
2629
|
class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
2630
|
+
options;
|
|
2612
2631
|
name = binding_namespaceObject.BuiltinPluginName.DeterministicModuleIdsPlugin;
|
|
2613
2632
|
affectedHooks = 'compilation';
|
|
2633
|
+
constructor(options = {}){
|
|
2634
|
+
super(), this.options = options;
|
|
2635
|
+
}
|
|
2614
2636
|
raw() {
|
|
2615
|
-
return createBuiltinPlugin(this.name,
|
|
2637
|
+
return createBuiltinPlugin(this.name, {
|
|
2638
|
+
...this.options
|
|
2639
|
+
});
|
|
2616
2640
|
}
|
|
2617
2641
|
}
|
|
2618
2642
|
let DllEntryPlugin = base_create(binding_namespaceObject.BuiltinPluginName.DllEntryPlugin, (context, entries, options)=>({
|
|
@@ -4346,6 +4370,7 @@ let getRawModuleRule = (rule, path, options, upperType)=>{
|
|
|
4346
4370
|
issuer: rule.issuer ? getRawRuleSetCondition(rule.issuer) : void 0,
|
|
4347
4371
|
issuerLayer: rule.issuerLayer ? getRawRuleSetCondition(rule.issuerLayer) : void 0,
|
|
4348
4372
|
dependency: rule.dependency ? getRawRuleSetCondition(rule.dependency) : void 0,
|
|
4373
|
+
phase: rule.phase ? getRawRuleSetCondition(rule.phase) : void 0,
|
|
4349
4374
|
descriptionData: rule.descriptionData ? Object.fromEntries(Object.entries(rule.descriptionData).map(([k, v])=>[
|
|
4350
4375
|
k,
|
|
4351
4376
|
getRawRuleSetCondition(v)
|
|
@@ -4449,24 +4474,21 @@ function getRawParserOptions(parser, type) {
|
|
|
4449
4474
|
namedExports: (parser2 = parser).namedExports,
|
|
4450
4475
|
url: parser2.url,
|
|
4451
4476
|
import: parser2.import,
|
|
4452
|
-
resolveImport: parser2.resolveImport
|
|
4453
|
-
animation: parser2.animation,
|
|
4454
|
-
customIdents: parser2.customIdents,
|
|
4455
|
-
dashedIdents: parser2.dashedIdents
|
|
4477
|
+
resolveImport: parser2.resolveImport
|
|
4456
4478
|
}
|
|
4457
4479
|
};
|
|
4458
4480
|
}
|
|
4459
4481
|
if ('css/auto' === type) return {
|
|
4460
4482
|
type: 'css/auto',
|
|
4461
|
-
cssAuto:
|
|
4483
|
+
cssAuto: getRawCssAutoOrModuleParserOptions(parser)
|
|
4462
4484
|
};
|
|
4463
4485
|
if ('css/global' === type) return {
|
|
4464
4486
|
type: 'css/global',
|
|
4465
|
-
cssGlobal:
|
|
4487
|
+
cssGlobal: getRawCssModuleParserOptions(parser)
|
|
4466
4488
|
};
|
|
4467
4489
|
if ('css/module' === type) return {
|
|
4468
4490
|
type: 'css/module',
|
|
4469
|
-
cssModule:
|
|
4491
|
+
cssModule: getRawCssAutoOrModuleParserOptions(parser)
|
|
4470
4492
|
};
|
|
4471
4493
|
if ('json' === type) {
|
|
4472
4494
|
return {
|
|
@@ -4509,19 +4531,29 @@ function getRawJavascriptParserOptions(parser) {
|
|
|
4509
4531
|
typeReexportsPresence: parser.typeReexportsPresence,
|
|
4510
4532
|
jsx: parser.jsx,
|
|
4511
4533
|
deferImport: parser.deferImport,
|
|
4534
|
+
sourceImport: parser.sourceImport,
|
|
4512
4535
|
importMetaResolve: parser.importMetaResolve,
|
|
4513
4536
|
pureFunctions: parser.pureFunctions
|
|
4514
4537
|
};
|
|
4515
4538
|
}
|
|
4516
|
-
function
|
|
4539
|
+
function getRawCssModuleParserOptions(parser) {
|
|
4517
4540
|
return {
|
|
4518
4541
|
namedExports: parser.namedExports,
|
|
4519
4542
|
url: parser.url,
|
|
4520
4543
|
import: parser.import,
|
|
4521
4544
|
resolveImport: parser.resolveImport,
|
|
4522
4545
|
animation: parser.animation,
|
|
4546
|
+
container: parser.container,
|
|
4523
4547
|
customIdents: parser.customIdents,
|
|
4524
|
-
dashedIdents: parser.dashedIdents
|
|
4548
|
+
dashedIdents: parser.dashedIdents,
|
|
4549
|
+
function: parser.function,
|
|
4550
|
+
grid: parser.grid
|
|
4551
|
+
};
|
|
4552
|
+
}
|
|
4553
|
+
function getRawCssAutoOrModuleParserOptions(parser) {
|
|
4554
|
+
return {
|
|
4555
|
+
...getRawCssModuleParserOptions(parser),
|
|
4556
|
+
pure: parser.pure
|
|
4525
4557
|
};
|
|
4526
4558
|
}
|
|
4527
4559
|
function getRawGeneratorOptions(generator, type) {
|
|
@@ -4981,12 +5013,13 @@ let JsLoaderRspackPlugin = base_create(binding_namespaceObject.BuiltinPluginName
|
|
|
4981
5013
|
pseudoClasses
|
|
4982
5014
|
}
|
|
4983
5015
|
};
|
|
4984
|
-
}), LimitChunkCountPlugin = base_create(binding_namespaceObject.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options), BuiltinLazyCompilationPlugin = base_create(binding_namespaceObject.BuiltinPluginName.LazyCompilationPlugin, (currentActiveModules, entries, imports, client, test)=>({
|
|
5016
|
+
}), LimitChunkCountPlugin = base_create(binding_namespaceObject.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options), BuiltinLazyCompilationPlugin = base_create(binding_namespaceObject.BuiltinPluginName.LazyCompilationPlugin, (currentActiveModules, entries, imports, client, reservedExternals, test)=>({
|
|
4985
5017
|
imports,
|
|
4986
5018
|
entries,
|
|
4987
5019
|
test,
|
|
4988
5020
|
client,
|
|
4989
|
-
currentActiveModules
|
|
5021
|
+
currentActiveModules,
|
|
5022
|
+
reservedExternals
|
|
4990
5023
|
}), 'thisCompilation'), middleware_require = createRequire(import.meta.url), LAZY_COMPILATION_PREFIX = '/_rspack/lazy/trigger', noop = (_req, _res, next)=>{
|
|
4991
5024
|
'function' == typeof next && next();
|
|
4992
5025
|
}, lazyCompilationMiddleware = (compiler)=>{
|
|
@@ -5024,7 +5057,17 @@ function applyPlugin(compiler, options, activeModules) {
|
|
|
5024
5057
|
}, options.entries ?? !0, options.imports ?? !0, `${options.client || middleware_require.resolve(`../hot/lazy-compilation-${compiler.options.externalsPresets.node ? 'node' : 'web'}.js`)}?${encodeURIComponent((({ serverUrl, prefix })=>{
|
|
5025
5058
|
let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
|
|
5026
5059
|
return serverUrl ? serverUrl + (serverUrl.endsWith('/') ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
|
|
5027
|
-
})(options))}`,
|
|
5060
|
+
})(options))}`, function(externals) {
|
|
5061
|
+
let requests = new Set(), visit = (item)=>{
|
|
5062
|
+
if ('string' == typeof item) return void requests.add(item);
|
|
5063
|
+
if (item && 'object' == typeof item && !(item instanceof RegExp)) for (let [request, value] of Object.entries(item))!1 !== value && requests.add(request);
|
|
5064
|
+
};
|
|
5065
|
+
if (Array.isArray(externals)) for (let item of externals)visit(item);
|
|
5066
|
+
else void 0 !== externals && visit(externals);
|
|
5067
|
+
return [
|
|
5068
|
+
...requests
|
|
5069
|
+
];
|
|
5070
|
+
}(compiler.options.externals), options.test).apply(compiler);
|
|
5028
5071
|
}
|
|
5029
5072
|
let lazyCompilationMiddlewareInternal = (compiler, activeModules, lazyCompilationPrefix)=>{
|
|
5030
5073
|
let logger = compiler.getInfrastructureLogger('LazyCompilation');
|
|
@@ -5434,7 +5477,22 @@ let SwcJsMinimizerRspackPlugin = base_create(binding_namespaceObject.BuiltinPlug
|
|
|
5434
5477
|
module: options?.minimizerOptions?.module
|
|
5435
5478
|
}
|
|
5436
5479
|
};
|
|
5437
|
-
}, 'compilation')
|
|
5480
|
+
}, 'compilation');
|
|
5481
|
+
class SyncModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
5482
|
+
options;
|
|
5483
|
+
name = binding_namespaceObject.BuiltinPluginName.SyncModuleIdsPlugin;
|
|
5484
|
+
affectedHooks = 'compilation';
|
|
5485
|
+
constructor(options){
|
|
5486
|
+
super(), this.options = options;
|
|
5487
|
+
}
|
|
5488
|
+
raw() {
|
|
5489
|
+
let options = {
|
|
5490
|
+
...this.options
|
|
5491
|
+
};
|
|
5492
|
+
return createBuiltinPlugin(this.name, options);
|
|
5493
|
+
}
|
|
5494
|
+
}
|
|
5495
|
+
let URLPlugin = base_create(binding_namespaceObject.BuiltinPluginName.URLPlugin, ()=>{}, 'compilation');
|
|
5438
5496
|
class WorkerPlugin extends RspackBuiltinPlugin {
|
|
5439
5497
|
chunkLoading;
|
|
5440
5498
|
wasmLoading;
|
|
@@ -5823,7 +5881,21 @@ let configCache = {}, ES_VERSIONS_MAP = {
|
|
|
5823
5881
|
ios_saf: 'safari',
|
|
5824
5882
|
and_chr: 'chrome',
|
|
5825
5883
|
and_ff: 'firefox'
|
|
5826
|
-
}, renameBrowser = (name)=>aliases[name] || name,
|
|
5884
|
+
}, renameBrowser = (name)=>aliases[name] || name, resolveESVersion = (version, thresholds)=>{
|
|
5885
|
+
let index = thresholds.findIndex((threshold)=>version < threshold);
|
|
5886
|
+
return -1 === index ? 2024 : [
|
|
5887
|
+
2015,
|
|
5888
|
+
2016,
|
|
5889
|
+
2017,
|
|
5890
|
+
2018,
|
|
5891
|
+
2019,
|
|
5892
|
+
2020,
|
|
5893
|
+
2021,
|
|
5894
|
+
2022,
|
|
5895
|
+
2023,
|
|
5896
|
+
2024
|
|
5897
|
+
][index - 1] ?? 5;
|
|
5898
|
+
}, browserslistTargetHandler_resolve = (browsers)=>{
|
|
5827
5899
|
let rawChecker = (versions)=>browsers.every((v)=>{
|
|
5828
5900
|
let [name, parsedVersion] = v.split(' ');
|
|
5829
5901
|
if (!name) return !1;
|
|
@@ -6349,7 +6421,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6349
6421
|
break;
|
|
6350
6422
|
}
|
|
6351
6423
|
let versions = ES_VERSIONS_MAP[browser];
|
|
6352
|
-
versions && (
|
|
6424
|
+
versions && (esVersion = Math.min(resolveESVersion(version, versions), esVersion));
|
|
6353
6425
|
}
|
|
6354
6426
|
return esVersion;
|
|
6355
6427
|
}(browsers)
|
|
@@ -6560,12 +6632,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6560
6632
|
}
|
|
6561
6633
|
}
|
|
6562
6634
|
throw Error(`Unknown target '${target}'. The following targets are supported:\n${TARGETS.map(([name, description])=>`* ${name}: ${description}`).join('\n')}`);
|
|
6563
|
-
},
|
|
6564
|
-
let context;
|
|
6565
|
-
F(options, 'context', ()=>process.cwd()), F(options, 'target', ()=>hasBrowserslistConfig(options.context) ? 'browserslist' : 'web');
|
|
6566
|
-
let { mode, target } = options;
|
|
6567
|
-
if (isNil(target)) throw Error('target should not be nil after defaults');
|
|
6568
|
-
let targetProperties = !1 !== target && ('string' == typeof target ? getTargetProperties(target, options.context) : (context = options.context, ((targetProperties)=>{
|
|
6635
|
+
}, getTargetsProperties = (targets, context)=>((targetProperties)=>{
|
|
6569
6636
|
let keys = new Set();
|
|
6570
6637
|
for (let tp of targetProperties)for (let key of Object.keys(tp))keys.add(key);
|
|
6571
6638
|
let result = {};
|
|
@@ -6599,7 +6666,11 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6599
6666
|
(hasTrue || hasFalse) && (result[key] = hasFalse && hasTrue ? null : hasTrue);
|
|
6600
6667
|
}
|
|
6601
6668
|
return result;
|
|
6602
|
-
})(
|
|
6669
|
+
})(targets.map((t)=>getTargetProperties(t, context))), applyRspackOptionsDefaults = (options)=>{
|
|
6670
|
+
F(options, 'context', ()=>process.cwd()), F(options, 'target', ()=>hasBrowserslistConfig(options.context) ? 'browserslist' : 'web');
|
|
6671
|
+
let { mode, target } = options;
|
|
6672
|
+
if (isNil(target)) throw Error('target should not be nil after defaults');
|
|
6673
|
+
let targetProperties = !1 !== target && ('string' == typeof target ? getTargetProperties(target, options.context) : getTargetsProperties(target, options.context)), development = 'development' === mode, production = 'production' === mode || !mode;
|
|
6603
6674
|
if ('function' != typeof options.entry) for (let key of Object.keys(options.entry))F(options.entry[key], 'import', ()=>[
|
|
6604
6675
|
'./src'
|
|
6605
6676
|
]);
|
|
@@ -6619,6 +6690,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6619
6690
|
mode: options.mode,
|
|
6620
6691
|
uniqueName: options.output.uniqueName,
|
|
6621
6692
|
deferImport: options.experiments.deferImport,
|
|
6693
|
+
sourceImport: options.experiments.sourceImport,
|
|
6622
6694
|
outputModule: options.output.module,
|
|
6623
6695
|
hashFunction: options.output.hashFunction,
|
|
6624
6696
|
hashSalt: options.output.hashSalt
|
|
@@ -6650,22 +6722,27 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6650
6722
|
targets: targetProperties.targets
|
|
6651
6723
|
};
|
|
6652
6724
|
}, applyExperimentsDefaults = (experiments)=>{
|
|
6653
|
-
D(experiments, 'futureDefaults', !1), D(experiments, 'asyncWebAssembly', !0), D(experiments, 'deferImport', !1), D(experiments, 'buildHttp', void 0), experiments.buildHttp && 'object' == typeof experiments.buildHttp && D(experiments.buildHttp, 'upgrade', !1), D(experiments, 'useInputFileSystem', !1), D(experiments, 'pureFunctions', !1);
|
|
6725
|
+
D(experiments, 'futureDefaults', !1), D(experiments, 'asyncWebAssembly', !0), D(experiments, 'deferImport', !1), D(experiments, 'sourceImport', !1), D(experiments, 'buildHttp', void 0), experiments.buildHttp && 'object' == typeof experiments.buildHttp && D(experiments.buildHttp, 'upgrade', !1), D(experiments, 'useInputFileSystem', !1), D(experiments, 'pureFunctions', !1);
|
|
6654
6726
|
}, applyIncrementalDefaults = (options)=>{
|
|
6655
6727
|
D(options, 'incremental', {}), 'object' == typeof options.incremental && (D(options.incremental, 'silent', !0), D(options.incremental, 'buildModuleGraph', !0), D(options.incremental, 'finishModules', !0), D(options.incremental, 'optimizeDependencies', !0), D(options.incremental, 'buildChunkGraph', !0), D(options.incremental, 'optimizeChunkModules', !0), D(options.incremental, 'moduleIds', !0), D(options.incremental, 'chunkIds', !0), D(options.incremental, 'modulesHashes', !0), D(options.incremental, 'modulesCodegen', !0), D(options.incremental, 'modulesRuntimeRequirements', !0), D(options.incremental, 'chunksRuntimeRequirements', !0), D(options.incremental, 'chunksHashes', !0), D(options.incremental, 'chunkAsset', !0), D(options.incremental, 'emitAssets', !0));
|
|
6656
|
-
}, applySnapshotDefaults = (_snapshot, _env)=>{},
|
|
6728
|
+
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyCssParserOptionsDefaults = (parserOptions)=>{
|
|
6729
|
+
D(parserOptions, 'namedExports', !0), D(parserOptions, 'url', !0), D(parserOptions, 'import', !0);
|
|
6730
|
+
}, applyCssModuleGeneratorOptionsDefaults = (generatorOptions, { hashFunction, hashSalt, localIdentName, targetProperties })=>{
|
|
6657
6731
|
D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0), D(generatorOptions, 'exportsConvention', 'as-is'), D(generatorOptions, 'localIdentName', localIdentName), D(generatorOptions, 'localIdentHashSalt', hashSalt), D(generatorOptions, 'localIdentHashFunction', hashFunction), D(generatorOptions, 'localIdentHashDigest', 'base64url'), D(generatorOptions, 'localIdentHashDigestLength', 6);
|
|
6658
6732
|
}, applyCssModuleParserOptionsDefaults = (parserOptions)=>{
|
|
6659
|
-
D(parserOptions, '
|
|
6660
|
-
},
|
|
6661
|
-
|
|
6733
|
+
applyCssParserOptionsDefaults(parserOptions), D(parserOptions, 'animation', !0), D(parserOptions, 'container', !0), D(parserOptions, 'customIdents', !0), D(parserOptions, 'dashedIdents', !0), D(parserOptions, 'function', !0), D(parserOptions, 'grid', !0);
|
|
6734
|
+
}, applyCssAutoOrModuleParserOptionsDefaults = (parserOptions)=>{
|
|
6735
|
+
applyCssModuleParserOptionsDefaults(parserOptions), D(parserOptions, 'pure', !1);
|
|
6736
|
+
}, applyModuleDefaults = (module, { asyncWebAssembly, targetProperties, mode, uniqueName, deferImport, sourceImport, outputModule, hashFunction, hashSalt })=>{
|
|
6737
|
+
assertNotNill(module.parser), assertNotNill(module.generator), F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), F(module.parser.asset, 'dataUrlCondition', ()=>({})), 'object' == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, 'maxSize', 8096), F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), ((parserOptions, { deferImport, sourceImport, outputModule })=>{
|
|
6662
6738
|
D(parserOptions, 'dynamicImportMode', 'lazy'), D(parserOptions, 'dynamicImportPrefetch', !1), D(parserOptions, 'dynamicImportPreload', !1), D(parserOptions, 'url', !0), D(parserOptions, 'exprContextCritical', !0), D(parserOptions, 'unknownContextCritical', !0), D(parserOptions, 'wrappedContextCritical', !1), D(parserOptions, 'strictThisContextOnImports', !1), D(parserOptions, 'wrappedContextRegExp', /.*/), D(parserOptions, 'exportsPresence', 'error'), D(parserOptions, 'requireAsExpression', !0), D(parserOptions, 'requireAlias', !1), D(parserOptions, 'requireDynamic', !0), D(parserOptions, 'requireResolve', !0), D(parserOptions, 'commonjs', !0), D(parserOptions, 'importDynamic', !0), D(parserOptions, 'worker', [
|
|
6663
6739
|
'...'
|
|
6664
|
-
]), D(parserOptions, 'importMeta', !outputModule || 'preserve-unknown'), D(parserOptions, 'typeReexportsPresence', 'no-tolerant'), D(parserOptions, 'jsx', !1), D(parserOptions, 'deferImport', deferImport), D(parserOptions, 'importMetaResolve', !1);
|
|
6740
|
+
]), D(parserOptions, 'importMeta', !outputModule || 'preserve-unknown'), D(parserOptions, 'typeReexportsPresence', 'no-tolerant'), D(parserOptions, 'jsx', !1), D(parserOptions, 'deferImport', deferImport), D(parserOptions, 'sourceImport', sourceImport), D(parserOptions, 'importMetaResolve', !1);
|
|
6665
6741
|
})(module.parser.javascript, {
|
|
6666
6742
|
deferImport,
|
|
6743
|
+
sourceImport,
|
|
6667
6744
|
outputModule
|
|
6668
|
-
}), F(module.parser, "json", ()=>({})), assertNotNill(module.parser.json), D(module.parser.json, 'exportsDepth', 'development' === mode ? 1 : Number.MAX_SAFE_INTEGER), F(module.generator, 'json', ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, 'JSONParse', !0), F(module.parser, 'css', ()=>({})), assertNotNill(module.parser.css),
|
|
6745
|
+
}), F(module.parser, "json", ()=>({})), assertNotNill(module.parser.json), D(module.parser.json, 'exportsDepth', 'development' === mode ? 1 : Number.MAX_SAFE_INTEGER), F(module.generator, 'json', ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, 'JSONParse', !0), F(module.parser, 'css', ()=>({})), assertNotNill(module.parser.css), applyCssParserOptionsDefaults(module.parser.css), F(module.parser, 'css/auto', ()=>({})), assertNotNill(module.parser['css/auto']), applyCssAutoOrModuleParserOptionsDefaults(module.parser['css/auto']), F(module.parser, 'css/global', ()=>({})), assertNotNill(module.parser['css/global']), applyCssModuleParserOptionsDefaults(module.parser['css/global']), F(module.parser, 'css/module', ()=>({})), assertNotNill(module.parser['css/module']), applyCssAutoOrModuleParserOptionsDefaults(module.parser['css/module']), F(module.generator, 'css', ()=>({})), assertNotNill(module.generator.css), ((generatorOptions, { targetProperties })=>{
|
|
6669
6746
|
D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
|
|
6670
6747
|
})(module.generator.css, {
|
|
6671
6748
|
targetProperties
|
|
@@ -6956,7 +7033,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6956
7033
|
return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
|
|
6957
7034
|
desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
|
|
6958
7035
|
}), Array.from(enabledWasmLoadingTypes);
|
|
6959
|
-
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.
|
|
7036
|
+
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.7"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !1));
|
|
6960
7037
|
}, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
|
|
6961
7038
|
let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
|
|
6962
7039
|
D(externalsPresets, 'web', !buildHttp && targetProperties && (targetProperties.web || isUniversal('node'))), D(externalsPresets, 'node', targetProperties && (targetProperties.node || isUniversal('node'))), D(externalsPresets, 'electron', targetProperties && targetProperties.electron || isUniversal('electron')), D(externalsPresets, 'electronMain', targetProperties && !!targetProperties.electron && (targetProperties.electronMain || isUniversal('electronMain'))), D(externalsPresets, 'electronPreload', targetProperties && !!targetProperties.electron && (targetProperties.electronPreload || isUniversal('electronPreload'))), D(externalsPresets, 'electronRenderer', targetProperties && !!targetProperties.electron && (targetProperties.electronRenderer || isUniversal('electronRenderer'))), D(externalsPresets, 'nwjs', targetProperties && (targetProperties.nwjs || isUniversal('nwjs')));
|
|
@@ -7093,22 +7170,21 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7093
7170
|
loader: cjsDeps(),
|
|
7094
7171
|
unknown: cjsDeps()
|
|
7095
7172
|
}
|
|
7096
|
-
};
|
|
7097
|
-
|
|
7173
|
+
}, styleConditions = [];
|
|
7174
|
+
styleConditions.push('development' === mode ? 'development' : 'production'), styleConditions.push('style');
|
|
7175
|
+
let cssResolveOptions = {
|
|
7098
7176
|
mainFiles: [],
|
|
7099
7177
|
mainFields: [
|
|
7100
7178
|
'style',
|
|
7101
7179
|
'...'
|
|
7102
7180
|
],
|
|
7103
|
-
conditionNames:
|
|
7104
|
-
'development' === mode ? 'development' : 'production',
|
|
7105
|
-
'style'
|
|
7106
|
-
],
|
|
7181
|
+
conditionNames: styleConditions,
|
|
7107
7182
|
extensions: [
|
|
7108
7183
|
'.css'
|
|
7109
7184
|
],
|
|
7110
7185
|
preferRelative: !0
|
|
7111
|
-
}
|
|
7186
|
+
};
|
|
7187
|
+
return resolveOptions.byDependency['css-import'] = cssResolveOptions, resolveOptions.byDependency['css-import-local-module'] = cssResolveOptions, resolveOptions.byDependency['css-import-global-module'] = cssResolveOptions, resolveOptions;
|
|
7112
7188
|
}, D = (obj, prop, value)=>{
|
|
7113
7189
|
void 0 === obj[prop] && (obj[prop] = value);
|
|
7114
7190
|
}, F = (obj, prop, factory)=>{
|
|
@@ -7413,7 +7489,7 @@ function __to_binding_runtime_globals(runtimeRequirements, compilerRuntimeGlobal
|
|
|
7413
7489
|
}
|
|
7414
7490
|
return res;
|
|
7415
7491
|
}
|
|
7416
|
-
var RuntimeGlobals_RuntimeGlobals = ((RuntimeGlobals = RuntimeGlobals_RuntimeGlobals || {})[RuntimeGlobals.require = 0] = "require", RuntimeGlobals[RuntimeGlobals.requireScope = 1] = "requireScope", RuntimeGlobals[RuntimeGlobals.exports = 2] = "exports", RuntimeGlobals[RuntimeGlobals.thisAsExports = 3] = "thisAsExports", RuntimeGlobals[RuntimeGlobals.returnExportsFromRuntime = 4] = "returnExportsFromRuntime", RuntimeGlobals[RuntimeGlobals.module = 5] = "module", RuntimeGlobals[RuntimeGlobals.moduleId = 6] = "moduleId", RuntimeGlobals[RuntimeGlobals.moduleLoaded = 7] = "moduleLoaded", RuntimeGlobals[RuntimeGlobals.publicPath = 8] = "publicPath", RuntimeGlobals[RuntimeGlobals.entryModuleId = 9] = "entryModuleId", RuntimeGlobals[RuntimeGlobals.moduleCache = 10] = "moduleCache", RuntimeGlobals[RuntimeGlobals.moduleFactories = 11] = "moduleFactories", RuntimeGlobals[RuntimeGlobals.moduleFactoriesAddOnly = 12] = "moduleFactoriesAddOnly", RuntimeGlobals[RuntimeGlobals.ensureChunk = 13] = "ensureChunk", RuntimeGlobals[RuntimeGlobals.ensureChunkHandlers = 14] = "ensureChunkHandlers", RuntimeGlobals[RuntimeGlobals.ensureChunkIncludeEntries = 15] = "ensureChunkIncludeEntries", RuntimeGlobals[RuntimeGlobals.prefetchChunk = 16] = "prefetchChunk", RuntimeGlobals[RuntimeGlobals.prefetchChunkHandlers = 17] = "prefetchChunkHandlers", RuntimeGlobals[RuntimeGlobals.preloadChunk = 18] = "preloadChunk", RuntimeGlobals[RuntimeGlobals.preloadChunkHandlers = 19] = "preloadChunkHandlers", RuntimeGlobals[RuntimeGlobals.definePropertyGetters = 20] = "definePropertyGetters", RuntimeGlobals[RuntimeGlobals.makeNamespaceObject = 21] = "makeNamespaceObject", RuntimeGlobals[RuntimeGlobals.createFakeNamespaceObject = 22] = "createFakeNamespaceObject", RuntimeGlobals[RuntimeGlobals.compatGetDefaultExport = 23] = "compatGetDefaultExport", RuntimeGlobals[RuntimeGlobals.harmonyModuleDecorator = 24] = "harmonyModuleDecorator", RuntimeGlobals[RuntimeGlobals.nodeModuleDecorator = 25] = "nodeModuleDecorator", RuntimeGlobals[RuntimeGlobals.getFullHash = 26] = "getFullHash", RuntimeGlobals[RuntimeGlobals.wasmInstances = 27] = "wasmInstances", RuntimeGlobals[RuntimeGlobals.instantiateWasm = 28] = "instantiateWasm", RuntimeGlobals[RuntimeGlobals.
|
|
7492
|
+
var RuntimeGlobals_RuntimeGlobals = ((RuntimeGlobals = RuntimeGlobals_RuntimeGlobals || {})[RuntimeGlobals.require = 0] = "require", RuntimeGlobals[RuntimeGlobals.requireScope = 1] = "requireScope", RuntimeGlobals[RuntimeGlobals.exports = 2] = "exports", RuntimeGlobals[RuntimeGlobals.thisAsExports = 3] = "thisAsExports", RuntimeGlobals[RuntimeGlobals.returnExportsFromRuntime = 4] = "returnExportsFromRuntime", RuntimeGlobals[RuntimeGlobals.module = 5] = "module", RuntimeGlobals[RuntimeGlobals.moduleId = 6] = "moduleId", RuntimeGlobals[RuntimeGlobals.moduleLoaded = 7] = "moduleLoaded", RuntimeGlobals[RuntimeGlobals.publicPath = 8] = "publicPath", RuntimeGlobals[RuntimeGlobals.entryModuleId = 9] = "entryModuleId", RuntimeGlobals[RuntimeGlobals.moduleCache = 10] = "moduleCache", RuntimeGlobals[RuntimeGlobals.moduleFactories = 11] = "moduleFactories", RuntimeGlobals[RuntimeGlobals.moduleFactoriesAddOnly = 12] = "moduleFactoriesAddOnly", RuntimeGlobals[RuntimeGlobals.ensureChunk = 13] = "ensureChunk", RuntimeGlobals[RuntimeGlobals.ensureChunkHandlers = 14] = "ensureChunkHandlers", RuntimeGlobals[RuntimeGlobals.ensureChunkIncludeEntries = 15] = "ensureChunkIncludeEntries", RuntimeGlobals[RuntimeGlobals.prefetchChunk = 16] = "prefetchChunk", RuntimeGlobals[RuntimeGlobals.prefetchChunkHandlers = 17] = "prefetchChunkHandlers", RuntimeGlobals[RuntimeGlobals.preloadChunk = 18] = "preloadChunk", RuntimeGlobals[RuntimeGlobals.preloadChunkHandlers = 19] = "preloadChunkHandlers", RuntimeGlobals[RuntimeGlobals.definePropertyGetters = 20] = "definePropertyGetters", RuntimeGlobals[RuntimeGlobals.makeNamespaceObject = 21] = "makeNamespaceObject", RuntimeGlobals[RuntimeGlobals.createFakeNamespaceObject = 22] = "createFakeNamespaceObject", RuntimeGlobals[RuntimeGlobals.compatGetDefaultExport = 23] = "compatGetDefaultExport", RuntimeGlobals[RuntimeGlobals.harmonyModuleDecorator = 24] = "harmonyModuleDecorator", RuntimeGlobals[RuntimeGlobals.nodeModuleDecorator = 25] = "nodeModuleDecorator", RuntimeGlobals[RuntimeGlobals.getFullHash = 26] = "getFullHash", RuntimeGlobals[RuntimeGlobals.wasmInstances = 27] = "wasmInstances", RuntimeGlobals[RuntimeGlobals.instantiateWasm = 28] = "instantiateWasm", RuntimeGlobals[RuntimeGlobals.compileWasm = 29] = "compileWasm", RuntimeGlobals[RuntimeGlobals.uncaughtErrorHandler = 30] = "uncaughtErrorHandler", RuntimeGlobals[RuntimeGlobals.scriptNonce = 31] = "scriptNonce", RuntimeGlobals[RuntimeGlobals.loadScript = 32] = "loadScript", RuntimeGlobals[RuntimeGlobals.createScript = 33] = "createScript", RuntimeGlobals[RuntimeGlobals.createScriptUrl = 34] = "createScriptUrl", RuntimeGlobals[RuntimeGlobals.getTrustedTypesPolicy = 35] = "getTrustedTypesPolicy", RuntimeGlobals[RuntimeGlobals.hasFetchPriority = 36] = "hasFetchPriority", RuntimeGlobals[RuntimeGlobals.chunkName = 37] = "chunkName", RuntimeGlobals[RuntimeGlobals.runtimeId = 38] = "runtimeId", RuntimeGlobals[RuntimeGlobals.getChunkScriptFilename = 39] = "getChunkScriptFilename", RuntimeGlobals[RuntimeGlobals.getChunkCssFilename = 40] = "getChunkCssFilename", RuntimeGlobals[RuntimeGlobals.rspackVersion = 41] = "rspackVersion", RuntimeGlobals[RuntimeGlobals.hasCssModules = 42] = "hasCssModules", RuntimeGlobals[RuntimeGlobals.rspackUniqueId = 43] = "rspackUniqueId", RuntimeGlobals[RuntimeGlobals.getChunkUpdateScriptFilename = 44] = "getChunkUpdateScriptFilename", RuntimeGlobals[RuntimeGlobals.getChunkUpdateCssFilename = 45] = "getChunkUpdateCssFilename", RuntimeGlobals[RuntimeGlobals.startup = 46] = "startup", RuntimeGlobals[RuntimeGlobals.startupNoDefault = 47] = "startupNoDefault", RuntimeGlobals[RuntimeGlobals.startupOnlyAfter = 48] = "startupOnlyAfter", RuntimeGlobals[RuntimeGlobals.startupOnlyBefore = 49] = "startupOnlyBefore", RuntimeGlobals[RuntimeGlobals.chunkCallback = 50] = "chunkCallback", RuntimeGlobals[RuntimeGlobals.startupEntrypoint = 51] = "startupEntrypoint", RuntimeGlobals[RuntimeGlobals.startupChunkDependencies = 52] = "startupChunkDependencies", RuntimeGlobals[RuntimeGlobals.onChunksLoaded = 53] = "onChunksLoaded", RuntimeGlobals[RuntimeGlobals.externalInstallChunk = 54] = "externalInstallChunk", RuntimeGlobals[RuntimeGlobals.interceptModuleExecution = 55] = "interceptModuleExecution", RuntimeGlobals[RuntimeGlobals.global = 56] = "global", RuntimeGlobals[RuntimeGlobals.shareScopeMap = 57] = "shareScopeMap", RuntimeGlobals[RuntimeGlobals.initializeSharing = 58] = "initializeSharing", RuntimeGlobals[RuntimeGlobals.currentRemoteGetScope = 59] = "currentRemoteGetScope", RuntimeGlobals[RuntimeGlobals.getUpdateManifestFilename = 60] = "getUpdateManifestFilename", RuntimeGlobals[RuntimeGlobals.hmrDownloadManifest = 61] = "hmrDownloadManifest", RuntimeGlobals[RuntimeGlobals.hmrDownloadUpdateHandlers = 62] = "hmrDownloadUpdateHandlers", RuntimeGlobals[RuntimeGlobals.hmrModuleData = 63] = "hmrModuleData", RuntimeGlobals[RuntimeGlobals.hmrInvalidateModuleHandlers = 64] = "hmrInvalidateModuleHandlers", RuntimeGlobals[RuntimeGlobals.hmrRuntimeStatePrefix = 65] = "hmrRuntimeStatePrefix", RuntimeGlobals[RuntimeGlobals.amdDefine = 66] = "amdDefine", RuntimeGlobals[RuntimeGlobals.amdOptions = 67] = "amdOptions", RuntimeGlobals[RuntimeGlobals.system = 68] = "system", RuntimeGlobals[RuntimeGlobals.hasOwnProperty = 69] = "hasOwnProperty", RuntimeGlobals[RuntimeGlobals.systemContext = 70] = "systemContext", RuntimeGlobals[RuntimeGlobals.baseURI = 71] = "baseURI", RuntimeGlobals[RuntimeGlobals.relativeUrl = 72] = "relativeUrl", RuntimeGlobals[RuntimeGlobals.asyncModule = 73] = "asyncModule", RuntimeGlobals[RuntimeGlobals.asyncModuleExportSymbol = 74] = "asyncModuleExportSymbol", RuntimeGlobals[RuntimeGlobals.makeDeferredNamespaceObject = 75] = "makeDeferredNamespaceObject", RuntimeGlobals[RuntimeGlobals.makeDeferredNamespaceObjectSymbol = 76] = "makeDeferredNamespaceObjectSymbol", RuntimeGlobals);
|
|
7417
7493
|
function renderRuntimeVariables(variable, _compilerOptions) {
|
|
7418
7494
|
switch(variable){
|
|
7419
7495
|
case 0:
|
|
@@ -7494,98 +7570,100 @@ function createCompilerRuntimeGlobals(compilerOptions) {
|
|
|
7494
7570
|
case 28:
|
|
7495
7571
|
return `${scope_name}.v`;
|
|
7496
7572
|
case 29:
|
|
7497
|
-
return `${scope_name}.
|
|
7573
|
+
return `${scope_name}.vs`;
|
|
7498
7574
|
case 30:
|
|
7499
|
-
return `${scope_name}.
|
|
7575
|
+
return `${scope_name}.oe`;
|
|
7500
7576
|
case 31:
|
|
7501
|
-
return `${scope_name}.
|
|
7577
|
+
return `${scope_name}.nc`;
|
|
7502
7578
|
case 32:
|
|
7503
|
-
return `${scope_name}.
|
|
7579
|
+
return `${scope_name}.l`;
|
|
7504
7580
|
case 33:
|
|
7505
|
-
return `${scope_name}.
|
|
7581
|
+
return `${scope_name}.ts`;
|
|
7506
7582
|
case 34:
|
|
7507
|
-
return `${scope_name}.
|
|
7583
|
+
return `${scope_name}.tu`;
|
|
7508
7584
|
case 35:
|
|
7509
|
-
return
|
|
7585
|
+
return `${scope_name}.tt`;
|
|
7510
7586
|
case 36:
|
|
7511
|
-
return
|
|
7587
|
+
return "has fetch priority";
|
|
7512
7588
|
case 37:
|
|
7513
|
-
return `${scope_name}.
|
|
7589
|
+
return `${scope_name}.cn`;
|
|
7514
7590
|
case 38:
|
|
7515
|
-
return `${scope_name}.
|
|
7591
|
+
return `${scope_name}.j`;
|
|
7516
7592
|
case 39:
|
|
7517
|
-
return `${scope_name}.
|
|
7593
|
+
return `${scope_name}.u`;
|
|
7518
7594
|
case 40:
|
|
7519
|
-
return `${scope_name}.
|
|
7595
|
+
return `${scope_name}.k`;
|
|
7520
7596
|
case 41:
|
|
7521
|
-
return
|
|
7597
|
+
return `${scope_name}.rv`;
|
|
7522
7598
|
case 42:
|
|
7523
|
-
return
|
|
7599
|
+
return "has css modules";
|
|
7524
7600
|
case 43:
|
|
7525
|
-
return `${scope_name}.
|
|
7601
|
+
return `${scope_name}.ruid`;
|
|
7526
7602
|
case 44:
|
|
7527
|
-
return `${scope_name}.
|
|
7603
|
+
return `${scope_name}.hu`;
|
|
7528
7604
|
case 45:
|
|
7529
|
-
return `${scope_name}.
|
|
7605
|
+
return `${scope_name}.hk`;
|
|
7530
7606
|
case 46:
|
|
7531
|
-
return `${scope_name}.x
|
|
7607
|
+
return `${scope_name}.x`;
|
|
7532
7608
|
case 47:
|
|
7533
|
-
return `${scope_name}.x (
|
|
7609
|
+
return `${scope_name}.x (no default handler)`;
|
|
7534
7610
|
case 48:
|
|
7535
|
-
return `${scope_name}.x (only
|
|
7611
|
+
return `${scope_name}.x (only after)`;
|
|
7536
7612
|
case 49:
|
|
7537
|
-
return
|
|
7613
|
+
return `${scope_name}.x (only before)`;
|
|
7538
7614
|
case 50:
|
|
7539
|
-
return
|
|
7615
|
+
return "global chunk callback";
|
|
7540
7616
|
case 51:
|
|
7541
|
-
return `${scope_name}.
|
|
7617
|
+
return `${scope_name}.X`;
|
|
7542
7618
|
case 52:
|
|
7543
|
-
return `${scope_name}.
|
|
7619
|
+
return `${scope_name}.x (chunk dependencies)`;
|
|
7544
7620
|
case 53:
|
|
7545
|
-
return `${scope_name}.
|
|
7621
|
+
return `${scope_name}.O`;
|
|
7546
7622
|
case 54:
|
|
7547
|
-
return `${scope_name}.
|
|
7623
|
+
return `${scope_name}.C`;
|
|
7548
7624
|
case 55:
|
|
7549
|
-
return `${scope_name}.
|
|
7625
|
+
return `${scope_name}.i`;
|
|
7550
7626
|
case 56:
|
|
7551
|
-
return `${scope_name}.
|
|
7627
|
+
return `${scope_name}.g`;
|
|
7552
7628
|
case 57:
|
|
7553
|
-
return `${scope_name}.
|
|
7629
|
+
return `${scope_name}.S`;
|
|
7554
7630
|
case 58:
|
|
7555
|
-
return `${scope_name}.
|
|
7631
|
+
return `${scope_name}.I`;
|
|
7556
7632
|
case 59:
|
|
7557
|
-
return `${scope_name}.
|
|
7633
|
+
return `${scope_name}.R`;
|
|
7558
7634
|
case 60:
|
|
7559
|
-
return `${scope_name}.
|
|
7635
|
+
return `${scope_name}.hmrF`;
|
|
7560
7636
|
case 61:
|
|
7561
|
-
return `${scope_name}.
|
|
7637
|
+
return `${scope_name}.hmrM`;
|
|
7562
7638
|
case 62:
|
|
7563
|
-
return `${scope_name}.
|
|
7639
|
+
return `${scope_name}.hmrC`;
|
|
7564
7640
|
case 63:
|
|
7565
|
-
return `${scope_name}.
|
|
7641
|
+
return `${scope_name}.hmrD`;
|
|
7566
7642
|
case 64:
|
|
7567
|
-
return `${scope_name}.
|
|
7643
|
+
return `${scope_name}.hmrI`;
|
|
7568
7644
|
case 65:
|
|
7569
|
-
return `${scope_name}.
|
|
7645
|
+
return `${scope_name}.hmrS`;
|
|
7570
7646
|
case 66:
|
|
7571
|
-
return `${scope_name}.
|
|
7647
|
+
return `${scope_name}.amdD`;
|
|
7572
7648
|
case 67:
|
|
7573
|
-
return `${scope_name}.
|
|
7649
|
+
return `${scope_name}.amdO`;
|
|
7574
7650
|
case 68:
|
|
7575
|
-
return `${scope_name}.
|
|
7651
|
+
return `${scope_name}.System`;
|
|
7576
7652
|
case 69:
|
|
7577
|
-
return `${scope_name}.
|
|
7653
|
+
return `${scope_name}.o`;
|
|
7578
7654
|
case 70:
|
|
7579
|
-
return `${scope_name}.
|
|
7655
|
+
return `${scope_name}.y`;
|
|
7580
7656
|
case 71:
|
|
7581
|
-
return `${scope_name}.
|
|
7657
|
+
return `${scope_name}.b`;
|
|
7582
7658
|
case 72:
|
|
7583
|
-
return `${scope_name}.
|
|
7659
|
+
return `${scope_name}.U`;
|
|
7584
7660
|
case 73:
|
|
7585
|
-
return `${scope_name}.
|
|
7661
|
+
return `${scope_name}.a`;
|
|
7586
7662
|
case 74:
|
|
7587
|
-
return `${scope_name}.
|
|
7663
|
+
return `${scope_name}.aE`;
|
|
7588
7664
|
case 75:
|
|
7665
|
+
return `${scope_name}.z`;
|
|
7666
|
+
case 76:
|
|
7589
7667
|
return `${scope_name}.zS`;
|
|
7590
7668
|
default:
|
|
7591
7669
|
return '';
|
|
@@ -8210,7 +8288,7 @@ class MultiStats {
|
|
|
8210
8288
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8211
8289
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8212
8290
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8213
|
-
}), childOptions.version && (obj.rspackVersion = "2.0.
|
|
8291
|
+
}), childOptions.version && (obj.rspackVersion = "2.0.7", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
|
|
8214
8292
|
let mapError = (j, obj)=>({
|
|
8215
8293
|
...obj,
|
|
8216
8294
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -8719,7 +8797,7 @@ let arraySum = (array)=>{
|
|
|
8719
8797
|
let str = `${a}`, length = lengths[i];
|
|
8720
8798
|
return str.length === length ? str : length > 5 ? `...${str.slice(-length + 3)}` : length > 0 ? str.slice(-length) : '';
|
|
8721
8799
|
});
|
|
8722
|
-
}, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.
|
|
8800
|
+
}, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.22.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js");
|
|
8723
8801
|
var CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
|
|
8724
8802
|
class NodeEnvironmentPlugin {
|
|
8725
8803
|
options;
|
|
@@ -9484,7 +9562,7 @@ let iterateConfig = (config, options, fn)=>{
|
|
|
9484
9562
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9485
9563
|
},
|
|
9486
9564
|
version: (object)=>{
|
|
9487
|
-
object.version = "5.75.0", object.rspackVersion = "2.0.
|
|
9565
|
+
object.version = "5.75.0", object.rspackVersion = "2.0.7";
|
|
9488
9566
|
},
|
|
9489
9567
|
env: (object, _compilation, _context, { _env })=>{
|
|
9490
9568
|
object.env = _env;
|
|
@@ -10710,9 +10788,11 @@ class RspackOptionsApply {
|
|
|
10710
10788
|
process(options, compiler) {
|
|
10711
10789
|
if (!options.output.path) throw Error('options.output.path should have a value after `applyRspackOptionsDefaults`');
|
|
10712
10790
|
if (compiler.outputPath = options.output.path, compiler.name = options.name, compiler.outputFileSystem = node_fs, options.externals) {
|
|
10713
|
-
let presets;
|
|
10714
10791
|
if (!options.externalsType) throw Error('options.externalsType should have a value after `applyRspackOptionsDefaults`');
|
|
10715
|
-
new ExternalsPlugin(options.externalsType, options.externals, !1, (
|
|
10792
|
+
new ExternalsPlugin(options.externalsType, options.externals, !1, function(options) {
|
|
10793
|
+
let { context, target } = options;
|
|
10794
|
+
return (assertNotNill(context), null == target || !1 === target) ? 'commonjs' : ('string' == typeof target ? getTargetProperties(target, context) : getTargetsProperties(target, context)).nodeBuiltins ? 'node-commonjs' : 'commonjs';
|
|
10795
|
+
}(options)).apply(compiler);
|
|
10716
10796
|
}
|
|
10717
10797
|
if (options.externalsPresets.node && (new NodeTargetPlugin().apply(compiler), new CssHttpExternalsRspackPlugin().apply(compiler)), options.externalsPresets.electronMain && new ElectronTargetPlugin('main').apply(compiler), options.externalsPresets.electronPreload && new ElectronTargetPlugin('preload').apply(compiler), options.externalsPresets.electronRenderer && new ElectronTargetPlugin('renderer').apply(compiler), !options.externalsPresets.electron || options.externalsPresets.electronMain || options.externalsPresets.electronPreload || options.externalsPresets.electronRenderer || new ElectronTargetPlugin().apply(compiler), options.externalsPresets.nwjs && new ExternalsPlugin('node-commonjs', 'nw.gui', !1).apply(compiler), (options.externalsPresets.web || options.externalsPresets.webAsync) && new HttpExternalsRspackPlugin(!!options.externalsPresets.webAsync).apply(compiler), new ChunkPrefetchPreloadPlugin().apply(compiler), options.output.pathinfo && new ModuleInfoHeaderPlugin('verbose' === options.output.pathinfo).apply(compiler), 'string' == typeof options.output.chunkFormat) switch(options.output.chunkFormat){
|
|
10718
10798
|
case 'array-push':
|
|
@@ -11143,7 +11223,7 @@ class TraceHookPlugin {
|
|
|
11143
11223
|
});
|
|
11144
11224
|
}
|
|
11145
11225
|
}
|
|
11146
|
-
let CORE_VERSION = "2.0.
|
|
11226
|
+
let CORE_VERSION = "2.0.7", VFILES_BY_COMPILER = new WeakMap();
|
|
11147
11227
|
class VirtualModulesPlugin {
|
|
11148
11228
|
#staticModules;
|
|
11149
11229
|
#compiler;
|
|
@@ -11185,6 +11265,10 @@ class VirtualModulesPlugin {
|
|
|
11185
11265
|
}));
|
|
11186
11266
|
}
|
|
11187
11267
|
}
|
|
11268
|
+
function foldWatchDelta(pending, added, removed) {
|
|
11269
|
+
for (let path of added)pending.removed.delete(path) || pending.added.add(path);
|
|
11270
|
+
for (let path of removed)pending.added.delete(path) || pending.removed.add(path);
|
|
11271
|
+
}
|
|
11188
11272
|
class Watching {
|
|
11189
11273
|
watcher;
|
|
11190
11274
|
pausedWatcher;
|
|
@@ -11206,6 +11290,7 @@ class Watching {
|
|
|
11206
11290
|
#closed;
|
|
11207
11291
|
#collectedChangedFiles;
|
|
11208
11292
|
#collectedRemovedFiles;
|
|
11293
|
+
#pendingWatchDeps;
|
|
11209
11294
|
suspended;
|
|
11210
11295
|
constructor(compiler, watchOptions, handler){
|
|
11211
11296
|
this.callbacks = [], this.invalid = !1, this.#invalidReported = !0, this.blocked = !1, this.isBlocked = ()=>!1, this.onChange = ()=>{}, this.onInvalid = ()=>{}, this.compiler = compiler, this.running = !1, this.#initial = !0, this.#closed = !1, this.watchOptions = watchOptions, this.handler = handler, this.suspended = !1, 'number' != typeof this.watchOptions.aggregateTimeout && (this.watchOptions.aggregateTimeout = 5), void 0 === this.watchOptions.ignored && (this.watchOptions.ignored = /[\\/](?:\.git|node_modules)[\\/]/), process.nextTick(()=>{
|
|
@@ -11276,6 +11361,23 @@ class Watching {
|
|
|
11276
11361
|
this.compiler.compile(onCompiled);
|
|
11277
11362
|
});
|
|
11278
11363
|
}
|
|
11364
|
+
#accumulateWatchDeps(compilation) {
|
|
11365
|
+
let pending = this.#pendingWatchDeps ??= {
|
|
11366
|
+
file: {
|
|
11367
|
+
added: new Set(),
|
|
11368
|
+
removed: new Set()
|
|
11369
|
+
},
|
|
11370
|
+
context: {
|
|
11371
|
+
added: new Set(),
|
|
11372
|
+
removed: new Set()
|
|
11373
|
+
},
|
|
11374
|
+
missing: {
|
|
11375
|
+
added: new Set(),
|
|
11376
|
+
removed: new Set()
|
|
11377
|
+
}
|
|
11378
|
+
};
|
|
11379
|
+
foldWatchDelta(pending.file, compilation.__internal__addedFileDependencies, compilation.__internal__removedFileDependencies), foldWatchDelta(pending.context, compilation.__internal__addedContextDependencies, compilation.__internal__removedContextDependencies), foldWatchDelta(pending.missing, compilation.__internal__addedMissingDependencies, compilation.__internal__removedMissingDependencies);
|
|
11380
|
+
}
|
|
11279
11381
|
_done(error, compilation) {
|
|
11280
11382
|
let stats;
|
|
11281
11383
|
this.running = !1;
|
|
@@ -11284,7 +11386,10 @@ class Watching {
|
|
|
11284
11386
|
};
|
|
11285
11387
|
if (error) return handleError(error);
|
|
11286
11388
|
if (!compilation) throw Error('compilation is required if no error');
|
|
11287
|
-
if (stats = new Stats(compilation), this.invalid && !this.suspended && !this.blocked && !(this.isBlocked() && (this.blocked = !0)))
|
|
11389
|
+
if (stats = new Stats(compilation), this.invalid && !this.suspended && !this.blocked && !(this.isBlocked() && (this.blocked = !0))) {
|
|
11390
|
+
compilation && this.#accumulateWatchDeps(compilation), this.#go();
|
|
11391
|
+
return;
|
|
11392
|
+
}
|
|
11288
11393
|
let startTime = this.startTime;
|
|
11289
11394
|
this.startTime = void 0, compilation.startTime = startTime, compilation.endTime = Date.now();
|
|
11290
11395
|
let cbs = this.callbacks;
|
|
@@ -11292,18 +11397,21 @@ class Watching {
|
|
|
11292
11397
|
if (err) return handleError(err, cbs);
|
|
11293
11398
|
for (let cb of (this.handler(null, stats), process.nextTick(()=>{
|
|
11294
11399
|
if (!this.#closed) {
|
|
11400
|
+
this.#accumulateWatchDeps(compilation);
|
|
11401
|
+
let pending = this.#pendingWatchDeps;
|
|
11402
|
+
this.#pendingWatchDeps = void 0;
|
|
11295
11403
|
let fileDependencies = new Set([
|
|
11296
11404
|
...compilation.fileDependencies
|
|
11297
11405
|
]);
|
|
11298
|
-
fileDependencies.added =
|
|
11406
|
+
fileDependencies.added = pending.file.added, fileDependencies.removed = pending.file.removed;
|
|
11299
11407
|
let contextDependencies = new Set([
|
|
11300
11408
|
...compilation.contextDependencies
|
|
11301
11409
|
]);
|
|
11302
|
-
contextDependencies.added =
|
|
11410
|
+
contextDependencies.added = pending.context.added, contextDependencies.removed = pending.context.removed;
|
|
11303
11411
|
let missingDependencies = new Set([
|
|
11304
11412
|
...compilation.missingDependencies
|
|
11305
11413
|
]);
|
|
11306
|
-
missingDependencies.added =
|
|
11414
|
+
missingDependencies.added = pending.missing.added, missingDependencies.removed = pending.missing.removed, this.watch(fileDependencies, contextDependencies, missingDependencies);
|
|
11307
11415
|
}
|
|
11308
11416
|
}), cbs))cb(null);
|
|
11309
11417
|
this.compiler.hooks.afterDone.call(stats);
|
|
@@ -11365,6 +11473,7 @@ class Compiler {
|
|
|
11365
11473
|
#platform;
|
|
11366
11474
|
#target;
|
|
11367
11475
|
options;
|
|
11476
|
+
#rawOptions;
|
|
11368
11477
|
unsafeFastDrop = !1;
|
|
11369
11478
|
__internal_browser_require;
|
|
11370
11479
|
constructor(context, options){
|
|
@@ -11639,7 +11748,7 @@ class Compiler {
|
|
|
11639
11748
|
});
|
|
11640
11749
|
}
|
|
11641
11750
|
close(callback) {
|
|
11642
|
-
|
|
11751
|
+
this.watching ? this.watching.close(()=>{
|
|
11643
11752
|
this.close(callback);
|
|
11644
11753
|
}) : this.hooks.shutdown.callAsync((err)=>{
|
|
11645
11754
|
if (err) return callback(err);
|
|
@@ -11663,7 +11772,7 @@ class Compiler {
|
|
|
11663
11772
|
}
|
|
11664
11773
|
__internal__create_compilation(native) {
|
|
11665
11774
|
let compilation = this.#bindingCompilationMap.get(native);
|
|
11666
|
-
return compilation
|
|
11775
|
+
return compilation || ((compilation = new Compilation(this, native)).name = this.name, this.#bindingCompilationMap.set(native, compilation)), this.#compilation = compilation, compilation;
|
|
11667
11776
|
}
|
|
11668
11777
|
__internal__get_virtual_file_store() {
|
|
11669
11778
|
return this.#instance?.getVirtualFileStore();
|
|
@@ -11699,7 +11808,8 @@ Help:
|
|
|
11699
11808
|
`));
|
|
11700
11809
|
if (error) return callback(error);
|
|
11701
11810
|
if (this.#instance) return callback(null, this.#instance);
|
|
11702
|
-
let { options } = this
|
|
11811
|
+
let { options } = this;
|
|
11812
|
+
this.#rawOptions = (mode = options.mode, experiments = options.experiments, {
|
|
11703
11813
|
name: options.name,
|
|
11704
11814
|
mode,
|
|
11705
11815
|
context: options.context,
|
|
@@ -11784,13 +11894,12 @@ Help:
|
|
|
11784
11894
|
amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
|
|
11785
11895
|
bail: options.bail,
|
|
11786
11896
|
__references: {}
|
|
11787
|
-
});
|
|
11788
|
-
rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries()), rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
|
|
11897
|
+
}), this.#rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries()), this.#rawOptions.__virtual_files = VirtualModulesPlugin.__internal__take_virtual_files(this);
|
|
11789
11898
|
let instanceBinding = Compiler_require(process.env.RSPACK_BINDING ? process.env.RSPACK_BINDING : '@rspack/binding');
|
|
11790
11899
|
this.#registers = this.#createHooksRegisters();
|
|
11791
11900
|
let inputFileSystem = this.inputFileSystem && ThreadsafeInputNodeFS.needsBinding(options.experiments.useInputFileSystem) ? ThreadsafeInputNodeFS.__to_binding(this.inputFileSystem) : void 0;
|
|
11792
11901
|
try {
|
|
11793
|
-
this.#instance = new instanceBinding.JsCompiler(this.compilerPath, rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory), this.unsafeFastDrop, this.#platform), callback(null, this.#instance);
|
|
11902
|
+
this.#instance = new instanceBinding.JsCompiler(this.compilerPath, this.#rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory), this.unsafeFastDrop, this.#platform), callback(null, this.#instance);
|
|
11794
11903
|
} catch (err) {
|
|
11795
11904
|
err instanceof Error && delete err.stack, callback(Error('Failed to create Rspack compiler instance, check the Rspack configuration.', {
|
|
11796
11905
|
cause: err
|
|
@@ -12937,16 +13046,15 @@ class CollectSharedEntryPlugin extends RspackBuiltinPlugin {
|
|
|
12937
13046
|
return SHARE_ENTRY_ASSET;
|
|
12938
13047
|
}
|
|
12939
13048
|
apply(compiler) {
|
|
12940
|
-
super.apply(compiler)
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
});
|
|
13049
|
+
super.apply(compiler);
|
|
13050
|
+
let readCollectedEntries = (compilation)=>{
|
|
13051
|
+
let asset = compilation.getAsset(SHARE_ENTRY_ASSET);
|
|
13052
|
+
asset && (this._collectedEntries = JSON.parse(asset.source.source().toString()), compilation.deleteAsset(asset.name));
|
|
13053
|
+
};
|
|
13054
|
+
compiler.hooks.finishMake.tap({
|
|
13055
|
+
name: 'CollectSharedEntry',
|
|
13056
|
+
stage: 101
|
|
13057
|
+
}, readCollectedEntries);
|
|
12950
13058
|
}
|
|
12951
13059
|
raw() {
|
|
12952
13060
|
let rawOptions = {
|
|
@@ -13075,7 +13183,13 @@ class VirtualEntryPlugin {
|
|
|
13075
13183
|
});
|
|
13076
13184
|
}
|
|
13077
13185
|
}
|
|
13078
|
-
let resolveOutputDir = (outputDir, shareName)=>shareName ? join(outputDir, encodeName(shareName)) : outputDir
|
|
13186
|
+
let resolveOutputDir = (outputDir, shareName)=>shareName ? join(outputDir, encodeName(shareName)) : outputDir, getShareRequests = (shareRequestsMap, shareName)=>Array.from(new Map((shareRequestsMap[shareName]?.requests || []).map(([request, version])=>[
|
|
13187
|
+
version,
|
|
13188
|
+
[
|
|
13189
|
+
request,
|
|
13190
|
+
version
|
|
13191
|
+
]
|
|
13192
|
+
])).values());
|
|
13079
13193
|
class IndependentSharedPlugin {
|
|
13080
13194
|
mfName;
|
|
13081
13195
|
shared;
|
|
@@ -13088,10 +13202,11 @@ class IndependentSharedPlugin {
|
|
|
13088
13202
|
buildAssets = {};
|
|
13089
13203
|
injectTreeShakingUsedExports;
|
|
13090
13204
|
treeShakingSharedExcludePlugins;
|
|
13205
|
+
onBuildAssets;
|
|
13091
13206
|
name = 'IndependentSharedPlugin';
|
|
13092
13207
|
constructor(options){
|
|
13093
|
-
let { outputDir, plugins, treeShaking, shared, name, manifest, injectTreeShakingUsedExports, library, treeShakingSharedExcludePlugins } = options;
|
|
13094
|
-
this.shared = shared, this.mfName = name, this.outputDir = outputDir || 'independent-packages', this.plugins = plugins || [], this.treeShaking = treeShaking, this.manifest = manifest, this.injectTreeShakingUsedExports = injectTreeShakingUsedExports ?? !0, this.library = library, this.treeShakingSharedExcludePlugins = treeShakingSharedExcludePlugins || [], this.sharedOptions = parseOptions(shared, (item, key)=>{
|
|
13208
|
+
let { outputDir, plugins, treeShaking, shared, name, manifest, injectTreeShakingUsedExports, library, treeShakingSharedExcludePlugins, onBuildAssets } = options;
|
|
13209
|
+
this.shared = shared, this.mfName = name, this.outputDir = outputDir || 'independent-packages', this.plugins = plugins || [], this.treeShaking = treeShaking, this.manifest = manifest, this.injectTreeShakingUsedExports = injectTreeShakingUsedExports ?? !0, this.library = library, this.treeShakingSharedExcludePlugins = treeShakingSharedExcludePlugins || [], this.onBuildAssets = onBuildAssets, this.sharedOptions = parseOptions(shared, (item, key)=>{
|
|
13095
13210
|
if ('string' != typeof item) throw Error(`Unexpected array in shared configuration for key "${key}"`);
|
|
13096
13211
|
return item !== key && isRequiredVersion(item) ? {
|
|
13097
13212
|
import: key,
|
|
@@ -13102,11 +13217,16 @@ class IndependentSharedPlugin {
|
|
|
13102
13217
|
}, (item)=>item);
|
|
13103
13218
|
}
|
|
13104
13219
|
apply(compiler) {
|
|
13105
|
-
let { manifest } = this,
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
})
|
|
13109
|
-
|
|
13220
|
+
let { manifest } = this, collectSharedEntryPlugin = new CollectSharedEntryPlugin({
|
|
13221
|
+
sharedOptions: this.sharedOptions,
|
|
13222
|
+
shareScope: 'default'
|
|
13223
|
+
});
|
|
13224
|
+
collectSharedEntryPlugin.apply(compiler), compiler.hooks.finishMake.tapPromise({
|
|
13225
|
+
name: 'IndependentSharedPlugin',
|
|
13226
|
+
stage: 102
|
|
13227
|
+
}, async ()=>{
|
|
13228
|
+
let shareRequestsMap = collectSharedEntryPlugin.getData();
|
|
13229
|
+
this.prepareBuildAssets(shareRequestsMap), await this.createIndependentCompilers(compiler, shareRequestsMap), this.onBuildAssets?.(this.buildAssets);
|
|
13110
13230
|
}), manifest && compiler.hooks.compilation.tap('IndependentSharedPlugin', (compilation)=>{
|
|
13111
13231
|
compilation.hooks.processAssets.tap({
|
|
13112
13232
|
name: 'injectBuildAssets',
|
|
@@ -13127,15 +13247,36 @@ class IndependentSharedPlugin {
|
|
|
13127
13247
|
});
|
|
13128
13248
|
});
|
|
13129
13249
|
}
|
|
13130
|
-
|
|
13131
|
-
let { sharedOptions,
|
|
13132
|
-
|
|
13133
|
-
let shareRequestsMap = await this.createIndependentCompiler(parentCompiler);
|
|
13134
|
-
await Promise.all(sharedOptions.map(async ([shareName, shareConfig])=>{
|
|
13250
|
+
prepareBuildAssets(shareRequestsMap) {
|
|
13251
|
+
let { sharedOptions, outputDir, mfName, treeShaking, library } = this, buildAssets = {};
|
|
13252
|
+
sharedOptions.forEach(([shareName, shareConfig])=>{
|
|
13135
13253
|
if (!shareConfig.treeShaking || !1 === shareConfig.import) return;
|
|
13136
|
-
let
|
|
13254
|
+
let sharedConfig = sharedOptions.find(([name])=>name === shareName)?.[1];
|
|
13255
|
+
getShareRequests(shareRequestsMap, shareName).forEach(([request, version])=>{
|
|
13256
|
+
let [shareFileName, globalName, sharedVersion] = new SharedContainerPlugin({
|
|
13257
|
+
mfName: `${mfName}_${treeShaking ? 't' : 'f'}`,
|
|
13258
|
+
library,
|
|
13259
|
+
shareName,
|
|
13260
|
+
version,
|
|
13261
|
+
request,
|
|
13262
|
+
independentShareFileName: sharedConfig?.treeShaking?.filename
|
|
13263
|
+
}).getData();
|
|
13264
|
+
'string' == typeof shareFileName && (buildAssets[shareName] ||= [], buildAssets[shareName].push([
|
|
13265
|
+
join(resolveOutputDir(outputDir, shareName), shareFileName),
|
|
13266
|
+
sharedVersion,
|
|
13267
|
+
globalName
|
|
13268
|
+
]));
|
|
13269
|
+
});
|
|
13270
|
+
}), this.buildAssets = buildAssets;
|
|
13271
|
+
}
|
|
13272
|
+
async createIndependentCompilers(parentCompiler, shareRequestsMap) {
|
|
13273
|
+
let { sharedOptions } = this;
|
|
13274
|
+
console.log('Start building shared fallback resources ...'), await Promise.all(sharedOptions.map(async ([shareName, shareConfig])=>{
|
|
13275
|
+
if (!shareConfig.treeShaking || !1 === shareConfig.import) return;
|
|
13276
|
+
let shareRequests = getShareRequests(shareRequestsMap, shareName);
|
|
13137
13277
|
await Promise.all(shareRequests.map(async ([request, version])=>{
|
|
13138
|
-
let sharedConfig = sharedOptions.find(([name])=>name === shareName)?.[1]
|
|
13278
|
+
let sharedConfig = sharedOptions.find(([name])=>name === shareName)?.[1];
|
|
13279
|
+
await this.createIndependentCompiler(parentCompiler, {
|
|
13139
13280
|
shareRequestsMap,
|
|
13140
13281
|
currentShare: {
|
|
13141
13282
|
shareName,
|
|
@@ -13144,24 +13285,16 @@ class IndependentSharedPlugin {
|
|
|
13144
13285
|
independentShareFileName: sharedConfig?.treeShaking?.filename
|
|
13145
13286
|
}
|
|
13146
13287
|
});
|
|
13147
|
-
'string' == typeof shareFileName && (buildAssets[shareName] ||= [], buildAssets[shareName].push([
|
|
13148
|
-
join(resolveOutputDir(outputDir, shareName), shareFileName),
|
|
13149
|
-
sharedVersion,
|
|
13150
|
-
globalName
|
|
13151
|
-
]));
|
|
13152
13288
|
}));
|
|
13153
13289
|
})), console.log('All shared fallback have been compiled successfully!');
|
|
13154
13290
|
}
|
|
13155
13291
|
async createIndependentCompiler(parentCompiler, extraOptions) {
|
|
13156
|
-
let
|
|
13157
|
-
extraPlugin = extraOptions ? new SharedContainerPlugin({
|
|
13292
|
+
let { mfName, plugins, outputDir, sharedOptions, treeShaking, library, treeShakingSharedExcludePlugins } = this, outputDirWithShareName = resolveOutputDir(outputDir, extraOptions.currentShare.shareName), parentConfig = parentCompiler.options, finalPlugins = [], rspack = parentCompiler.rspack, extraPlugin = new SharedContainerPlugin({
|
|
13158
13293
|
mfName: `${mfName}_${treeShaking ? 't' : 'f'}`,
|
|
13159
13294
|
library,
|
|
13160
13295
|
...extraOptions.currentShare
|
|
13161
|
-
})
|
|
13162
|
-
|
|
13163
|
-
shareScope: 'default'
|
|
13164
|
-
}), (parentConfig.plugins || []).forEach((plugin)=>{
|
|
13296
|
+
});
|
|
13297
|
+
(parentConfig.plugins || []).forEach((plugin)=>{
|
|
13165
13298
|
void 0 !== plugin && 'string' != typeof plugin && ((plugin, excludedPlugins = [])=>{
|
|
13166
13299
|
if (!plugin) return !0;
|
|
13167
13300
|
let pluginName = plugin.name || plugin.constructor?.name;
|
|
@@ -13179,9 +13312,9 @@ class IndependentSharedPlugin {
|
|
|
13179
13312
|
}), plugins.forEach((plugin)=>{
|
|
13180
13313
|
finalPlugins.push(plugin);
|
|
13181
13314
|
}), finalPlugins.push(extraPlugin), finalPlugins.push(new ConsumeSharedPlugin({
|
|
13182
|
-
consumes: sharedOptions.filter(([key, options])=>extraOptions
|
|
13315
|
+
consumes: sharedOptions.filter(([key, options])=>extraOptions.currentShare.shareName !== (options.shareKey || key)).map(([key, options])=>({
|
|
13183
13316
|
[key]: {
|
|
13184
|
-
import: !
|
|
13317
|
+
import: !1,
|
|
13185
13318
|
shareKey: options.shareKey || key,
|
|
13186
13319
|
shareScope: options.shareScope,
|
|
13187
13320
|
requiredVersion: options.requiredVersion,
|
|
@@ -13192,9 +13325,10 @@ class IndependentSharedPlugin {
|
|
|
13192
13325
|
}
|
|
13193
13326
|
})),
|
|
13194
13327
|
enhanced: !0
|
|
13195
|
-
})), treeShaking && finalPlugins.push(new SharedUsedExportsOptimizerPlugin(sharedOptions, this.injectTreeShakingUsedExports)), finalPlugins.push(new VirtualEntryPlugin(sharedOptions, !
|
|
13328
|
+
})), treeShaking && finalPlugins.push(new SharedUsedExportsOptimizerPlugin(sharedOptions, this.injectTreeShakingUsedExports)), finalPlugins.push(new VirtualEntryPlugin(sharedOptions, !1));
|
|
13196
13329
|
let fullOutputDir = external_node_path_resolve(parentCompiler.outputPath, outputDirWithShareName), compilerConfig = {
|
|
13197
13330
|
...parentConfig,
|
|
13331
|
+
name: parentConfig.name || 'mf-shared-compiler',
|
|
13198
13332
|
module: {
|
|
13199
13333
|
...parentConfig.module,
|
|
13200
13334
|
rules: [
|
|
@@ -13215,7 +13349,7 @@ class IndependentSharedPlugin {
|
|
|
13215
13349
|
entry: VirtualEntryPlugin.entry,
|
|
13216
13350
|
output: {
|
|
13217
13351
|
path: fullOutputDir,
|
|
13218
|
-
clean: !
|
|
13352
|
+
clean: !1,
|
|
13219
13353
|
publicPath: parentConfig.output?.publicPath || 'auto'
|
|
13220
13354
|
},
|
|
13221
13355
|
plugins: finalPlugins,
|
|
@@ -13225,15 +13359,14 @@ class IndependentSharedPlugin {
|
|
|
13225
13359
|
}
|
|
13226
13360
|
}, compiler = rspack.rspack(compilerConfig);
|
|
13227
13361
|
compiler.inputFileSystem = parentCompiler.inputFileSystem, compiler.outputFileSystem = parentCompiler.outputFileSystem, compiler.intermediateFileSystem = parentCompiler.intermediateFileSystem;
|
|
13228
|
-
let { currentShare } = extraOptions
|
|
13362
|
+
let { currentShare } = extraOptions;
|
|
13229
13363
|
return new Promise((resolve, reject)=>{
|
|
13230
13364
|
compiler.run((err, stats)=>{
|
|
13231
13365
|
if (err || stats?.hasErrors()) {
|
|
13232
|
-
|
|
13233
|
-
console.error(`${target} Compile failed:`, err || stats.toJson().errors.map((e)=>e.message).join('\n')), reject(err || Error(`${target} Compile failed`));
|
|
13366
|
+
console.error(`${currentShare.shareName} Compile failed:`, err || stats.toJson().errors.map((e)=>e.message).join('\n')), reject(err || Error(`${currentShare.shareName} Compile failed`));
|
|
13234
13367
|
return;
|
|
13235
13368
|
}
|
|
13236
|
-
|
|
13369
|
+
console.log(`${currentShare.shareName} Compile success`), resolve(extraPlugin.getData());
|
|
13237
13370
|
});
|
|
13238
13371
|
});
|
|
13239
13372
|
}
|
|
@@ -13243,11 +13376,12 @@ class TreeShakingSharedPlugin {
|
|
|
13243
13376
|
mfConfig;
|
|
13244
13377
|
outputDir;
|
|
13245
13378
|
secondary;
|
|
13379
|
+
onBuildAssets;
|
|
13246
13380
|
_independentSharePlugin;
|
|
13247
13381
|
name = 'TreeShakingSharedPlugin';
|
|
13248
13382
|
constructor(options){
|
|
13249
|
-
let { mfConfig, secondary } = options;
|
|
13250
|
-
this.mfConfig = mfConfig, this.outputDir = mfConfig.treeShakingSharedDir || 'independent-packages', this.secondary = !!secondary;
|
|
13383
|
+
let { mfConfig, secondary, onBuildAssets } = options;
|
|
13384
|
+
this.mfConfig = mfConfig, this.outputDir = mfConfig.treeShakingSharedDir || 'independent-packages', this.secondary = !!secondary, this.onBuildAssets = onBuildAssets;
|
|
13251
13385
|
}
|
|
13252
13386
|
apply(compiler) {
|
|
13253
13387
|
let { mfConfig, outputDir, secondary } = this, { name, shared, library, treeShakingSharedPlugins } = mfConfig;
|
|
@@ -13261,14 +13395,15 @@ class TreeShakingSharedPlugin {
|
|
|
13261
13395
|
treeShaking: secondary,
|
|
13262
13396
|
library,
|
|
13263
13397
|
manifest: mfConfig.manifest,
|
|
13264
|
-
treeShakingSharedExcludePlugins: mfConfig.treeShakingSharedExcludePlugins
|
|
13398
|
+
treeShakingSharedExcludePlugins: mfConfig.treeShakingSharedExcludePlugins,
|
|
13399
|
+
onBuildAssets: this.onBuildAssets
|
|
13265
13400
|
}), this._independentSharePlugin.apply(compiler));
|
|
13266
13401
|
}
|
|
13267
13402
|
get buildAssets() {
|
|
13268
13403
|
return this._independentSharePlugin?.buildAssets || {};
|
|
13269
13404
|
}
|
|
13270
13405
|
}
|
|
13271
|
-
let ModuleFederationRuntimePlugin = base_create(binding_namespaceObject.BuiltinPluginName.ModuleFederationRuntimePlugin, (options = {})=>options), ModuleFederationPlugin_require = createRequire(import.meta.url);
|
|
13406
|
+
let ModuleFederationRuntimePlugin = base_create(binding_namespaceObject.BuiltinPluginName.ModuleFederationRuntimePlugin, (options = {})=>options), ModuleFederationPlugin_require = createRequire(import.meta.url), MF_RUNTIME_LOADER = '@module-federation/runtime/rspack.js';
|
|
13272
13407
|
function getRemoteInfos(options) {
|
|
13273
13408
|
if (!options.remotes) return {};
|
|
13274
13409
|
let remoteType = options.remoteType || (options.library ? options.library.type : "script"), remotes = parseOptions(options.remotes, (item)=>({
|
|
@@ -13324,17 +13459,35 @@ function getRemoteInfos(options) {
|
|
|
13324
13459
|
}
|
|
13325
13460
|
return remoteInfos;
|
|
13326
13461
|
}
|
|
13327
|
-
function
|
|
13328
|
-
|
|
13462
|
+
function getSharedOptions(options) {
|
|
13463
|
+
return options.shared ? parseOptions(options.shared, (item, key)=>{
|
|
13464
|
+
if ('string' != typeof item) throw Error('Unexpected array in shared');
|
|
13465
|
+
return item !== key && isRequiredVersion(item) ? {
|
|
13466
|
+
import: key,
|
|
13467
|
+
requiredVersion: item
|
|
13468
|
+
} : {
|
|
13469
|
+
import: item
|
|
13470
|
+
};
|
|
13471
|
+
}, (item)=>item) : [];
|
|
13472
|
+
}
|
|
13473
|
+
function getDefaultEntryRuntimeRequest(resource) {
|
|
13474
|
+
return `${MF_RUNTIME_LOADER}!=!${resource}`;
|
|
13475
|
+
}
|
|
13476
|
+
function getDefaultEntryRuntimeSource(paths, options, compiler, treeShakingShareFallbacks) {
|
|
13477
|
+
let runtimePlugins = options.runtimePlugins ?? [], remoteInfos = getRemoteInfos(options), runtimePluginImports = [], runtimePluginVars = [], libraryType = options.library?.type || 'var', shouldInitializePublicPath = getSharedOptions(options).some(([, config])=>config.treeShaking);
|
|
13329
13478
|
for(let i = 0; i < runtimePlugins.length; i++){
|
|
13330
13479
|
let runtimePluginVar = `__module_federation_runtime_plugin_${i}__`, pluginSpec = runtimePlugins[i], pluginPath = Array.isArray(pluginSpec) ? pluginSpec[0] : pluginSpec, pluginParams = Array.isArray(pluginSpec) ? pluginSpec[1] : void 0;
|
|
13331
13480
|
runtimePluginImports.push(`import ${runtimePluginVar} from ${JSON.stringify(pluginPath)}`);
|
|
13332
13481
|
let paramsCode = void 0 === pluginParams ? 'undefined' : JSON.stringify(pluginParams);
|
|
13333
13482
|
runtimePluginVars.push(`{ plugin: ${runtimePluginVar}, params: ${paramsCode} }`);
|
|
13334
13483
|
}
|
|
13335
|
-
|
|
13484
|
+
return [
|
|
13336
13485
|
`import __module_federation_bundler_runtime__ from ${JSON.stringify(paths.bundlerRuntime)}`,
|
|
13337
13486
|
...runtimePluginImports,
|
|
13487
|
+
shouldInitializePublicPath ? function(compiler) {
|
|
13488
|
+
let publicPath = compiler.options.output.publicPath;
|
|
13489
|
+
if ('string' == typeof publicPath && 'auto' !== publicPath) return `if (typeof __webpack_require__.p === "undefined") __webpack_require__.p = ${JSON.stringify(publicPath)}`;
|
|
13490
|
+
}(compiler) : void 0,
|
|
13338
13491
|
`const __module_federation_runtime_plugins__ = [${runtimePluginVars.join(', ')}].filter(({ plugin }) => plugin).map(({ plugin, params }) => plugin(params))`,
|
|
13339
13492
|
`const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
|
|
13340
13493
|
`const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
|
|
@@ -13343,7 +13496,9 @@ function getDefaultEntryRuntime(paths, options, compiler, treeShakingShareFallba
|
|
|
13343
13496
|
`const __module_federation_library_type__ = ${JSON.stringify(libraryType)}`,
|
|
13344
13497
|
compiler.rspack.Template.getFunctionContent(ModuleFederationPlugin_require('./moduleFederationDefaultRuntime.js').default)
|
|
13345
13498
|
].join(';');
|
|
13346
|
-
|
|
13499
|
+
}
|
|
13500
|
+
function getDefaultEntryRuntime(paths, options, compiler, treeShakingShareFallbacks) {
|
|
13501
|
+
return `${MF_RUNTIME_LOADER}!=!data:text/javascript,${encodeURIComponent(getDefaultEntryRuntimeSource(paths, options, compiler, treeShakingShareFallbacks))}`;
|
|
13347
13502
|
}
|
|
13348
13503
|
class ContainerPlugin extends RspackBuiltinPlugin {
|
|
13349
13504
|
name = binding_namespaceObject.BuiltinPluginName.ContainerPlugin;
|
|
@@ -13447,7 +13602,7 @@ async function transform(source, options) {
|
|
|
13447
13602
|
let _options = JSON.stringify(options || {});
|
|
13448
13603
|
return binding_default().transform(source, _options);
|
|
13449
13604
|
}
|
|
13450
|
-
let exports_rspackVersion = "2.0.
|
|
13605
|
+
let exports_rspackVersion = "2.0.7", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
|
|
13451
13606
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
13452
13607
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
13453
13608
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
|
@@ -13478,6 +13633,7 @@ let exports_rspackVersion = "2.0.5", exports_version = "5.75.0", exports_Webpack
|
|
|
13478
13633
|
}, electron = {
|
|
13479
13634
|
ElectronTargetPlugin: ElectronTargetPlugin
|
|
13480
13635
|
}, exports_ids = {
|
|
13636
|
+
DeterministicModuleIdsPlugin: DeterministicModuleIdsPlugin,
|
|
13481
13637
|
HashedModuleIdsPlugin: HashedModuleIdsPlugin
|
|
13482
13638
|
}, exports_library = {
|
|
13483
13639
|
EnableLibraryPlugin: EnableLibraryPlugin
|
|
@@ -13506,8 +13662,8 @@ let exports_rspackVersion = "2.0.5", exports_version = "5.75.0", exports_Webpack
|
|
|
13506
13662
|
this._options = _options;
|
|
13507
13663
|
}
|
|
13508
13664
|
apply(compiler) {
|
|
13509
|
-
var options;
|
|
13510
|
-
let { rspack } = compiler, paths = function(options, compiler) {
|
|
13665
|
+
var options, compiler1;
|
|
13666
|
+
let name, { rspack } = compiler, paths = function(options, compiler) {
|
|
13511
13667
|
let runtimeToolsPath;
|
|
13512
13668
|
if (options.implementation) runtimeToolsPath = options.implementation;
|
|
13513
13669
|
else try {
|
|
@@ -13539,17 +13695,18 @@ let exports_rspackVersion = "2.0.5", exports_version = "5.75.0", exports_Webpack
|
|
|
13539
13695
|
'@module-federation/runtime-tools': paths.runtimeTools,
|
|
13540
13696
|
'@module-federation/runtime': paths.runtime,
|
|
13541
13697
|
...compiler.options.resolve.alias
|
|
13542
|
-
}
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13546
|
-
|
|
13547
|
-
|
|
13548
|
-
|
|
13549
|
-
|
|
13550
|
-
|
|
13698
|
+
};
|
|
13699
|
+
let treeShakingEntries = getSharedOptions(this._options).filter(([, config])=>config.treeShaking), runtimeVirtualPath = treeShakingEntries.length > 0 ? (options = this._options, compiler1 = compiler, name = String(options.name ?? compiler1.options.output.uniqueName ?? 'default').replace(/[^\w.-]/g, '_'), external_node_path_resolve(compiler1.context, `node_modules/.rspack-mf-runtime/${name}.js`)) : void 0, runtimeVirtualPlugin = runtimeVirtualPath ? new rspack.experiments.VirtualModulesPlugin({
|
|
13700
|
+
[runtimeVirtualPath]: getDefaultEntryRuntimeSource(paths, this._options, compiler)
|
|
13701
|
+
}) : void 0;
|
|
13702
|
+
runtimeVirtualPlugin?.apply(compiler);
|
|
13703
|
+
let updateRuntimeShareFallbacks = (buildAssets)=>{
|
|
13704
|
+
runtimeVirtualPath && runtimeVirtualPlugin && runtimeVirtualPlugin.writeModule(runtimeVirtualPath, getDefaultEntryRuntimeSource(paths, this._options, compiler, buildAssets));
|
|
13705
|
+
};
|
|
13706
|
+
treeShakingEntries.length > 0 && (this._treeShakingSharedPlugin = new TreeShakingSharedPlugin({
|
|
13551
13707
|
mfConfig: this._options,
|
|
13552
|
-
secondary: !1
|
|
13708
|
+
secondary: !1,
|
|
13709
|
+
onBuildAssets: updateRuntimeShareFallbacks
|
|
13553
13710
|
}), this._treeShakingSharedPlugin.apply(compiler));
|
|
13554
13711
|
let runtimeExperiments = {
|
|
13555
13712
|
asyncStartup: this._options.experiments?.asyncStartup ?? !1
|
|
@@ -13559,7 +13716,7 @@ let exports_rspackVersion = "2.0.5", exports_version = "5.75.0", exports_Webpack
|
|
|
13559
13716
|
stage: 100
|
|
13560
13717
|
}, ()=>{
|
|
13561
13718
|
runtimePluginApplied || (runtimePluginApplied = !0, new ModuleFederationRuntimePlugin({
|
|
13562
|
-
entryRuntime: getDefaultEntryRuntime(paths, this._options, compiler
|
|
13719
|
+
entryRuntime: runtimeVirtualPath ? getDefaultEntryRuntimeRequest(runtimeVirtualPath) : getDefaultEntryRuntime(paths, this._options, compiler),
|
|
13563
13720
|
experiments: runtimeExperiments
|
|
13564
13721
|
}).apply(compiler));
|
|
13565
13722
|
}), compiler.hooks.watchRun.tap({
|
|
@@ -13567,7 +13724,7 @@ let exports_rspackVersion = "2.0.5", exports_version = "5.75.0", exports_Webpack
|
|
|
13567
13724
|
stage: 100
|
|
13568
13725
|
}, ()=>{
|
|
13569
13726
|
runtimePluginApplied || (runtimePluginApplied = !0, new ModuleFederationRuntimePlugin({
|
|
13570
|
-
entryRuntime: getDefaultEntryRuntime(paths, this._options, compiler
|
|
13727
|
+
entryRuntime: runtimeVirtualPath ? getDefaultEntryRuntimeRequest(runtimeVirtualPath) : getDefaultEntryRuntime(paths, this._options, compiler),
|
|
13571
13728
|
experiments: runtimeExperiments
|
|
13572
13729
|
}).apply(compiler));
|
|
13573
13730
|
});
|
|
@@ -13660,6 +13817,9 @@ let exports_rspackVersion = "2.0.5", exports_version = "5.75.0", exports_Webpack
|
|
|
13660
13817
|
return base_create(name, resolve, affectedHooks);
|
|
13661
13818
|
},
|
|
13662
13819
|
VirtualModulesPlugin: VirtualModulesPlugin,
|
|
13820
|
+
ids: {
|
|
13821
|
+
SyncModuleIdsPlugin: SyncModuleIdsPlugin
|
|
13822
|
+
},
|
|
13663
13823
|
rsc: {
|
|
13664
13824
|
createPlugins: ()=>{
|
|
13665
13825
|
let coordinator = new Coordinator();
|
|
@@ -13691,4 +13851,4 @@ src_fn.rspack = src_fn, src_fn.webpack = src_fn;
|
|
|
13691
13851
|
let src_rspack_0 = src_fn;
|
|
13692
13852
|
var AsyncDependenciesBlock = binding_namespaceObject.AsyncDependenciesBlock, ConcatenatedModule = binding_namespaceObject.ConcatenatedModule, ContextModule = binding_namespaceObject.ContextModule, Dependency = binding_namespaceObject.Dependency, EntryDependency = binding_namespaceObject.EntryDependency, ExternalModule = binding_namespaceObject.ExternalModule, Module = binding_namespaceObject.Module, NormalModule = binding_namespaceObject.NormalModule;
|
|
13693
13853
|
export default src_rspack_0;
|
|
13694
|
-
export { AsyncDependenciesBlock, BannerPlugin, CaseSensitivePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ConcatenatedModule, ContextModule, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefaultRuntimeGlobals as RuntimeGlobals, DefinePlugin, Dependency, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, EntryDependency, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalModule, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, Module, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, ModuleGraphConnection, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, container, electron, exports_WebpackError as WebpackError, exports_config as config, exports_experiments as experiments, exports_ids as ids, exports_library as library, exports_node as node, exports_rspackVersion as rspackVersion, exports_version as version, exports_wasm as wasm, index_js_namespaceObject as sources, javascript, lazyCompilationMiddleware, lib_EntryOptionPlugin as EntryOptionPlugin, optimize, sharing, src_rspack_0 as "module.exports", src_rspack_0 as rspack, statsFactoryUtils_StatsErrorCode as StatsErrorCode, util, web, webworker };
|
|
13854
|
+
export { AsyncDependenciesBlock, BannerPlugin, CaseSensitivePlugin, CircularCheckRspackPlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ConcatenatedModule, ContextModule, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefaultRuntimeGlobals as RuntimeGlobals, DefinePlugin, Dependency, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, EntryDependency, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalModule, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, Module, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, ModuleGraphConnection, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, SubresourceIntegrityPlugin, SwcJsMinimizerRspackPlugin, Template, ValidationError, container, electron, exports_WebpackError as WebpackError, exports_config as config, exports_experiments as experiments, exports_ids as ids, exports_library as library, exports_node as node, exports_rspackVersion as rspackVersion, exports_version as version, exports_wasm as wasm, index_js_namespaceObject as sources, javascript, lazyCompilationMiddleware, lib_EntryOptionPlugin as EntryOptionPlugin, optimize, sharing, src_rspack_0 as "module.exports", src_rspack_0 as rspack, statsFactoryUtils_StatsErrorCode as StatsErrorCode, util, web, webworker };
|