@module-federation/rspack 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RemoteEntryPlugin.cjs.js +70 -0
- package/dist/RemoteEntryPlugin.cjs.js.map +1 -0
- package/dist/RemoteEntryPlugin.esm.mjs +67 -0
- package/dist/RemoteEntryPlugin.esm.mjs.map +1 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +2 -2
- package/dist/index.esm.mjs.map +1 -1
- package/dist/plugin.cjs.js +176 -270
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.esm.mjs +177 -271
- package/dist/plugin.esm.mjs.map +1 -1
- package/dist/remote-entry-plugin.cjs.js +4 -91
- package/dist/remote-entry-plugin.cjs.js.map +1 -1
- package/dist/remote-entry-plugin.esm.mjs +3 -94
- package/dist/remote-entry-plugin.esm.mjs.map +1 -1
- package/dist/src/logger.d.ts +2 -1
- package/package.json +8 -8
package/dist/plugin.cjs.js
CHANGED
|
@@ -7,293 +7,199 @@ var dtsPlugin = require('@module-federation/dts-plugin');
|
|
|
7
7
|
var ReactBridgePlugin = require('@module-federation/bridge-react-webpack-plugin');
|
|
8
8
|
var path = require('node:path');
|
|
9
9
|
var fs = require('node:fs');
|
|
10
|
-
var remoteEntryPlugin = require('./
|
|
10
|
+
var remoteEntryPlugin = require('./RemoteEntryPlugin.cjs.js');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
for(var i = 0; i < props.length; i++){
|
|
19
|
-
var descriptor = props[i];
|
|
20
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
21
|
-
descriptor.configurable = true;
|
|
22
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
23
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
27
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
28
|
-
return Constructor;
|
|
29
|
-
}
|
|
30
|
-
function _define_property(obj, key, value) {
|
|
31
|
-
if (key in obj) {
|
|
32
|
-
Object.defineProperty(obj, key, {
|
|
33
|
-
value: value,
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true,
|
|
36
|
-
writable: true
|
|
37
|
-
});
|
|
38
|
-
} else {
|
|
39
|
-
obj[key] = value;
|
|
40
|
-
}
|
|
41
|
-
return obj;
|
|
42
|
-
}
|
|
43
|
-
function _instanceof(left, right) {
|
|
44
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
45
|
-
return !!right[Symbol.hasInstance](left);
|
|
46
|
-
} else {
|
|
47
|
-
return left instanceof right;
|
|
12
|
+
const RuntimeToolsPath = require.resolve('@module-federation/runtime-tools');
|
|
13
|
+
const PLUGIN_NAME = 'RspackModuleFederationPlugin';
|
|
14
|
+
class ModuleFederationPlugin {
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this.name = PLUGIN_NAME;
|
|
17
|
+
this._options = options;
|
|
48
18
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
55
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
56
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
57
|
-
}));
|
|
19
|
+
_patchBundlerConfig(compiler) {
|
|
20
|
+
const { name, experiments } = this._options;
|
|
21
|
+
const definePluginOptions = {};
|
|
22
|
+
if (name) {
|
|
23
|
+
definePluginOptions['FEDERATION_BUILD_IDENTIFIER'] = JSON.stringify(sdk.composeKeyWithSeparator(name, managers.utils.getBuildVersion()));
|
|
58
24
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
25
|
+
// Add FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN
|
|
26
|
+
const disableSnapshot = experiments?.optimization?.disableSnapshot ?? false;
|
|
27
|
+
definePluginOptions['FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN'] =
|
|
28
|
+
disableSnapshot;
|
|
29
|
+
// Determine ENV_TARGET: only if manually specified in experiments.optimization.target
|
|
30
|
+
if (experiments?.optimization &&
|
|
31
|
+
typeof experiments.optimization === 'object' &&
|
|
32
|
+
experiments.optimization !== null &&
|
|
33
|
+
'target' in experiments.optimization) {
|
|
34
|
+
const manualTarget = experiments.optimization.target;
|
|
35
|
+
// Ensure the target is one of the expected values before setting
|
|
36
|
+
if (manualTarget === 'web' || manualTarget === 'node') {
|
|
37
|
+
definePluginOptions['ENV_TARGET'] = JSON.stringify(manualTarget);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// No inference for ENV_TARGET. If not manually set and valid, it's not defined.
|
|
41
|
+
new compiler.webpack.DefinePlugin(definePluginOptions).apply(compiler);
|
|
70
42
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
43
|
+
_checkSingleton(compiler) {
|
|
44
|
+
let count = 0;
|
|
45
|
+
compiler.options.plugins.forEach((p) => {
|
|
46
|
+
if (typeof p !== 'object' || !p) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (p['name'] === this.name) {
|
|
50
|
+
count++;
|
|
51
|
+
if (count > 1) {
|
|
52
|
+
throw new Error(`Detect duplicate register ${this.name},please ensure ${this.name} is singleton!`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
80
55
|
});
|
|
81
56
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
57
|
+
apply(compiler) {
|
|
58
|
+
sdk.bindLoggerToCompiler(remoteEntryPlugin.logger, compiler, PLUGIN_NAME);
|
|
59
|
+
const { _options: options } = this;
|
|
60
|
+
if (!options.name) {
|
|
61
|
+
throw new Error('[ ModuleFederationPlugin ]: name is required');
|
|
62
|
+
}
|
|
63
|
+
this._checkSingleton(compiler);
|
|
64
|
+
this._patchBundlerConfig(compiler);
|
|
65
|
+
const containerManager = new managers.ContainerManager();
|
|
66
|
+
containerManager.init(options);
|
|
67
|
+
if (containerManager.enable) {
|
|
68
|
+
this._patchChunkSplit(compiler, options.name);
|
|
69
|
+
}
|
|
70
|
+
// must before ModuleFederationPlugin
|
|
71
|
+
new remoteEntryPlugin.RemoteEntryPlugin(options).apply(compiler);
|
|
72
|
+
if (options.experiments?.provideExternalRuntime) {
|
|
73
|
+
if (options.exposes) {
|
|
74
|
+
throw new Error('You can only set provideExternalRuntime: true in pure consumer which not expose modules.');
|
|
75
|
+
}
|
|
76
|
+
const runtimePlugins = options.runtimePlugins || [];
|
|
77
|
+
options.runtimePlugins = runtimePlugins.concat(require.resolve('@module-federation/inject-external-runtime-core-plugin'));
|
|
78
|
+
}
|
|
79
|
+
if (options.experiments?.externalRuntime === true) {
|
|
80
|
+
const Externals = compiler.webpack.ExternalsPlugin;
|
|
81
|
+
new Externals(compiler.options.externalsType || 'global', {
|
|
82
|
+
'@module-federation/runtime-core': '_FEDERATION_RUNTIME_CORE',
|
|
83
|
+
}).apply(compiler);
|
|
84
|
+
}
|
|
85
|
+
options.implementation = options.implementation || RuntimeToolsPath;
|
|
86
|
+
let disableManifest = options.manifest === false;
|
|
87
|
+
let disableDts = options.dts === false;
|
|
88
|
+
if (!disableDts) {
|
|
89
|
+
const dtsPlugin$1 = new dtsPlugin.DtsPlugin(options);
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
dtsPlugin$1.apply(compiler);
|
|
92
|
+
dtsPlugin$1.addRuntimePlugins();
|
|
93
|
+
}
|
|
94
|
+
if (!disableManifest && options.exposes) {
|
|
95
|
+
try {
|
|
96
|
+
options.exposes = containerManager.containerPluginExposesOptions;
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
if (err instanceof Error) {
|
|
100
|
+
err.message = `[ ModuleFederationPlugin ]: Manifest will not generate, because: ${err.message}`;
|
|
117
101
|
}
|
|
118
|
-
|
|
119
|
-
|
|
102
|
+
remoteEntryPlugin.logger.warn(err);
|
|
103
|
+
disableManifest = true;
|
|
120
104
|
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
105
|
+
}
|
|
106
|
+
new compiler.webpack.container.ModuleFederationPlugin(options).apply(compiler);
|
|
107
|
+
const runtimeESMPath = require.resolve('@module-federation/runtime/dist/index.esm.js', { paths: [options.implementation] });
|
|
108
|
+
compiler.hooks.afterPlugins.tap('PatchAliasWebpackPlugin', () => {
|
|
109
|
+
compiler.options.resolve.alias = {
|
|
110
|
+
...compiler.options.resolve.alias,
|
|
111
|
+
'@module-federation/runtime$': runtimeESMPath,
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
if (!disableManifest) {
|
|
115
|
+
this._statsPlugin = new manifest.StatsPlugin(options, {
|
|
116
|
+
pluginVersion: "0.20.0",
|
|
117
|
+
bundler: 'rspack',
|
|
118
|
+
});
|
|
119
|
+
// @ts-ignore
|
|
120
|
+
this._statsPlugin.apply(compiler);
|
|
121
|
+
}
|
|
122
|
+
// react bridge plugin
|
|
123
|
+
const nodeModulesPath = path.resolve(compiler.context, 'node_modules');
|
|
124
|
+
const reactPath = path.join(nodeModulesPath, '@module-federation/bridge-react');
|
|
125
|
+
// Check whether react exists
|
|
126
|
+
if (fs.existsSync(reactPath) &&
|
|
127
|
+
(!options?.bridge || !options.bridge.disableAlias)) {
|
|
128
|
+
new ReactBridgePlugin({
|
|
129
|
+
moduleFederationOptions: this._options,
|
|
130
|
+
}).apply(compiler);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
_patchChunkSplit(compiler, name) {
|
|
134
|
+
const { splitChunks } = compiler.options.optimization;
|
|
135
|
+
const patchChunkSplit = (cacheGroup) => {
|
|
136
|
+
switch (typeof cacheGroup) {
|
|
137
|
+
case 'boolean':
|
|
138
|
+
case 'string':
|
|
139
|
+
case 'function':
|
|
140
|
+
break;
|
|
141
|
+
// cacheGroup.chunks will inherit splitChunks.chunks, so you only need to modify the chunks that are set separately
|
|
142
|
+
case 'object': {
|
|
143
|
+
if (cacheGroup instanceof RegExp) {
|
|
144
|
+
break;
|
|
130
145
|
}
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
if (count > 1) {
|
|
134
|
-
throw new Error("Detect duplicate register ".concat(_this.name, ",please ensure ").concat(_this.name, " is singleton!"));
|
|
135
|
-
}
|
|
146
|
+
if (!cacheGroup.chunks) {
|
|
147
|
+
break;
|
|
136
148
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
this._checkSingleton(compiler);
|
|
149
|
-
this._patchBundlerConfig(compiler);
|
|
150
|
-
var containerManager = new managers.ContainerManager();
|
|
151
|
-
containerManager.init(options);
|
|
152
|
-
if (containerManager.enable) {
|
|
153
|
-
this._patchChunkSplit(compiler, options.name);
|
|
154
|
-
}
|
|
155
|
-
// must before ModuleFederationPlugin
|
|
156
|
-
new remoteEntryPlugin.RemoteEntryPlugin(options).apply(compiler);
|
|
157
|
-
if ((_options_experiments = options.experiments) === null || _options_experiments === void 0 ? void 0 : _options_experiments.provideExternalRuntime) {
|
|
158
|
-
if (options.exposes) {
|
|
159
|
-
throw new Error('You can only set provideExternalRuntime: true in pure consumer which not expose modules.');
|
|
149
|
+
if (typeof cacheGroup.chunks === 'function') {
|
|
150
|
+
const prevChunks = cacheGroup.chunks;
|
|
151
|
+
cacheGroup.chunks = (chunk) => {
|
|
152
|
+
if (chunk.name &&
|
|
153
|
+
(chunk.name === name || chunk.name === name + '_partial')) {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
return prevChunks(chunk);
|
|
157
|
+
};
|
|
158
|
+
break;
|
|
160
159
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
options.implementation = options.implementation || RuntimeToolsPath;
|
|
171
|
-
var disableManifest = options.manifest === false;
|
|
172
|
-
var disableDts = options.dts === false;
|
|
173
|
-
if (!disableDts) {
|
|
174
|
-
var dtsPlugin$1 = new dtsPlugin.DtsPlugin(options);
|
|
175
|
-
// @ts-ignore
|
|
176
|
-
dtsPlugin$1.apply(compiler);
|
|
177
|
-
dtsPlugin$1.addRuntimePlugins();
|
|
178
|
-
}
|
|
179
|
-
if (!disableManifest && options.exposes) {
|
|
180
|
-
try {
|
|
181
|
-
options.exposes = containerManager.containerPluginExposesOptions;
|
|
182
|
-
} catch (err) {
|
|
183
|
-
if (_instanceof(err, Error)) {
|
|
184
|
-
err.message = "[ ModuleFederationPlugin ]: Manifest will not generate, because: ".concat(err.message);
|
|
185
|
-
}
|
|
186
|
-
console.warn(err);
|
|
187
|
-
disableManifest = true;
|
|
160
|
+
if (cacheGroup.chunks === 'all') {
|
|
161
|
+
cacheGroup.chunks = (chunk) => {
|
|
162
|
+
if (chunk.name &&
|
|
163
|
+
(chunk.name === name || chunk.name === name + '_partial')) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
return true;
|
|
167
|
+
};
|
|
168
|
+
break;
|
|
188
169
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
]
|
|
195
|
-
});
|
|
196
|
-
compiler.hooks.afterPlugins.tap('PatchAliasWebpackPlugin', function() {
|
|
197
|
-
compiler.options.resolve.alias = _object_spread_props(_object_spread({}, compiler.options.resolve.alias), {
|
|
198
|
-
'@module-federation/runtime$': runtimeESMPath
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
if (!disableManifest) {
|
|
202
|
-
this._statsPlugin = new manifest.StatsPlugin(options, {
|
|
203
|
-
pluginVersion: "0.19.0",
|
|
204
|
-
bundler: 'rspack'
|
|
205
|
-
});
|
|
206
|
-
// @ts-ignore
|
|
207
|
-
this._statsPlugin.apply(compiler);
|
|
208
|
-
}
|
|
209
|
-
// react bridge plugin
|
|
210
|
-
var nodeModulesPath = path.resolve(compiler.context, 'node_modules');
|
|
211
|
-
var reactPath = path.join(nodeModulesPath, '@module-federation/bridge-react');
|
|
212
|
-
// Check whether react exists
|
|
213
|
-
if (fs.existsSync(reactPath) && (!(options === null || options === void 0 ? void 0 : options.bridge) || !options.bridge.disableAlias)) {
|
|
214
|
-
new ReactBridgePlugin({
|
|
215
|
-
moduleFederationOptions: this._options
|
|
216
|
-
}).apply(compiler);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
key: "_patchChunkSplit",
|
|
222
|
-
value: function _patchChunkSplit(compiler, name) {
|
|
223
|
-
var splitChunks = compiler.options.optimization.splitChunks;
|
|
224
|
-
var patchChunkSplit = function(cacheGroup) {
|
|
225
|
-
switch(typeof cacheGroup === "undefined" ? "undefined" : _type_of(cacheGroup)){
|
|
226
|
-
case 'boolean':
|
|
227
|
-
case 'string':
|
|
228
|
-
case 'function':
|
|
229
|
-
break;
|
|
230
|
-
// cacheGroup.chunks will inherit splitChunks.chunks, so you only need to modify the chunks that are set separately
|
|
231
|
-
case 'object':
|
|
232
|
-
{
|
|
233
|
-
if (_instanceof(cacheGroup, RegExp)) {
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
if (!cacheGroup.chunks) {
|
|
237
|
-
break;
|
|
238
|
-
}
|
|
239
|
-
if (typeof cacheGroup.chunks === 'function') {
|
|
240
|
-
var prevChunks = cacheGroup.chunks;
|
|
241
|
-
cacheGroup.chunks = function(chunk) {
|
|
242
|
-
if (chunk.name && (chunk.name === name || chunk.name === name + '_partial')) {
|
|
243
|
-
return false;
|
|
244
|
-
}
|
|
245
|
-
return prevChunks(chunk);
|
|
246
|
-
};
|
|
247
|
-
break;
|
|
248
|
-
}
|
|
249
|
-
if (cacheGroup.chunks === 'all') {
|
|
250
|
-
cacheGroup.chunks = function(chunk) {
|
|
251
|
-
if (chunk.name && (chunk.name === name || chunk.name === name + '_partial')) {
|
|
252
|
-
return false;
|
|
253
|
-
}
|
|
254
|
-
return true;
|
|
255
|
-
};
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
if (cacheGroup.chunks === 'initial') {
|
|
259
|
-
cacheGroup.chunks = function(chunk) {
|
|
260
|
-
if (chunk.name && (chunk.name === name || chunk.name === name + '_partial')) {
|
|
261
|
-
return false;
|
|
262
|
-
}
|
|
263
|
-
return chunk.isOnlyInitial();
|
|
264
|
-
};
|
|
265
|
-
break;
|
|
266
|
-
}
|
|
267
|
-
break;
|
|
170
|
+
if (cacheGroup.chunks === 'initial') {
|
|
171
|
+
cacheGroup.chunks = (chunk) => {
|
|
172
|
+
if (chunk.name &&
|
|
173
|
+
(chunk.name === name || chunk.name === name + '_partial')) {
|
|
174
|
+
return false;
|
|
268
175
|
}
|
|
176
|
+
return chunk.isOnlyInitial();
|
|
177
|
+
};
|
|
178
|
+
break;
|
|
269
179
|
}
|
|
270
|
-
|
|
271
|
-
if (!splitChunks) {
|
|
272
|
-
return;
|
|
180
|
+
break;
|
|
273
181
|
}
|
|
274
|
-
// 修改 splitChunk.chunks
|
|
275
|
-
patchChunkSplit(splitChunks);
|
|
276
|
-
var cacheGroups = splitChunks.cacheGroups;
|
|
277
|
-
if (!cacheGroups) {
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
// 修改 splitChunk.cacheGroups[key].chunks
|
|
281
|
-
Object.keys(cacheGroups).forEach(function(cacheGroupKey) {
|
|
282
|
-
patchChunkSplit(cacheGroups[cacheGroupKey]);
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
key: "statsResourceInfo",
|
|
288
|
-
get: function get() {
|
|
289
|
-
var _this__statsPlugin;
|
|
290
|
-
return (_this__statsPlugin = this._statsPlugin) === null || _this__statsPlugin === void 0 ? void 0 : _this__statsPlugin.resourceInfo;
|
|
291
182
|
}
|
|
183
|
+
};
|
|
184
|
+
if (!splitChunks) {
|
|
185
|
+
return;
|
|
292
186
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
|
|
187
|
+
// 修改 splitChunk.chunks
|
|
188
|
+
patchChunkSplit(splitChunks);
|
|
189
|
+
const { cacheGroups } = splitChunks;
|
|
190
|
+
if (!cacheGroups) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// 修改 splitChunk.cacheGroups[key].chunks
|
|
194
|
+
Object.keys(cacheGroups).forEach((cacheGroupKey) => {
|
|
195
|
+
patchChunkSplit(cacheGroups[cacheGroupKey]);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
get statsResourceInfo() {
|
|
199
|
+
return this._statsPlugin?.resourceInfo;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const GetPublicPathPlugin = remoteEntryPlugin.RemoteEntryPlugin;
|
|
297
203
|
|
|
298
204
|
exports.GetPublicPathPlugin = GetPublicPathPlugin;
|
|
299
205
|
exports.ModuleFederationPlugin = ModuleFederationPlugin;
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["../../src/ModuleFederationPlugin.ts"],"sourcesContent":[null],"names":["composeKeyWithSeparator","utils","bindLoggerToCompiler","logger","ContainerManager","RemoteEntryPlugin","dtsPlugin","DtsPlugin","StatsPlugin"],"mappings":";;;;;;;;;;;AA8BA,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,kCAAkC,CAAC;AAErE,MAAM,WAAW,GAAG;MACd,sBAAsB,CAAA;AAKjC,IAAA,WAAA,CAAY,OAA6D,EAAA;QAJhE,IAAI,CAAA,IAAA,GAAG,WAAW;AAKzB,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO;;AAGjB,IAAA,mBAAmB,CAAC,QAAkB,EAAA;QAC5C,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,QAAQ;QAC3C,MAAM,mBAAmB,GAAqC,EAAE;QAChE,IAAI,IAAI,EAAE;AACR,YAAA,mBAAmB,CAAC,6BAA6B,CAAC,GAAG,IAAI,CAAC,SAAS,CACjEA,2BAAuB,CAAC,IAAI,EAAEC,cAAK,CAAC,eAAe,EAAE,CAAC,CACvD;;;QAGH,MAAM,eAAe,GAAG,WAAW,EAAE,YAAY,EAAE,eAAe,IAAI,KAAK;QAC3E,mBAAmB,CAAC,wCAAwC,CAAC;AAC3D,YAAA,eAAe;;QAGjB,IACE,WAAW,EAAE,YAAY;AACzB,YAAA,OAAO,WAAW,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