@rspack/core 2.0.6 → 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/package.json +1 -1
- package/compiled/connect-next/package.json +1 -1
- 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/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 +6 -3
- package/dist/index.js +325 -162
- 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/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { __webpack_require__ } from "./612.js";
|
|
|
8
8
|
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
9
9
|
import * as __rspack_external_node_util_1b29d436 from "node:util";
|
|
10
10
|
__webpack_require__.add({
|
|
11
|
-
"../../node_modules/.pnpm/enhanced-resolve@5.
|
|
11
|
+
"../../node_modules/.pnpm/enhanced-resolve@5.22.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
12
12
|
let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
|
|
13
13
|
let idx = path.length - 1;
|
|
14
14
|
for(; idx >= 0;){
|
|
@@ -87,9 +87,34 @@ __webpack_require__.add({
|
|
|
87
87
|
}
|
|
88
88
|
return this._storeResult(strPath, null, result), this._enterSyncModeWhenIdle(), callbacks && runCallbacks(callbacks, null, result), result;
|
|
89
89
|
}
|
|
90
|
-
purge(what) {
|
|
91
|
-
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) {
|
|
92
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
|
+
}
|
|
93
118
|
for (let [key, data] of this._data)key.startsWith(strWhat) && (this._data.delete(key), data.level.delete(key));
|
|
94
119
|
0 === this._data.size && this._enterIdleMode();
|
|
95
120
|
} else {
|
|
@@ -102,13 +127,10 @@ __webpack_require__.add({
|
|
|
102
127
|
}
|
|
103
128
|
0 === this._data.size && this._enterIdleMode();
|
|
104
129
|
}
|
|
105
|
-
else if (0 !== this._mode) {
|
|
106
|
-
for (let level of (this._data.clear(), this._levels))level.clear();
|
|
107
|
-
this._enterIdleMode();
|
|
108
|
-
}
|
|
109
130
|
}
|
|
110
131
|
purgeParent(what) {
|
|
111
|
-
if (
|
|
132
|
+
if (null == what) this.purge();
|
|
133
|
+
else if ("string" == typeof what || Buffer.isBuffer(what) || what instanceof URL || "number" == typeof what) {
|
|
112
134
|
let strWhat = "string" != typeof what ? what.toString() : what;
|
|
113
135
|
this.purge(dirname(strWhat));
|
|
114
136
|
} else {
|
|
@@ -119,7 +141,6 @@ __webpack_require__.add({
|
|
|
119
141
|
}
|
|
120
142
|
this.purge(set);
|
|
121
143
|
}
|
|
122
|
-
else this.purge();
|
|
123
144
|
}
|
|
124
145
|
_storeResult(path, err, result) {
|
|
125
146
|
if (this._data.has(path)) return;
|
|
@@ -208,8 +229,8 @@ __webpack_require__.add({
|
|
|
208
229
|
let realpathSync = this._realpathBackend.provideSync;
|
|
209
230
|
this.realpathSync = realpathSync;
|
|
210
231
|
}
|
|
211
|
-
purge(what) {
|
|
212
|
-
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);
|
|
213
234
|
}
|
|
214
235
|
};
|
|
215
236
|
},
|
|
@@ -226,6 +247,7 @@ __webpack_require__.r(exports_namespaceObject), __webpack_require__.d(exports_na
|
|
|
226
247
|
AsyncDependenciesBlock: ()=>binding_namespaceObject.AsyncDependenciesBlock,
|
|
227
248
|
BannerPlugin: ()=>BannerPlugin,
|
|
228
249
|
CaseSensitivePlugin: ()=>CaseSensitivePlugin,
|
|
250
|
+
CircularCheckRspackPlugin: ()=>CircularCheckRspackPlugin,
|
|
229
251
|
CircularDependencyRspackPlugin: ()=>CircularDependencyRspackPlugin,
|
|
230
252
|
Compilation: ()=>Compilation,
|
|
231
253
|
Compiler: ()=>Compiler,
|
|
@@ -2464,6 +2486,28 @@ class CircularModulesInfoPlugin extends RspackBuiltinPlugin {
|
|
|
2464
2486
|
return createBuiltinPlugin(this.name, void 0);
|
|
2465
2487
|
}
|
|
2466
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
|
+
}
|
|
2467
2511
|
class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
|
|
2468
2512
|
name = binding_namespaceObject.BuiltinPluginName.CircularDependencyRspackPlugin;
|
|
2469
2513
|
_options;
|
|
@@ -4326,6 +4370,7 @@ let getRawModuleRule = (rule, path, options, upperType)=>{
|
|
|
4326
4370
|
issuer: rule.issuer ? getRawRuleSetCondition(rule.issuer) : void 0,
|
|
4327
4371
|
issuerLayer: rule.issuerLayer ? getRawRuleSetCondition(rule.issuerLayer) : void 0,
|
|
4328
4372
|
dependency: rule.dependency ? getRawRuleSetCondition(rule.dependency) : void 0,
|
|
4373
|
+
phase: rule.phase ? getRawRuleSetCondition(rule.phase) : void 0,
|
|
4329
4374
|
descriptionData: rule.descriptionData ? Object.fromEntries(Object.entries(rule.descriptionData).map(([k, v])=>[
|
|
4330
4375
|
k,
|
|
4331
4376
|
getRawRuleSetCondition(v)
|
|
@@ -4429,24 +4474,21 @@ function getRawParserOptions(parser, type) {
|
|
|
4429
4474
|
namedExports: (parser2 = parser).namedExports,
|
|
4430
4475
|
url: parser2.url,
|
|
4431
4476
|
import: parser2.import,
|
|
4432
|
-
resolveImport: parser2.resolveImport
|
|
4433
|
-
animation: parser2.animation,
|
|
4434
|
-
customIdents: parser2.customIdents,
|
|
4435
|
-
dashedIdents: parser2.dashedIdents
|
|
4477
|
+
resolveImport: parser2.resolveImport
|
|
4436
4478
|
}
|
|
4437
4479
|
};
|
|
4438
4480
|
}
|
|
4439
4481
|
if ('css/auto' === type) return {
|
|
4440
4482
|
type: 'css/auto',
|
|
4441
|
-
cssAuto:
|
|
4483
|
+
cssAuto: getRawCssAutoOrModuleParserOptions(parser)
|
|
4442
4484
|
};
|
|
4443
4485
|
if ('css/global' === type) return {
|
|
4444
4486
|
type: 'css/global',
|
|
4445
|
-
cssGlobal:
|
|
4487
|
+
cssGlobal: getRawCssModuleParserOptions(parser)
|
|
4446
4488
|
};
|
|
4447
4489
|
if ('css/module' === type) return {
|
|
4448
4490
|
type: 'css/module',
|
|
4449
|
-
cssModule:
|
|
4491
|
+
cssModule: getRawCssAutoOrModuleParserOptions(parser)
|
|
4450
4492
|
};
|
|
4451
4493
|
if ('json' === type) {
|
|
4452
4494
|
return {
|
|
@@ -4489,19 +4531,29 @@ function getRawJavascriptParserOptions(parser) {
|
|
|
4489
4531
|
typeReexportsPresence: parser.typeReexportsPresence,
|
|
4490
4532
|
jsx: parser.jsx,
|
|
4491
4533
|
deferImport: parser.deferImport,
|
|
4534
|
+
sourceImport: parser.sourceImport,
|
|
4492
4535
|
importMetaResolve: parser.importMetaResolve,
|
|
4493
4536
|
pureFunctions: parser.pureFunctions
|
|
4494
4537
|
};
|
|
4495
4538
|
}
|
|
4496
|
-
function
|
|
4539
|
+
function getRawCssModuleParserOptions(parser) {
|
|
4497
4540
|
return {
|
|
4498
4541
|
namedExports: parser.namedExports,
|
|
4499
4542
|
url: parser.url,
|
|
4500
4543
|
import: parser.import,
|
|
4501
4544
|
resolveImport: parser.resolveImport,
|
|
4502
4545
|
animation: parser.animation,
|
|
4546
|
+
container: parser.container,
|
|
4503
4547
|
customIdents: parser.customIdents,
|
|
4504
|
-
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
|
|
4505
4557
|
};
|
|
4506
4558
|
}
|
|
4507
4559
|
function getRawGeneratorOptions(generator, type) {
|
|
@@ -4961,12 +5013,13 @@ let JsLoaderRspackPlugin = base_create(binding_namespaceObject.BuiltinPluginName
|
|
|
4961
5013
|
pseudoClasses
|
|
4962
5014
|
}
|
|
4963
5015
|
};
|
|
4964
|
-
}), 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)=>({
|
|
4965
5017
|
imports,
|
|
4966
5018
|
entries,
|
|
4967
5019
|
test,
|
|
4968
5020
|
client,
|
|
4969
|
-
currentActiveModules
|
|
5021
|
+
currentActiveModules,
|
|
5022
|
+
reservedExternals
|
|
4970
5023
|
}), 'thisCompilation'), middleware_require = createRequire(import.meta.url), LAZY_COMPILATION_PREFIX = '/_rspack/lazy/trigger', noop = (_req, _res, next)=>{
|
|
4971
5024
|
'function' == typeof next && next();
|
|
4972
5025
|
}, lazyCompilationMiddleware = (compiler)=>{
|
|
@@ -5004,7 +5057,17 @@ function applyPlugin(compiler, options, activeModules) {
|
|
|
5004
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 })=>{
|
|
5005
5058
|
let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
|
|
5006
5059
|
return serverUrl ? serverUrl + (serverUrl.endsWith('/') ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
|
|
5007
|
-
})(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);
|
|
5008
5071
|
}
|
|
5009
5072
|
let lazyCompilationMiddlewareInternal = (compiler, activeModules, lazyCompilationPrefix)=>{
|
|
5010
5073
|
let logger = compiler.getInfrastructureLogger('LazyCompilation');
|
|
@@ -5414,7 +5477,22 @@ let SwcJsMinimizerRspackPlugin = base_create(binding_namespaceObject.BuiltinPlug
|
|
|
5414
5477
|
module: options?.minimizerOptions?.module
|
|
5415
5478
|
}
|
|
5416
5479
|
};
|
|
5417
|
-
}, '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');
|
|
5418
5496
|
class WorkerPlugin extends RspackBuiltinPlugin {
|
|
5419
5497
|
chunkLoading;
|
|
5420
5498
|
wasmLoading;
|
|
@@ -6612,6 +6690,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6612
6690
|
mode: options.mode,
|
|
6613
6691
|
uniqueName: options.output.uniqueName,
|
|
6614
6692
|
deferImport: options.experiments.deferImport,
|
|
6693
|
+
sourceImport: options.experiments.sourceImport,
|
|
6615
6694
|
outputModule: options.output.module,
|
|
6616
6695
|
hashFunction: options.output.hashFunction,
|
|
6617
6696
|
hashSalt: options.output.hashSalt
|
|
@@ -6643,22 +6722,27 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6643
6722
|
targets: targetProperties.targets
|
|
6644
6723
|
};
|
|
6645
6724
|
}, applyExperimentsDefaults = (experiments)=>{
|
|
6646
|
-
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);
|
|
6647
6726
|
}, applyIncrementalDefaults = (options)=>{
|
|
6648
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));
|
|
6649
|
-
}, 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 })=>{
|
|
6650
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);
|
|
6651
6732
|
}, applyCssModuleParserOptionsDefaults = (parserOptions)=>{
|
|
6652
|
-
D(parserOptions, '
|
|
6653
|
-
},
|
|
6654
|
-
|
|
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 })=>{
|
|
6655
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', [
|
|
6656
6739
|
'...'
|
|
6657
|
-
]), 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);
|
|
6658
6741
|
})(module.parser.javascript, {
|
|
6659
6742
|
deferImport,
|
|
6743
|
+
sourceImport,
|
|
6660
6744
|
outputModule
|
|
6661
|
-
}), 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 })=>{
|
|
6662
6746
|
D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
|
|
6663
6747
|
})(module.generator.css, {
|
|
6664
6748
|
targetProperties
|
|
@@ -6949,7 +7033,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6949
7033
|
return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
|
|
6950
7034
|
desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
|
|
6951
7035
|
}), Array.from(enabledWasmLoadingTypes);
|
|
6952
|
-
}), 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));
|
|
6953
7037
|
}, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
|
|
6954
7038
|
let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
|
|
6955
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')));
|
|
@@ -7086,22 +7170,21 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7086
7170
|
loader: cjsDeps(),
|
|
7087
7171
|
unknown: cjsDeps()
|
|
7088
7172
|
}
|
|
7089
|
-
};
|
|
7090
|
-
|
|
7173
|
+
}, styleConditions = [];
|
|
7174
|
+
styleConditions.push('development' === mode ? 'development' : 'production'), styleConditions.push('style');
|
|
7175
|
+
let cssResolveOptions = {
|
|
7091
7176
|
mainFiles: [],
|
|
7092
7177
|
mainFields: [
|
|
7093
7178
|
'style',
|
|
7094
7179
|
'...'
|
|
7095
7180
|
],
|
|
7096
|
-
conditionNames:
|
|
7097
|
-
'development' === mode ? 'development' : 'production',
|
|
7098
|
-
'style'
|
|
7099
|
-
],
|
|
7181
|
+
conditionNames: styleConditions,
|
|
7100
7182
|
extensions: [
|
|
7101
7183
|
'.css'
|
|
7102
7184
|
],
|
|
7103
7185
|
preferRelative: !0
|
|
7104
|
-
}
|
|
7186
|
+
};
|
|
7187
|
+
return resolveOptions.byDependency['css-import'] = cssResolveOptions, resolveOptions.byDependency['css-import-local-module'] = cssResolveOptions, resolveOptions.byDependency['css-import-global-module'] = cssResolveOptions, resolveOptions;
|
|
7105
7188
|
}, D = (obj, prop, value)=>{
|
|
7106
7189
|
void 0 === obj[prop] && (obj[prop] = value);
|
|
7107
7190
|
}, F = (obj, prop, factory)=>{
|
|
@@ -7406,7 +7489,7 @@ function __to_binding_runtime_globals(runtimeRequirements, compilerRuntimeGlobal
|
|
|
7406
7489
|
}
|
|
7407
7490
|
return res;
|
|
7408
7491
|
}
|
|
7409
|
-
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);
|
|
7410
7493
|
function renderRuntimeVariables(variable, _compilerOptions) {
|
|
7411
7494
|
switch(variable){
|
|
7412
7495
|
case 0:
|
|
@@ -7487,98 +7570,100 @@ function createCompilerRuntimeGlobals(compilerOptions) {
|
|
|
7487
7570
|
case 28:
|
|
7488
7571
|
return `${scope_name}.v`;
|
|
7489
7572
|
case 29:
|
|
7490
|
-
return `${scope_name}.
|
|
7573
|
+
return `${scope_name}.vs`;
|
|
7491
7574
|
case 30:
|
|
7492
|
-
return `${scope_name}.
|
|
7575
|
+
return `${scope_name}.oe`;
|
|
7493
7576
|
case 31:
|
|
7494
|
-
return `${scope_name}.
|
|
7577
|
+
return `${scope_name}.nc`;
|
|
7495
7578
|
case 32:
|
|
7496
|
-
return `${scope_name}.
|
|
7579
|
+
return `${scope_name}.l`;
|
|
7497
7580
|
case 33:
|
|
7498
|
-
return `${scope_name}.
|
|
7581
|
+
return `${scope_name}.ts`;
|
|
7499
7582
|
case 34:
|
|
7500
|
-
return `${scope_name}.
|
|
7583
|
+
return `${scope_name}.tu`;
|
|
7501
7584
|
case 35:
|
|
7502
|
-
return
|
|
7585
|
+
return `${scope_name}.tt`;
|
|
7503
7586
|
case 36:
|
|
7504
|
-
return
|
|
7587
|
+
return "has fetch priority";
|
|
7505
7588
|
case 37:
|
|
7506
|
-
return `${scope_name}.
|
|
7589
|
+
return `${scope_name}.cn`;
|
|
7507
7590
|
case 38:
|
|
7508
|
-
return `${scope_name}.
|
|
7591
|
+
return `${scope_name}.j`;
|
|
7509
7592
|
case 39:
|
|
7510
|
-
return `${scope_name}.
|
|
7593
|
+
return `${scope_name}.u`;
|
|
7511
7594
|
case 40:
|
|
7512
|
-
return `${scope_name}.
|
|
7595
|
+
return `${scope_name}.k`;
|
|
7513
7596
|
case 41:
|
|
7514
|
-
return
|
|
7597
|
+
return `${scope_name}.rv`;
|
|
7515
7598
|
case 42:
|
|
7516
|
-
return
|
|
7599
|
+
return "has css modules";
|
|
7517
7600
|
case 43:
|
|
7518
|
-
return `${scope_name}.
|
|
7601
|
+
return `${scope_name}.ruid`;
|
|
7519
7602
|
case 44:
|
|
7520
|
-
return `${scope_name}.
|
|
7603
|
+
return `${scope_name}.hu`;
|
|
7521
7604
|
case 45:
|
|
7522
|
-
return `${scope_name}.
|
|
7605
|
+
return `${scope_name}.hk`;
|
|
7523
7606
|
case 46:
|
|
7524
|
-
return `${scope_name}.x
|
|
7607
|
+
return `${scope_name}.x`;
|
|
7525
7608
|
case 47:
|
|
7526
|
-
return `${scope_name}.x (
|
|
7609
|
+
return `${scope_name}.x (no default handler)`;
|
|
7527
7610
|
case 48:
|
|
7528
|
-
return `${scope_name}.x (only
|
|
7611
|
+
return `${scope_name}.x (only after)`;
|
|
7529
7612
|
case 49:
|
|
7530
|
-
return
|
|
7613
|
+
return `${scope_name}.x (only before)`;
|
|
7531
7614
|
case 50:
|
|
7532
|
-
return
|
|
7615
|
+
return "global chunk callback";
|
|
7533
7616
|
case 51:
|
|
7534
|
-
return `${scope_name}.
|
|
7617
|
+
return `${scope_name}.X`;
|
|
7535
7618
|
case 52:
|
|
7536
|
-
return `${scope_name}.
|
|
7619
|
+
return `${scope_name}.x (chunk dependencies)`;
|
|
7537
7620
|
case 53:
|
|
7538
|
-
return `${scope_name}.
|
|
7621
|
+
return `${scope_name}.O`;
|
|
7539
7622
|
case 54:
|
|
7540
|
-
return `${scope_name}.
|
|
7623
|
+
return `${scope_name}.C`;
|
|
7541
7624
|
case 55:
|
|
7542
|
-
return `${scope_name}.
|
|
7625
|
+
return `${scope_name}.i`;
|
|
7543
7626
|
case 56:
|
|
7544
|
-
return `${scope_name}.
|
|
7627
|
+
return `${scope_name}.g`;
|
|
7545
7628
|
case 57:
|
|
7546
|
-
return `${scope_name}.
|
|
7629
|
+
return `${scope_name}.S`;
|
|
7547
7630
|
case 58:
|
|
7548
|
-
return `${scope_name}.
|
|
7631
|
+
return `${scope_name}.I`;
|
|
7549
7632
|
case 59:
|
|
7550
|
-
return `${scope_name}.
|
|
7633
|
+
return `${scope_name}.R`;
|
|
7551
7634
|
case 60:
|
|
7552
|
-
return `${scope_name}.
|
|
7635
|
+
return `${scope_name}.hmrF`;
|
|
7553
7636
|
case 61:
|
|
7554
|
-
return `${scope_name}.
|
|
7637
|
+
return `${scope_name}.hmrM`;
|
|
7555
7638
|
case 62:
|
|
7556
|
-
return `${scope_name}.
|
|
7639
|
+
return `${scope_name}.hmrC`;
|
|
7557
7640
|
case 63:
|
|
7558
|
-
return `${scope_name}.
|
|
7641
|
+
return `${scope_name}.hmrD`;
|
|
7559
7642
|
case 64:
|
|
7560
|
-
return `${scope_name}.
|
|
7643
|
+
return `${scope_name}.hmrI`;
|
|
7561
7644
|
case 65:
|
|
7562
|
-
return `${scope_name}.
|
|
7645
|
+
return `${scope_name}.hmrS`;
|
|
7563
7646
|
case 66:
|
|
7564
|
-
return `${scope_name}.
|
|
7647
|
+
return `${scope_name}.amdD`;
|
|
7565
7648
|
case 67:
|
|
7566
|
-
return `${scope_name}.
|
|
7649
|
+
return `${scope_name}.amdO`;
|
|
7567
7650
|
case 68:
|
|
7568
|
-
return `${scope_name}.
|
|
7651
|
+
return `${scope_name}.System`;
|
|
7569
7652
|
case 69:
|
|
7570
|
-
return `${scope_name}.
|
|
7653
|
+
return `${scope_name}.o`;
|
|
7571
7654
|
case 70:
|
|
7572
|
-
return `${scope_name}.
|
|
7655
|
+
return `${scope_name}.y`;
|
|
7573
7656
|
case 71:
|
|
7574
|
-
return `${scope_name}.
|
|
7657
|
+
return `${scope_name}.b`;
|
|
7575
7658
|
case 72:
|
|
7576
|
-
return `${scope_name}.
|
|
7659
|
+
return `${scope_name}.U`;
|
|
7577
7660
|
case 73:
|
|
7578
|
-
return `${scope_name}.
|
|
7661
|
+
return `${scope_name}.a`;
|
|
7579
7662
|
case 74:
|
|
7580
|
-
return `${scope_name}.
|
|
7663
|
+
return `${scope_name}.aE`;
|
|
7581
7664
|
case 75:
|
|
7665
|
+
return `${scope_name}.z`;
|
|
7666
|
+
case 76:
|
|
7582
7667
|
return `${scope_name}.zS`;
|
|
7583
7668
|
default:
|
|
7584
7669
|
return '';
|
|
@@ -8203,7 +8288,7 @@ class MultiStats {
|
|
|
8203
8288
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8204
8289
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8205
8290
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8206
|
-
}), 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(''));
|
|
8207
8292
|
let mapError = (j, obj)=>({
|
|
8208
8293
|
...obj,
|
|
8209
8294
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -8712,7 +8797,7 @@ let arraySum = (array)=>{
|
|
|
8712
8797
|
let str = `${a}`, length = lengths[i];
|
|
8713
8798
|
return str.length === length ? str : length > 5 ? `...${str.slice(-length + 3)}` : length > 0 ? str.slice(-length) : '';
|
|
8714
8799
|
});
|
|
8715
|
-
}, 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");
|
|
8716
8801
|
var CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
|
|
8717
8802
|
class NodeEnvironmentPlugin {
|
|
8718
8803
|
options;
|
|
@@ -9477,7 +9562,7 @@ let iterateConfig = (config, options, fn)=>{
|
|
|
9477
9562
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9478
9563
|
},
|
|
9479
9564
|
version: (object)=>{
|
|
9480
|
-
object.version = "5.75.0", object.rspackVersion = "2.0.
|
|
9565
|
+
object.version = "5.75.0", object.rspackVersion = "2.0.7";
|
|
9481
9566
|
},
|
|
9482
9567
|
env: (object, _compilation, _context, { _env })=>{
|
|
9483
9568
|
object.env = _env;
|
|
@@ -11138,7 +11223,7 @@ class TraceHookPlugin {
|
|
|
11138
11223
|
});
|
|
11139
11224
|
}
|
|
11140
11225
|
}
|
|
11141
|
-
let CORE_VERSION = "2.0.
|
|
11226
|
+
let CORE_VERSION = "2.0.7", VFILES_BY_COMPILER = new WeakMap();
|
|
11142
11227
|
class VirtualModulesPlugin {
|
|
11143
11228
|
#staticModules;
|
|
11144
11229
|
#compiler;
|
|
@@ -11180,6 +11265,10 @@ class VirtualModulesPlugin {
|
|
|
11180
11265
|
}));
|
|
11181
11266
|
}
|
|
11182
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
|
+
}
|
|
11183
11272
|
class Watching {
|
|
11184
11273
|
watcher;
|
|
11185
11274
|
pausedWatcher;
|
|
@@ -11201,6 +11290,7 @@ class Watching {
|
|
|
11201
11290
|
#closed;
|
|
11202
11291
|
#collectedChangedFiles;
|
|
11203
11292
|
#collectedRemovedFiles;
|
|
11293
|
+
#pendingWatchDeps;
|
|
11204
11294
|
suspended;
|
|
11205
11295
|
constructor(compiler, watchOptions, handler){
|
|
11206
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(()=>{
|
|
@@ -11271,6 +11361,23 @@ class Watching {
|
|
|
11271
11361
|
this.compiler.compile(onCompiled);
|
|
11272
11362
|
});
|
|
11273
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
|
+
}
|
|
11274
11381
|
_done(error, compilation) {
|
|
11275
11382
|
let stats;
|
|
11276
11383
|
this.running = !1;
|
|
@@ -11279,7 +11386,10 @@ class Watching {
|
|
|
11279
11386
|
};
|
|
11280
11387
|
if (error) return handleError(error);
|
|
11281
11388
|
if (!compilation) throw Error('compilation is required if no error');
|
|
11282
|
-
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
|
+
}
|
|
11283
11393
|
let startTime = this.startTime;
|
|
11284
11394
|
this.startTime = void 0, compilation.startTime = startTime, compilation.endTime = Date.now();
|
|
11285
11395
|
let cbs = this.callbacks;
|
|
@@ -11287,18 +11397,21 @@ class Watching {
|
|
|
11287
11397
|
if (err) return handleError(err, cbs);
|
|
11288
11398
|
for (let cb of (this.handler(null, stats), process.nextTick(()=>{
|
|
11289
11399
|
if (!this.#closed) {
|
|
11400
|
+
this.#accumulateWatchDeps(compilation);
|
|
11401
|
+
let pending = this.#pendingWatchDeps;
|
|
11402
|
+
this.#pendingWatchDeps = void 0;
|
|
11290
11403
|
let fileDependencies = new Set([
|
|
11291
11404
|
...compilation.fileDependencies
|
|
11292
11405
|
]);
|
|
11293
|
-
fileDependencies.added =
|
|
11406
|
+
fileDependencies.added = pending.file.added, fileDependencies.removed = pending.file.removed;
|
|
11294
11407
|
let contextDependencies = new Set([
|
|
11295
11408
|
...compilation.contextDependencies
|
|
11296
11409
|
]);
|
|
11297
|
-
contextDependencies.added =
|
|
11410
|
+
contextDependencies.added = pending.context.added, contextDependencies.removed = pending.context.removed;
|
|
11298
11411
|
let missingDependencies = new Set([
|
|
11299
11412
|
...compilation.missingDependencies
|
|
11300
11413
|
]);
|
|
11301
|
-
missingDependencies.added =
|
|
11414
|
+
missingDependencies.added = pending.missing.added, missingDependencies.removed = pending.missing.removed, this.watch(fileDependencies, contextDependencies, missingDependencies);
|
|
11302
11415
|
}
|
|
11303
11416
|
}), cbs))cb(null);
|
|
11304
11417
|
this.compiler.hooks.afterDone.call(stats);
|
|
@@ -12933,16 +13046,15 @@ class CollectSharedEntryPlugin extends RspackBuiltinPlugin {
|
|
|
12933
13046
|
return SHARE_ENTRY_ASSET;
|
|
12934
13047
|
}
|
|
12935
13048
|
apply(compiler) {
|
|
12936
|
-
super.apply(compiler)
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
});
|
|
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);
|
|
12946
13058
|
}
|
|
12947
13059
|
raw() {
|
|
12948
13060
|
let rawOptions = {
|
|
@@ -13071,7 +13183,13 @@ class VirtualEntryPlugin {
|
|
|
13071
13183
|
});
|
|
13072
13184
|
}
|
|
13073
13185
|
}
|
|
13074
|
-
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());
|
|
13075
13193
|
class IndependentSharedPlugin {
|
|
13076
13194
|
mfName;
|
|
13077
13195
|
shared;
|
|
@@ -13084,10 +13202,11 @@ class IndependentSharedPlugin {
|
|
|
13084
13202
|
buildAssets = {};
|
|
13085
13203
|
injectTreeShakingUsedExports;
|
|
13086
13204
|
treeShakingSharedExcludePlugins;
|
|
13205
|
+
onBuildAssets;
|
|
13087
13206
|
name = 'IndependentSharedPlugin';
|
|
13088
13207
|
constructor(options){
|
|
13089
|
-
let { outputDir, plugins, treeShaking, shared, name, manifest, injectTreeShakingUsedExports, library, treeShakingSharedExcludePlugins } = options;
|
|
13090
|
-
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)=>{
|
|
13091
13210
|
if ('string' != typeof item) throw Error(`Unexpected array in shared configuration for key "${key}"`);
|
|
13092
13211
|
return item !== key && isRequiredVersion(item) ? {
|
|
13093
13212
|
import: key,
|
|
@@ -13098,11 +13217,16 @@ class IndependentSharedPlugin {
|
|
|
13098
13217
|
}, (item)=>item);
|
|
13099
13218
|
}
|
|
13100
13219
|
apply(compiler) {
|
|
13101
|
-
let { manifest } = this,
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
})
|
|
13105
|
-
|
|
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);
|
|
13106
13230
|
}), manifest && compiler.hooks.compilation.tap('IndependentSharedPlugin', (compilation)=>{
|
|
13107
13231
|
compilation.hooks.processAssets.tap({
|
|
13108
13232
|
name: 'injectBuildAssets',
|
|
@@ -13123,15 +13247,36 @@ class IndependentSharedPlugin {
|
|
|
13123
13247
|
});
|
|
13124
13248
|
});
|
|
13125
13249
|
}
|
|
13126
|
-
|
|
13127
|
-
let { sharedOptions,
|
|
13128
|
-
|
|
13129
|
-
let shareRequestsMap = await this.createIndependentCompiler(parentCompiler);
|
|
13130
|
-
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])=>{
|
|
13131
13253
|
if (!shareConfig.treeShaking || !1 === shareConfig.import) return;
|
|
13132
|
-
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);
|
|
13133
13277
|
await Promise.all(shareRequests.map(async ([request, version])=>{
|
|
13134
|
-
let sharedConfig = sharedOptions.find(([name])=>name === shareName)?.[1]
|
|
13278
|
+
let sharedConfig = sharedOptions.find(([name])=>name === shareName)?.[1];
|
|
13279
|
+
await this.createIndependentCompiler(parentCompiler, {
|
|
13135
13280
|
shareRequestsMap,
|
|
13136
13281
|
currentShare: {
|
|
13137
13282
|
shareName,
|
|
@@ -13140,24 +13285,16 @@ class IndependentSharedPlugin {
|
|
|
13140
13285
|
independentShareFileName: sharedConfig?.treeShaking?.filename
|
|
13141
13286
|
}
|
|
13142
13287
|
});
|
|
13143
|
-
'string' == typeof shareFileName && (buildAssets[shareName] ||= [], buildAssets[shareName].push([
|
|
13144
|
-
join(resolveOutputDir(outputDir, shareName), shareFileName),
|
|
13145
|
-
sharedVersion,
|
|
13146
|
-
globalName
|
|
13147
|
-
]));
|
|
13148
13288
|
}));
|
|
13149
13289
|
})), console.log('All shared fallback have been compiled successfully!');
|
|
13150
13290
|
}
|
|
13151
13291
|
async createIndependentCompiler(parentCompiler, extraOptions) {
|
|
13152
|
-
let
|
|
13153
|
-
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({
|
|
13154
13293
|
mfName: `${mfName}_${treeShaking ? 't' : 'f'}`,
|
|
13155
13294
|
library,
|
|
13156
13295
|
...extraOptions.currentShare
|
|
13157
|
-
})
|
|
13158
|
-
|
|
13159
|
-
shareScope: 'default'
|
|
13160
|
-
}), (parentConfig.plugins || []).forEach((plugin)=>{
|
|
13296
|
+
});
|
|
13297
|
+
(parentConfig.plugins || []).forEach((plugin)=>{
|
|
13161
13298
|
void 0 !== plugin && 'string' != typeof plugin && ((plugin, excludedPlugins = [])=>{
|
|
13162
13299
|
if (!plugin) return !0;
|
|
13163
13300
|
let pluginName = plugin.name || plugin.constructor?.name;
|
|
@@ -13175,9 +13312,9 @@ class IndependentSharedPlugin {
|
|
|
13175
13312
|
}), plugins.forEach((plugin)=>{
|
|
13176
13313
|
finalPlugins.push(plugin);
|
|
13177
13314
|
}), finalPlugins.push(extraPlugin), finalPlugins.push(new ConsumeSharedPlugin({
|
|
13178
|
-
consumes: sharedOptions.filter(([key, options])=>extraOptions
|
|
13315
|
+
consumes: sharedOptions.filter(([key, options])=>extraOptions.currentShare.shareName !== (options.shareKey || key)).map(([key, options])=>({
|
|
13179
13316
|
[key]: {
|
|
13180
|
-
import: !
|
|
13317
|
+
import: !1,
|
|
13181
13318
|
shareKey: options.shareKey || key,
|
|
13182
13319
|
shareScope: options.shareScope,
|
|
13183
13320
|
requiredVersion: options.requiredVersion,
|
|
@@ -13188,9 +13325,10 @@ class IndependentSharedPlugin {
|
|
|
13188
13325
|
}
|
|
13189
13326
|
})),
|
|
13190
13327
|
enhanced: !0
|
|
13191
|
-
})), 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));
|
|
13192
13329
|
let fullOutputDir = external_node_path_resolve(parentCompiler.outputPath, outputDirWithShareName), compilerConfig = {
|
|
13193
13330
|
...parentConfig,
|
|
13331
|
+
name: parentConfig.name || 'mf-shared-compiler',
|
|
13194
13332
|
module: {
|
|
13195
13333
|
...parentConfig.module,
|
|
13196
13334
|
rules: [
|
|
@@ -13211,7 +13349,7 @@ class IndependentSharedPlugin {
|
|
|
13211
13349
|
entry: VirtualEntryPlugin.entry,
|
|
13212
13350
|
output: {
|
|
13213
13351
|
path: fullOutputDir,
|
|
13214
|
-
clean: !
|
|
13352
|
+
clean: !1,
|
|
13215
13353
|
publicPath: parentConfig.output?.publicPath || 'auto'
|
|
13216
13354
|
},
|
|
13217
13355
|
plugins: finalPlugins,
|
|
@@ -13221,15 +13359,14 @@ class IndependentSharedPlugin {
|
|
|
13221
13359
|
}
|
|
13222
13360
|
}, compiler = rspack.rspack(compilerConfig);
|
|
13223
13361
|
compiler.inputFileSystem = parentCompiler.inputFileSystem, compiler.outputFileSystem = parentCompiler.outputFileSystem, compiler.intermediateFileSystem = parentCompiler.intermediateFileSystem;
|
|
13224
|
-
let { currentShare } = extraOptions
|
|
13362
|
+
let { currentShare } = extraOptions;
|
|
13225
13363
|
return new Promise((resolve, reject)=>{
|
|
13226
13364
|
compiler.run((err, stats)=>{
|
|
13227
13365
|
if (err || stats?.hasErrors()) {
|
|
13228
|
-
|
|
13229
|
-
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`));
|
|
13230
13367
|
return;
|
|
13231
13368
|
}
|
|
13232
|
-
|
|
13369
|
+
console.log(`${currentShare.shareName} Compile success`), resolve(extraPlugin.getData());
|
|
13233
13370
|
});
|
|
13234
13371
|
});
|
|
13235
13372
|
}
|
|
@@ -13239,11 +13376,12 @@ class TreeShakingSharedPlugin {
|
|
|
13239
13376
|
mfConfig;
|
|
13240
13377
|
outputDir;
|
|
13241
13378
|
secondary;
|
|
13379
|
+
onBuildAssets;
|
|
13242
13380
|
_independentSharePlugin;
|
|
13243
13381
|
name = 'TreeShakingSharedPlugin';
|
|
13244
13382
|
constructor(options){
|
|
13245
|
-
let { mfConfig, secondary } = options;
|
|
13246
|
-
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;
|
|
13247
13385
|
}
|
|
13248
13386
|
apply(compiler) {
|
|
13249
13387
|
let { mfConfig, outputDir, secondary } = this, { name, shared, library, treeShakingSharedPlugins } = mfConfig;
|
|
@@ -13257,14 +13395,15 @@ class TreeShakingSharedPlugin {
|
|
|
13257
13395
|
treeShaking: secondary,
|
|
13258
13396
|
library,
|
|
13259
13397
|
manifest: mfConfig.manifest,
|
|
13260
|
-
treeShakingSharedExcludePlugins: mfConfig.treeShakingSharedExcludePlugins
|
|
13398
|
+
treeShakingSharedExcludePlugins: mfConfig.treeShakingSharedExcludePlugins,
|
|
13399
|
+
onBuildAssets: this.onBuildAssets
|
|
13261
13400
|
}), this._independentSharePlugin.apply(compiler));
|
|
13262
13401
|
}
|
|
13263
13402
|
get buildAssets() {
|
|
13264
13403
|
return this._independentSharePlugin?.buildAssets || {};
|
|
13265
13404
|
}
|
|
13266
13405
|
}
|
|
13267
|
-
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';
|
|
13268
13407
|
function getRemoteInfos(options) {
|
|
13269
13408
|
if (!options.remotes) return {};
|
|
13270
13409
|
let remoteType = options.remoteType || (options.library ? options.library.type : "script"), remotes = parseOptions(options.remotes, (item)=>({
|
|
@@ -13320,17 +13459,35 @@ function getRemoteInfos(options) {
|
|
|
13320
13459
|
}
|
|
13321
13460
|
return remoteInfos;
|
|
13322
13461
|
}
|
|
13323
|
-
function
|
|
13324
|
-
|
|
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);
|
|
13325
13478
|
for(let i = 0; i < runtimePlugins.length; i++){
|
|
13326
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;
|
|
13327
13480
|
runtimePluginImports.push(`import ${runtimePluginVar} from ${JSON.stringify(pluginPath)}`);
|
|
13328
13481
|
let paramsCode = void 0 === pluginParams ? 'undefined' : JSON.stringify(pluginParams);
|
|
13329
13482
|
runtimePluginVars.push(`{ plugin: ${runtimePluginVar}, params: ${paramsCode} }`);
|
|
13330
13483
|
}
|
|
13331
|
-
|
|
13484
|
+
return [
|
|
13332
13485
|
`import __module_federation_bundler_runtime__ from ${JSON.stringify(paths.bundlerRuntime)}`,
|
|
13333
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,
|
|
13334
13491
|
`const __module_federation_runtime_plugins__ = [${runtimePluginVars.join(', ')}].filter(({ plugin }) => plugin).map(({ plugin, params }) => plugin(params))`,
|
|
13335
13492
|
`const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
|
|
13336
13493
|
`const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
|
|
@@ -13339,7 +13496,9 @@ function getDefaultEntryRuntime(paths, options, compiler, treeShakingShareFallba
|
|
|
13339
13496
|
`const __module_federation_library_type__ = ${JSON.stringify(libraryType)}`,
|
|
13340
13497
|
compiler.rspack.Template.getFunctionContent(ModuleFederationPlugin_require('./moduleFederationDefaultRuntime.js').default)
|
|
13341
13498
|
].join(';');
|
|
13342
|
-
|
|
13499
|
+
}
|
|
13500
|
+
function getDefaultEntryRuntime(paths, options, compiler, treeShakingShareFallbacks) {
|
|
13501
|
+
return `${MF_RUNTIME_LOADER}!=!data:text/javascript,${encodeURIComponent(getDefaultEntryRuntimeSource(paths, options, compiler, treeShakingShareFallbacks))}`;
|
|
13343
13502
|
}
|
|
13344
13503
|
class ContainerPlugin extends RspackBuiltinPlugin {
|
|
13345
13504
|
name = binding_namespaceObject.BuiltinPluginName.ContainerPlugin;
|
|
@@ -13443,7 +13602,7 @@ async function transform(source, options) {
|
|
|
13443
13602
|
let _options = JSON.stringify(options || {});
|
|
13444
13603
|
return binding_default().transform(source, _options);
|
|
13445
13604
|
}
|
|
13446
|
-
let exports_rspackVersion = "2.0.
|
|
13605
|
+
let exports_rspackVersion = "2.0.7", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
|
|
13447
13606
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
13448
13607
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
13449
13608
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
|
@@ -13503,8 +13662,8 @@ let exports_rspackVersion = "2.0.6", exports_version = "5.75.0", exports_Webpack
|
|
|
13503
13662
|
this._options = _options;
|
|
13504
13663
|
}
|
|
13505
13664
|
apply(compiler) {
|
|
13506
|
-
var options;
|
|
13507
|
-
let { rspack } = compiler, paths = function(options, compiler) {
|
|
13665
|
+
var options, compiler1;
|
|
13666
|
+
let name, { rspack } = compiler, paths = function(options, compiler) {
|
|
13508
13667
|
let runtimeToolsPath;
|
|
13509
13668
|
if (options.implementation) runtimeToolsPath = options.implementation;
|
|
13510
13669
|
else try {
|
|
@@ -13536,17 +13695,18 @@ let exports_rspackVersion = "2.0.6", exports_version = "5.75.0", exports_Webpack
|
|
|
13536
13695
|
'@module-federation/runtime-tools': paths.runtimeTools,
|
|
13537
13696
|
'@module-federation/runtime': paths.runtime,
|
|
13538
13697
|
...compiler.options.resolve.alias
|
|
13539
|
-
}
|
|
13540
|
-
|
|
13541
|
-
|
|
13542
|
-
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13546
|
-
|
|
13547
|
-
|
|
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({
|
|
13548
13707
|
mfConfig: this._options,
|
|
13549
|
-
secondary: !1
|
|
13708
|
+
secondary: !1,
|
|
13709
|
+
onBuildAssets: updateRuntimeShareFallbacks
|
|
13550
13710
|
}), this._treeShakingSharedPlugin.apply(compiler));
|
|
13551
13711
|
let runtimeExperiments = {
|
|
13552
13712
|
asyncStartup: this._options.experiments?.asyncStartup ?? !1
|
|
@@ -13556,7 +13716,7 @@ let exports_rspackVersion = "2.0.6", exports_version = "5.75.0", exports_Webpack
|
|
|
13556
13716
|
stage: 100
|
|
13557
13717
|
}, ()=>{
|
|
13558
13718
|
runtimePluginApplied || (runtimePluginApplied = !0, new ModuleFederationRuntimePlugin({
|
|
13559
|
-
entryRuntime: getDefaultEntryRuntime(paths, this._options, compiler
|
|
13719
|
+
entryRuntime: runtimeVirtualPath ? getDefaultEntryRuntimeRequest(runtimeVirtualPath) : getDefaultEntryRuntime(paths, this._options, compiler),
|
|
13560
13720
|
experiments: runtimeExperiments
|
|
13561
13721
|
}).apply(compiler));
|
|
13562
13722
|
}), compiler.hooks.watchRun.tap({
|
|
@@ -13564,7 +13724,7 @@ let exports_rspackVersion = "2.0.6", exports_version = "5.75.0", exports_Webpack
|
|
|
13564
13724
|
stage: 100
|
|
13565
13725
|
}, ()=>{
|
|
13566
13726
|
runtimePluginApplied || (runtimePluginApplied = !0, new ModuleFederationRuntimePlugin({
|
|
13567
|
-
entryRuntime: getDefaultEntryRuntime(paths, this._options, compiler
|
|
13727
|
+
entryRuntime: runtimeVirtualPath ? getDefaultEntryRuntimeRequest(runtimeVirtualPath) : getDefaultEntryRuntime(paths, this._options, compiler),
|
|
13568
13728
|
experiments: runtimeExperiments
|
|
13569
13729
|
}).apply(compiler));
|
|
13570
13730
|
});
|
|
@@ -13657,6 +13817,9 @@ let exports_rspackVersion = "2.0.6", exports_version = "5.75.0", exports_Webpack
|
|
|
13657
13817
|
return base_create(name, resolve, affectedHooks);
|
|
13658
13818
|
},
|
|
13659
13819
|
VirtualModulesPlugin: VirtualModulesPlugin,
|
|
13820
|
+
ids: {
|
|
13821
|
+
SyncModuleIdsPlugin: SyncModuleIdsPlugin
|
|
13822
|
+
},
|
|
13660
13823
|
rsc: {
|
|
13661
13824
|
createPlugins: ()=>{
|
|
13662
13825
|
let coordinator = new Coordinator();
|
|
@@ -13688,4 +13851,4 @@ src_fn.rspack = src_fn, src_fn.webpack = src_fn;
|
|
|
13688
13851
|
let src_rspack_0 = src_fn;
|
|
13689
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;
|
|
13690
13853
|
export default src_rspack_0;
|
|
13691
|
-
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 };
|