@module-federation/node 2.1.3 → 2.1.5
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/package.json +5 -5
- package/dist/jest.config.d.ts +0 -11
- package/dist/jest.config.js +0 -19
- package/dist/jest.config.js.map +0 -1
- package/dist/package.json +0 -95
- package/dist/src/filesystem/stratagies.d.ts +0 -18
- package/dist/src/filesystem/stratagies.js +0 -117
- package/dist/src/filesystem/stratagies.js.map +0 -1
- package/dist/src/index.d.ts +0 -5
- package/dist/src/index.js +0 -17
- package/dist/src/index.js.map +0 -1
- package/dist/src/plugins/AutomaticPublicPathPlugin.d.ts +0 -9
- package/dist/src/plugins/AutomaticPublicPathPlugin.js +0 -38
- package/dist/src/plugins/AutomaticPublicPathPlugin.js.map +0 -1
- package/dist/src/plugins/ChunkCorrelationPlugin.d.ts +0 -61
- package/dist/src/plugins/ChunkCorrelationPlugin.js +0 -442
- package/dist/src/plugins/ChunkCorrelationPlugin.js.map +0 -1
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.d.ts +0 -17
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.js +0 -121
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.js.map +0 -1
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.d.ts +0 -39
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js +0 -119
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js.map +0 -1
- package/dist/src/plugins/EntryChunkTrackerPlugin.d.ts +0 -13
- package/dist/src/plugins/EntryChunkTrackerPlugin.js +0 -41
- package/dist/src/plugins/EntryChunkTrackerPlugin.js.map +0 -1
- package/dist/src/plugins/NodeFederationPlugin.d.ts +0 -46
- package/dist/src/plugins/NodeFederationPlugin.js +0 -81
- package/dist/src/plugins/NodeFederationPlugin.js.map +0 -1
- package/dist/src/plugins/RemotePublicPathRuntimeModule.d.ts +0 -10
- package/dist/src/plugins/RemotePublicPathRuntimeModule.js +0 -132
- package/dist/src/plugins/RemotePublicPathRuntimeModule.js.map +0 -1
- package/dist/src/plugins/StreamingTargetPlugin.d.ts +0 -28
- package/dist/src/plugins/StreamingTargetPlugin.js +0 -59
- package/dist/src/plugins/StreamingTargetPlugin.js.map +0 -1
- package/dist/src/plugins/UniversalFederationPlugin.d.ts +0 -43
- package/dist/src/plugins/UniversalFederationPlugin.js +0 -53
- package/dist/src/plugins/UniversalFederationPlugin.js.map +0 -1
- package/dist/src/plugins/webpackChunkUtilities.d.ts +0 -50
- package/dist/src/plugins/webpackChunkUtilities.js +0 -305
- package/dist/src/plugins/webpackChunkUtilities.js.map +0 -1
- package/dist/src/types/index.d.ts +0 -3
- package/dist/src/types/index.js +0 -3
- package/dist/src/types/index.js.map +0 -1
- package/dist/src/utils/flush-chunks.d.ts +0 -11
- package/dist/src/utils/flush-chunks.js +0 -172
- package/dist/src/utils/flush-chunks.js.map +0 -1
- package/dist/src/utils/hot-reload.d.ts +0 -7
- package/dist/src/utils/hot-reload.js +0 -184
- package/dist/src/utils/hot-reload.js.map +0 -1
- package/dist/src/utils/index.d.ts +0 -2
- package/dist/src/utils/index.js +0 -19
- package/dist/src/utils/index.js.map +0 -1
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const PLUGIN_NAME = 'FederationStatsPlugin';
|
|
3
|
-
/** @typedef {import("./webpack-stats-types").WebpackStats} WebpackStats */
|
|
4
|
-
/** @typedef {import( "./webpack-stats-types").WebpackStatsChunk} WebpackStatsChunk */
|
|
5
|
-
/** @typedef {import("./webpack-stats-types").WebpackStatsModule} WebpackStatsModule */
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {object} SharedDependency
|
|
8
|
-
* @property {string} shareScope
|
|
9
|
-
* @property {string} shareKey
|
|
10
|
-
* @property {string} requiredVersion
|
|
11
|
-
* @property {boolean} strictVersion
|
|
12
|
-
* @property {boolean} singleton
|
|
13
|
-
* @property {boolean} eager
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* @typedef {object} SharedModule
|
|
17
|
-
* @property {string[]} chunks
|
|
18
|
-
* @property {SharedDependency[]} provides
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* @typedef {object} Exposed
|
|
22
|
-
* @property {string[]} chunks
|
|
23
|
-
* @property {SharedModule[]} sharedModules
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* @typedef {object} FederatedContainer
|
|
27
|
-
* @property {string} remote
|
|
28
|
-
* @property {string} entry
|
|
29
|
-
* @property {SharedModule[]} sharedModules
|
|
30
|
-
* @property {{ [key: string]: Exposed }} exposes
|
|
31
|
-
*/
|
|
32
|
-
/**
|
|
33
|
-
* @typedef {object} FederatedStats
|
|
34
|
-
* @property {SharedModule[]} sharedModules
|
|
35
|
-
* @property {FederatedContainer[]} federatedModules
|
|
36
|
-
*/
|
|
37
|
-
const concat = (x, y) => x.concat(y);
|
|
38
|
-
const flatMap = (xs, f) => xs.map(f).reduce(concat, []);
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* @param {WebpackStats} stats
|
|
42
|
-
* @returns {}
|
|
43
|
-
*/
|
|
44
|
-
function getRemoteModules(stats) {
|
|
45
|
-
return stats.modules
|
|
46
|
-
.filter((mod) => mod.moduleType === 'remote-module')
|
|
47
|
-
.reduce((acc, remoteModule) => {
|
|
48
|
-
acc[remoteModule.nameForCondition] = remoteModule.id;
|
|
49
|
-
return acc;
|
|
50
|
-
}, {});
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
* @param {WebpackStats} stats
|
|
55
|
-
* @param {string} exposedFile
|
|
56
|
-
* @returns {WebpackStatsModule[]}
|
|
57
|
-
*/
|
|
58
|
-
function getExposedModules(stats, exposedFile) {
|
|
59
|
-
return stats.modules.filter((mod) => mod.name?.startsWith(exposedFile));
|
|
60
|
-
}
|
|
61
|
-
//eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62
|
-
function getDependenciesOfChunk(stats, chunk) {
|
|
63
|
-
return stats.chunks
|
|
64
|
-
.filter((c) => c.children.includes(chunk.id))
|
|
65
|
-
.reduce((acc, c) => {
|
|
66
|
-
return acc.concat(c.modules);
|
|
67
|
-
}, []);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* @param {WebpackStats} stats
|
|
72
|
-
* @param {WebpackStatsModule} mod
|
|
73
|
-
* @returns {Exposed}
|
|
74
|
-
*/
|
|
75
|
-
function getExposed(stats, mod) {
|
|
76
|
-
const chunks = stats.chunks.filter((chunk) => {
|
|
77
|
-
return chunk.modules.find((modsInChunk) => {
|
|
78
|
-
return modsInChunk.id === mod.id && !modsInChunk.dependent;
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
const dependencies = stats.modules
|
|
82
|
-
.filter((sharedModule) => {
|
|
83
|
-
if (sharedModule.moduleType !== 'consume-shared-module') {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
return sharedModule.issuerId === mod.id;
|
|
87
|
-
})
|
|
88
|
-
.map((sharedModule) => {
|
|
89
|
-
return sharedModule.identifier.split('|')[2];
|
|
90
|
-
});
|
|
91
|
-
const flatChunks = flatMap(chunks, (chunk) => ({
|
|
92
|
-
[chunk.id]: {
|
|
93
|
-
files: chunk.files.map((f) => `${stats.publicPath === 'auto' ? '' : stats.publicPath || ''}${f}`),
|
|
94
|
-
requiredModules: dependencies,
|
|
95
|
-
},
|
|
96
|
-
}));
|
|
97
|
-
return flatChunks.reduce((acc, chunk) => {
|
|
98
|
-
Object.assign(acc, chunk);
|
|
99
|
-
return acc;
|
|
100
|
-
}, {});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
*
|
|
104
|
-
* @param {import("webpack").Module} mod
|
|
105
|
-
* @param {(issuer: string) => boolean} check
|
|
106
|
-
* @returns {boolean}
|
|
107
|
-
*/
|
|
108
|
-
function searchIssuer(mod, check) {
|
|
109
|
-
if (mod.issuer && check(mod.issuer)) {
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
return !!mod.modules && mod.modules.some((m) => searchIssuer(m, check));
|
|
113
|
-
}
|
|
114
|
-
function searchReason(mod, check) {
|
|
115
|
-
if (mod.reasons && check(mod.reasons)) {
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
return !!mod.reasons && mod.reasons.some((m) => searchReason(m, check));
|
|
119
|
-
}
|
|
120
|
-
function searchIssuerAndReason(mod, check) {
|
|
121
|
-
const foundIssuer = searchIssuer(mod, (issuer) => check(issuer));
|
|
122
|
-
if (foundIssuer) {
|
|
123
|
-
return foundIssuer;
|
|
124
|
-
}
|
|
125
|
-
return searchReason(mod, (reason) => reason.some((r) => check(r?.moduleIdentifier)));
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* @param {import("webpack").Module} mod
|
|
129
|
-
* @param {(issuer: string) => boolean} check
|
|
130
|
-
* @returns {string[]}
|
|
131
|
-
*/
|
|
132
|
-
function getIssuers(mod, check) {
|
|
133
|
-
if (mod.issuer && check(mod.issuer)) {
|
|
134
|
-
return [mod.issuer];
|
|
135
|
-
}
|
|
136
|
-
return ((mod.modules &&
|
|
137
|
-
mod.modules.filter((m) => searchIssuer(m, check)).map((m) => m.issuer)) ||
|
|
138
|
-
[]);
|
|
139
|
-
}
|
|
140
|
-
function getIssuersAndReasons(mod, check) {
|
|
141
|
-
if (mod.issuer && check(mod.issuer)) {
|
|
142
|
-
return [mod.issuer];
|
|
143
|
-
}
|
|
144
|
-
if (mod.reasons &&
|
|
145
|
-
searchReason(mod, (reason) => reason.some((r) => check(r?.moduleIdentifier)))) {
|
|
146
|
-
return mod.reasons
|
|
147
|
-
.filter((r) => {
|
|
148
|
-
return r.moduleIdentifier && check(r.moduleIdentifier);
|
|
149
|
-
})
|
|
150
|
-
.map((r) => r.moduleIdentifier);
|
|
151
|
-
}
|
|
152
|
-
return ((mod.modules &&
|
|
153
|
-
mod.modules
|
|
154
|
-
.filter((m) => searchIssuerAndReason(m, check))
|
|
155
|
-
.map((m) => {
|
|
156
|
-
return (m.issuer ||
|
|
157
|
-
m.reasons.find((r) => check(r?.moduleIdentifier)).moduleIdentifier);
|
|
158
|
-
})) ||
|
|
159
|
-
[]);
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* @param {string} issuer
|
|
163
|
-
* @returns {SharedDependency}
|
|
164
|
-
*/
|
|
165
|
-
function parseFederatedIssuer(issuer) {
|
|
166
|
-
const split = issuer?.split('|') || [];
|
|
167
|
-
if (split.length !== 8 || split[0] !== 'consume-shared-module') {
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
const [, shareScope, shareKey, requiredVersion, strictVersion, , singleton, eager,] = split;
|
|
171
|
-
return {
|
|
172
|
-
shareScope,
|
|
173
|
-
shareKey,
|
|
174
|
-
requiredVersion,
|
|
175
|
-
strictVersion: JSON.parse(strictVersion),
|
|
176
|
-
singleton: JSON.parse(singleton),
|
|
177
|
-
eager: JSON.parse(eager),
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
*
|
|
182
|
-
* @param {WebpackStats} stats
|
|
183
|
-
* @param {import("webpack").container.ModuleFederationPlugin} federationPlugin
|
|
184
|
-
* @returns {SharedModule[]}
|
|
185
|
-
*/
|
|
186
|
-
function getSharedModules(stats, federationPlugin) {
|
|
187
|
-
return flatMap(stats.chunks.filter((chunk) => {
|
|
188
|
-
if (!stats.entrypoints[federationPlugin.name]) {
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
return stats.entrypoints[federationPlugin.name].chunks.some((id) => chunk.id === id);
|
|
192
|
-
}), (chunk) => flatMap(chunk.children, (id) => stats.chunks.filter((c) => c.id === id &&
|
|
193
|
-
c.files.length > 0 &&
|
|
194
|
-
c.parents.some((p) => stats.entrypoints[federationPlugin.name].chunks.some((c) => c === p)) &&
|
|
195
|
-
c.modules.some((m) => searchIssuer(m, (issuer) => issuer?.startsWith('consume-shared-module'))))))
|
|
196
|
-
.map((chunk) => ({
|
|
197
|
-
chunks: chunk.files.map((f) => `${stats.publicPath === 'auto' ? '' : stats.publicPath || ''}${f}`),
|
|
198
|
-
provides: flatMap(chunk.modules.filter((m) => searchIssuer(m, (issuer) => issuer?.startsWith('consume-shared-module'))), (m) => getIssuers(m, (issuer) => issuer?.startsWith('consume-shared-module')))
|
|
199
|
-
.map(parseFederatedIssuer)
|
|
200
|
-
.filter((f) => !!f),
|
|
201
|
-
}))
|
|
202
|
-
.filter((c) => c.provides.length > 0);
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* @param {WebpackStats} stats
|
|
206
|
-
* @returns {SharedModule[]}
|
|
207
|
-
*/
|
|
208
|
-
function getMainSharedModules(stats) {
|
|
209
|
-
const chunks = stats.namedChunkGroups['main']
|
|
210
|
-
? flatMap(stats.namedChunkGroups['main'].chunks, (c) => stats.chunks.filter((chunk) => chunk.id === c))
|
|
211
|
-
: [];
|
|
212
|
-
return flatMap(chunks, (chunk) => flatMap(chunk.children, (id) => stats.chunks.filter((c) => {
|
|
213
|
-
return (c.id === id &&
|
|
214
|
-
c.files.length > 0 &&
|
|
215
|
-
c.modules.some((m) => {
|
|
216
|
-
return searchIssuerAndReason(m, (check) => check?.startsWith('consume-shared-module'));
|
|
217
|
-
}));
|
|
218
|
-
})))
|
|
219
|
-
.map((chunk) => {
|
|
220
|
-
return {
|
|
221
|
-
chunks: chunk.files.map((f) => `${stats.publicPath === 'auto' ? '' : stats.publicPath || ''}${f}`),
|
|
222
|
-
provides: flatMap(chunk.modules.filter((m) => searchIssuerAndReason(m, (check) => check?.startsWith('consume-shared-module'))), (m) => getIssuersAndReasons(m, (issuer) => issuer?.startsWith('consume-shared-module')))
|
|
223
|
-
.map(parseFederatedIssuer)
|
|
224
|
-
.filter((f) => !!f),
|
|
225
|
-
};
|
|
226
|
-
})
|
|
227
|
-
.filter((c) => c.provides.length > 0);
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
*
|
|
231
|
-
* @param {WebpackStats} stats
|
|
232
|
-
* @param {import("webpack").container.ModuleFederationPlugin} federationPlugin
|
|
233
|
-
* @returns {FederatedStats}
|
|
234
|
-
*/
|
|
235
|
-
function getFederationStats(stats, federationPluginOptions) {
|
|
236
|
-
const exposedModules = Object.entries(federationPluginOptions.exposes).reduce((exposedModules, [exposedAs, exposedFile]) => Object.assign(exposedModules, {
|
|
237
|
-
[exposedAs]: getExposedModules(stats, exposedFile),
|
|
238
|
-
}), {});
|
|
239
|
-
/** @type {{ [key: string]: Exposed }} */
|
|
240
|
-
const exposes = Object.entries(exposedModules).reduce((exposedChunks, [exposedAs, exposedModules]) => Object.assign(exposedChunks, {
|
|
241
|
-
[exposedAs]: flatMap(exposedModules, (mod) => getExposed(stats, mod)),
|
|
242
|
-
}), {});
|
|
243
|
-
/** @type {string} */
|
|
244
|
-
const remote = federationPluginOptions.library?.name || federationPluginOptions.name;
|
|
245
|
-
const sharedModules = getSharedModules(stats, federationPluginOptions);
|
|
246
|
-
const remoteModules = getRemoteModules(stats);
|
|
247
|
-
return {
|
|
248
|
-
remote,
|
|
249
|
-
entry: `${stats.publicPath === 'auto' ? '' : stats.publicPath || ''}${stats.assetsByChunkName[remote] &&
|
|
250
|
-
stats.assetsByChunkName[remote].length === 1
|
|
251
|
-
? stats.assetsByChunkName[remote][0]
|
|
252
|
-
: federationPluginOptions.filename}`,
|
|
253
|
-
sharedModules,
|
|
254
|
-
exposes,
|
|
255
|
-
remoteModules,
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* @typedef {object} FederationStatsPluginOptions
|
|
260
|
-
* @property {string | string[]} filename The filename or an array of filenames in the `output.path` directory to write stats to.
|
|
261
|
-
*/
|
|
262
|
-
/**
|
|
263
|
-
* Writes relevant federation stats to a file for further consumption.
|
|
264
|
-
*/
|
|
265
|
-
class FederationStatsPlugin {
|
|
266
|
-
/**
|
|
267
|
-
*
|
|
268
|
-
* @param {FederationStatsPluginOptions} options
|
|
269
|
-
*/
|
|
270
|
-
constructor(options) {
|
|
271
|
-
if (!options || !options.filename) {
|
|
272
|
-
throw new Error('filename option is required.');
|
|
273
|
-
}
|
|
274
|
-
this._options = options;
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
*
|
|
278
|
-
* @param {import("webpack").Compiler} compiler
|
|
279
|
-
*/
|
|
280
|
-
apply(compiler) {
|
|
281
|
-
const federationPlugins = compiler.options.plugins?.filter((plugin) => [
|
|
282
|
-
'NextFederationPlugin',
|
|
283
|
-
'UniversalFederationPlugin',
|
|
284
|
-
'NodeFederationPlugin',
|
|
285
|
-
'ModuleFederationPlugin',
|
|
286
|
-
].includes(plugin.constructor.name) && plugin?._options?.exposes);
|
|
287
|
-
if (!federationPlugins || federationPlugins.length === 0) {
|
|
288
|
-
console.error('No ModuleFederationPlugin(s) found.');
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
// This is where the plugin is tapping into the Webpack compilation lifecycle.
|
|
292
|
-
// It's listening to the 'thisCompilation' event, which is triggered once for each new compilation.
|
|
293
|
-
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
|
294
|
-
// 'processAssets' is a hook that gets triggered when Webpack has finished the compilation
|
|
295
|
-
// and is about to generate the final assets. It allows plugins to do additional processing on the assets.
|
|
296
|
-
compilation.hooks.processAssets.tap({
|
|
297
|
-
name: PLUGIN_NAME,
|
|
298
|
-
stage: compilation.constructor.PROCESS_ASSETS_STAGE_REPORT,
|
|
299
|
-
}, () => {
|
|
300
|
-
// Extract the options from the federation plugins.
|
|
301
|
-
const [federationOpts] = federationPlugins.map((federationPlugin) => federationPlugin?._options);
|
|
302
|
-
let container;
|
|
303
|
-
// Loop through all entry points and if one matches the name of a federation plugin,
|
|
304
|
-
// store the entry point in the 'container' variable.
|
|
305
|
-
for (const [name, entry] of compilation.entrypoints) {
|
|
306
|
-
if (container) {
|
|
307
|
-
break;
|
|
308
|
-
}
|
|
309
|
-
federationOpts.name.includes(name) && (container = entry);
|
|
310
|
-
}
|
|
311
|
-
// If no matching entry point was found, exit the function early.
|
|
312
|
-
if (!container) {
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
// Get the chunk associated with the entry point.
|
|
316
|
-
container = container?.getEntrypointChunk();
|
|
317
|
-
// Get the module associated with the chunk.
|
|
318
|
-
const [containerEntryModule] = Array.from(compilation.chunkGraph.getChunkEntryModulesIterable(container));
|
|
319
|
-
const { blocks } = containerEntryModule;
|
|
320
|
-
const exposedResolved = {};
|
|
321
|
-
const builtExposes = {};
|
|
322
|
-
// Iterate over each dependency block associated with the entry module.
|
|
323
|
-
for (let block of blocks) {
|
|
324
|
-
const blockmodule = block;
|
|
325
|
-
// Iterate over each dependency within the block.
|
|
326
|
-
for (const dep of blockmodule.dependencies) {
|
|
327
|
-
// Get the module that corresponds to the dependency.
|
|
328
|
-
const connection = compilation.moduleGraph.getConnection(dep);
|
|
329
|
-
if (!connection) {
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
332
|
-
const { module } = connection;
|
|
333
|
-
const moduleChunks = compilation.chunkGraph.getModuleChunksIterable(module);
|
|
334
|
-
// Iterate over each chunk associated with the module.
|
|
335
|
-
for (let exposedChunk of moduleChunks) {
|
|
336
|
-
// Determine the runtime for the chunk.
|
|
337
|
-
const runtime = typeof exposedChunk.runtime === 'string'
|
|
338
|
-
? new Set([exposedChunk.runtime])
|
|
339
|
-
: exposedChunk.runtime;
|
|
340
|
-
// Check if the chunk is meant for the same runtime as the entry module.
|
|
341
|
-
const isForThisRuntime = runtime.has(containerEntryModule._name);
|
|
342
|
-
// Get the root modules for the chunk.
|
|
343
|
-
const rootModules = compilation.chunkGraph.getChunkRootModules(exposedChunk);
|
|
344
|
-
// Check if the module associated with the dependency is one of the root modules for the chunk.
|
|
345
|
-
const moduleActuallyNeedsChunk = rootModules.includes(module);
|
|
346
|
-
// If the chunk is not meant for this runtime or the module doesn't need the chunk, skip the rest of this iteration.
|
|
347
|
-
if (!isForThisRuntime || !moduleActuallyNeedsChunk) {
|
|
348
|
-
continue;
|
|
349
|
-
}
|
|
350
|
-
// Add the files associated with the chunk to the 'builtExposes' object under the name of the exposed module.
|
|
351
|
-
builtExposes[dep.exposedName] = [
|
|
352
|
-
...(builtExposes[dep.exposedName] || []),
|
|
353
|
-
...(exposedChunk.files || []),
|
|
354
|
-
];
|
|
355
|
-
}
|
|
356
|
-
// Add the module to the 'exposedResolved' object under the name of the exposed module.
|
|
357
|
-
exposedResolved[dep.exposedName] = module;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
// Generate a JSON object that contains detailed information about the compilation.
|
|
361
|
-
const stats = compilation.getStats().toJson({
|
|
362
|
-
all: false,
|
|
363
|
-
assets: true,
|
|
364
|
-
reasons: true,
|
|
365
|
-
modules: true,
|
|
366
|
-
children: true,
|
|
367
|
-
chunkGroups: true,
|
|
368
|
-
chunkModules: true,
|
|
369
|
-
chunkOrigins: false,
|
|
370
|
-
entrypoints: true,
|
|
371
|
-
namedChunkGroups: false,
|
|
372
|
-
chunkRelations: true,
|
|
373
|
-
chunks: true,
|
|
374
|
-
ids: true,
|
|
375
|
-
nestedModules: false,
|
|
376
|
-
outputPath: true,
|
|
377
|
-
publicPath: true,
|
|
378
|
-
});
|
|
379
|
-
// Apply a function 'getFederationStats' on the stats with the federation plugin options as the second argument.
|
|
380
|
-
const federatedModules = getFederationStats(stats, federationOpts);
|
|
381
|
-
// Assign the 'builtExposes' object to the 'exposes' property of the 'federatedModules' object.
|
|
382
|
-
federatedModules.exposes = builtExposes;
|
|
383
|
-
// Apply a function 'getMainSharedModules' on the stats.
|
|
384
|
-
const sharedModules = getMainSharedModules(stats);
|
|
385
|
-
// Create a Set to hold the vendor chunks.
|
|
386
|
-
const vendorChunks = new Set();
|
|
387
|
-
// Iterate over the shared modules.
|
|
388
|
-
for (const share of sharedModules) {
|
|
389
|
-
if (share?.chunks) {
|
|
390
|
-
// If a shared module has chunks, add them to the 'vendorChunks' Set.
|
|
391
|
-
for (const file of share.chunks) {
|
|
392
|
-
vendorChunks.add(file);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
// Construct an object that contains the shared and federated modules.
|
|
397
|
-
const statsResult = {
|
|
398
|
-
sharedModules,
|
|
399
|
-
federatedModules: [federatedModules],
|
|
400
|
-
};
|
|
401
|
-
// Convert the 'statsResult' object to a JSON string.
|
|
402
|
-
const statsJson = JSON.stringify(statsResult);
|
|
403
|
-
// Convert the JSON string to a buffer.
|
|
404
|
-
const statsBuffer = Buffer.from(statsJson, 'utf-8');
|
|
405
|
-
// Construct an object that represents the source of the final asset.
|
|
406
|
-
const statsSource = {
|
|
407
|
-
source: () => statsBuffer,
|
|
408
|
-
size: () => statsBuffer.length,
|
|
409
|
-
};
|
|
410
|
-
// Get the filename of the final asset from the plugin options.
|
|
411
|
-
const { filename } = this._options;
|
|
412
|
-
// If filename is an array, loop over it to emit or update assets.
|
|
413
|
-
if (Array.isArray(filename)) {
|
|
414
|
-
for (const file of filename) {
|
|
415
|
-
// Check if an asset with the same filename already exists.
|
|
416
|
-
const asset = compilation.getAsset(file);
|
|
417
|
-
// If an asset with the same filename already exists, update it. Otherwise, create a new asset.
|
|
418
|
-
if (asset) {
|
|
419
|
-
compilation.updateAsset(file, statsSource);
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
compilation.emitAsset(file, statsSource);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
else {
|
|
427
|
-
// Check if an asset with the same filename already exists.
|
|
428
|
-
const asset = compilation.getAsset(filename);
|
|
429
|
-
// If an asset with the same filename already exists, update it. Otherwise, create a new asset.
|
|
430
|
-
if (asset) {
|
|
431
|
-
compilation.updateAsset(filename, statsSource);
|
|
432
|
-
}
|
|
433
|
-
else {
|
|
434
|
-
compilation.emitAsset(filename, statsSource);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
module.exports = FederationStatsPlugin;
|
|
442
|
-
//# sourceMappingURL=ChunkCorrelationPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChunkCorrelationPlugin.js","sourceRoot":"","sources":["../../../src/plugins/ChunkCorrelationPlugin.js"],"names":[],"mappings":";AAAA,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAE5C,2EAA2E;AAC3E,uFAAuF;AACvF,uFAAuF;AAEvF;;;;;;;;GAQG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AAEH,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAErC,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAExD;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,KAAK;IAC7B,OAAO,KAAK,CAAC,OAAO;SACjB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,KAAK,eAAe,CAAC;SACnD,MAAM,CAAC,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE;QAC5B,GAAG,CAAC,YAAY,CAAC,gBAAgB,CAAC,GAAG,YAAY,CAAC,EAAE,CAAC;QACrD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACX,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,KAAK,EAAE,WAAW;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,UA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';
|
|
2
|
-
import type { ModuleFederationPluginOptions } from '../types';
|
|
3
|
-
interface DynamicFilesystemChunkLoadingOptions extends ModuleFederationPluginOptions {
|
|
4
|
-
baseURI: Compiler['options']['output']['publicPath'];
|
|
5
|
-
promiseBaseURI?: string;
|
|
6
|
-
remotes: Record<string, string>;
|
|
7
|
-
name?: string;
|
|
8
|
-
asyncChunkLoading: boolean;
|
|
9
|
-
debug?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare class DynamicFilesystemChunkLoadingPlugin {
|
|
12
|
-
private options;
|
|
13
|
-
private _asyncChunkLoading;
|
|
14
|
-
constructor(options: DynamicFilesystemChunkLoadingOptions);
|
|
15
|
-
apply(compiler: Compiler): void;
|
|
16
|
-
}
|
|
17
|
-
export default DynamicFilesystemChunkLoadingPlugin;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
|
|
7
|
-
const StartupChunkDependenciesPlugin = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/runtime/StartupChunkDependenciesPlugin'));
|
|
8
|
-
const DynamicFilesystemChunkLoadingRuntimeModule_1 = __importDefault(require("./DynamicFilesystemChunkLoadingRuntimeModule"));
|
|
9
|
-
const RemotePublicPathRuntimeModule_1 = __importDefault(require("./RemotePublicPathRuntimeModule"));
|
|
10
|
-
class DynamicFilesystemChunkLoadingPlugin {
|
|
11
|
-
constructor(options) {
|
|
12
|
-
this.options = options || {};
|
|
13
|
-
this._asyncChunkLoading = this.options.asyncChunkLoading;
|
|
14
|
-
}
|
|
15
|
-
apply(compiler) {
|
|
16
|
-
const { RuntimeGlobals } = compiler.webpack;
|
|
17
|
-
const chunkLoadingValue = this._asyncChunkLoading
|
|
18
|
-
? 'async-node'
|
|
19
|
-
: 'require';
|
|
20
|
-
new StartupChunkDependenciesPlugin({
|
|
21
|
-
chunkLoading: chunkLoadingValue,
|
|
22
|
-
asyncChunkLoading: this._asyncChunkLoading,
|
|
23
|
-
//@ts-ignore
|
|
24
|
-
}).apply(compiler);
|
|
25
|
-
compiler.hooks.thisCompilation.tap('DynamicFilesystemChunkLoadingPlugin', (compilation) => {
|
|
26
|
-
// Always enabled
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
-
const isEnabledForChunk = (_) => true;
|
|
29
|
-
const onceForChunkSet = new WeakSet();
|
|
30
|
-
const handler = (chunk, set) => {
|
|
31
|
-
if (onceForChunkSet.has(chunk)) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
onceForChunkSet.add(chunk);
|
|
35
|
-
if (!isEnabledForChunk(chunk)) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
set.add(RuntimeGlobals.moduleFactoriesAddOnly);
|
|
39
|
-
set.add(RuntimeGlobals.hasOwnProperty);
|
|
40
|
-
set.add(RuntimeGlobals.publicPath); // this breaks things
|
|
41
|
-
compilation.addRuntimeModule(chunk, new DynamicFilesystemChunkLoadingRuntimeModule_1.default(set, this.options, {
|
|
42
|
-
webpack: compiler.webpack,
|
|
43
|
-
}));
|
|
44
|
-
};
|
|
45
|
-
compilation.hooks.runtimeRequirementInTree
|
|
46
|
-
.for(RuntimeGlobals.ensureChunkHandlers)
|
|
47
|
-
.tap('DynamicFilesystemChunkLoadingPlugin', handler);
|
|
48
|
-
compilation.hooks.runtimeRequirementInTree
|
|
49
|
-
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
|
50
|
-
.tap('DynamicFilesystemChunkLoadingPlugin', handler);
|
|
51
|
-
compilation.hooks.runtimeRequirementInTree
|
|
52
|
-
.for(RuntimeGlobals.hmrDownloadManifest)
|
|
53
|
-
.tap('DynamicFilesystemChunkLoadingPlugin', handler);
|
|
54
|
-
compilation.hooks.runtimeRequirementInTree
|
|
55
|
-
.for(RuntimeGlobals.baseURI)
|
|
56
|
-
.tap('DynamicFilesystemChunkLoadingPlugin', handler);
|
|
57
|
-
compilation.hooks.runtimeRequirementInTree
|
|
58
|
-
.for(RuntimeGlobals.externalInstallChunk)
|
|
59
|
-
.tap('DynamicFilesystemChunkLoadingPlugin', handler);
|
|
60
|
-
compilation.hooks.runtimeRequirementInTree
|
|
61
|
-
.for(RuntimeGlobals.onChunksLoaded)
|
|
62
|
-
.tap('DynamicFilesystemChunkLoadingPlugin', handler);
|
|
63
|
-
compilation.hooks.runtimeRequirementInTree
|
|
64
|
-
.for(RuntimeGlobals.ensureChunkHandlers)
|
|
65
|
-
.tap('DynamicFilesystemChunkLoadingPlugin', (chunk, set) => {
|
|
66
|
-
if (!isEnabledForChunk(chunk)) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
set.add(RuntimeGlobals.getChunkScriptFilename);
|
|
70
|
-
});
|
|
71
|
-
compilation.hooks.runtimeRequirementInTree
|
|
72
|
-
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
|
73
|
-
.tap('DynamicFilesystemChunkLoadingPlugin', (chunk, set) => {
|
|
74
|
-
if (!isEnabledForChunk(chunk)) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
set.add(RuntimeGlobals.getChunkUpdateScriptFilename);
|
|
78
|
-
set.add(RuntimeGlobals.moduleCache);
|
|
79
|
-
set.add(RuntimeGlobals.hmrModuleData);
|
|
80
|
-
set.add(RuntimeGlobals.moduleFactoriesAddOnly);
|
|
81
|
-
});
|
|
82
|
-
compilation.hooks.runtimeRequirementInTree
|
|
83
|
-
.for(RuntimeGlobals.hmrDownloadManifest)
|
|
84
|
-
.tap('DynamicFilesystemChunkLoadingPlugin', (chunk, set) => {
|
|
85
|
-
if (!isEnabledForChunk(chunk)) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
set.add(RuntimeGlobals.getUpdateManifestFilename);
|
|
89
|
-
});
|
|
90
|
-
compilation.hooks.runtimeRequirementInTree
|
|
91
|
-
.for(RuntimeGlobals.publicPath)
|
|
92
|
-
.tap('RuntimePlugin', (chunk, set) => {
|
|
93
|
-
const { outputOptions } = compilation;
|
|
94
|
-
const { publicPath: globalPublicPath, scriptType } = outputOptions;
|
|
95
|
-
const entryOptions = chunk.getEntryOptions();
|
|
96
|
-
const publicPath = entryOptions && entryOptions.publicPath !== undefined
|
|
97
|
-
? entryOptions.publicPath
|
|
98
|
-
: globalPublicPath;
|
|
99
|
-
const module = new RemotePublicPathRuntimeModule_1.default(this.options);
|
|
100
|
-
if (publicPath === 'auto' && scriptType !== 'module') {
|
|
101
|
-
set.add(RuntimeGlobals.global);
|
|
102
|
-
}
|
|
103
|
-
else if (typeof publicPath !== 'string' ||
|
|
104
|
-
/\[(full)?hash\]/.test(publicPath)) {
|
|
105
|
-
module.fullHash = true;
|
|
106
|
-
}
|
|
107
|
-
compilation.addRuntimeModule(chunk, module);
|
|
108
|
-
return true;
|
|
109
|
-
});
|
|
110
|
-
compilation.hooks.additionalTreeRuntimeRequirements.tap('StartupChunkDependenciesPlugin', (chunk, set, { chunkGraph }) => {
|
|
111
|
-
// compilation.addRuntimeModule(
|
|
112
|
-
// chunk,
|
|
113
|
-
// //@ts-ignore
|
|
114
|
-
// new FederationModuleInfoRuntimeModule(),
|
|
115
|
-
// );
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
exports.default = DynamicFilesystemChunkLoadingPlugin;
|
|
121
|
-
//# sourceMappingURL=CommonJsChunkLoadingPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommonJsChunkLoadingPlugin.js","sourceRoot":"","sources":["../../../src/plugins/CommonJsChunkLoadingPlugin.ts"],"names":[],"mappings":";;;;;AACA,0FAAqF;AAErF,MAAM,8BAA8B,GAAG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AW,CAAC;gBACtC,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;gBACnE,MAAM,YAAY,GAAG,KAAK,CAAC,eAAe,EAAE,CAAC;gBAC7C,MAAM,UAAU,GACd,YAAY,IAAI,YAAY,CAAC,UAAU,KAAK,SAAS;oBACnD,CAAC,CAAC,YAAY,CAAC,UAAU;oBACzB,CAAC,CAAC,gBAAgB,CAAC;gBAEvB,MAAM,MAAM,GAAG,IAAI,uCAA2B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC7D,IAAI,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;oBACrD,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;gBACjC,CAAC;qBAAM,IACL,OAAO,UAAU,KAAK,QAAQ;oBAC9B,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,EAClC,CAAC;oBACD,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;gBACzB,CAAC;gBAED,WAAW,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBAC5C,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;YAEL,WAAW,CAAC,KAAK,CAAC,iCAAiC,CAAC,GAAG,CACrD,gCAAgC,EAChC,CACE,KAAY,EACZ,GAAgB,EAChB,EAAE,UAAU,EAA8B,EAC1C,EAAE;gBACF,gCAAgC;gBAChC,WAAW;gBACX,iBAAiB;gBACjB,6CAA6C;gBAC7C,KAAK;YACP,CAAC,CACF,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAED,kBAAe,mCAAmC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Chunk, Compiler } from 'webpack';
|
|
2
|
-
declare const RuntimeModule: typeof import("webpack").RuntimeModule;
|
|
3
|
-
import { SyncWaterfallHook } from 'tapable';
|
|
4
|
-
interface DynamicFilesystemChunkLoadingRuntimeModuleOptions {
|
|
5
|
-
baseURI: Compiler['options']['output']['publicPath'];
|
|
6
|
-
promiseBaseURI?: string;
|
|
7
|
-
remotes: Record<string, string>;
|
|
8
|
-
name?: string;
|
|
9
|
-
debug?: boolean;
|
|
10
|
-
}
|
|
11
|
-
interface ChunkLoadingContext {
|
|
12
|
-
webpack: Compiler['webpack'];
|
|
13
|
-
}
|
|
14
|
-
declare class DynamicFilesystemChunkLoadingRuntimeModule extends RuntimeModule {
|
|
15
|
-
private runtimeRequirements;
|
|
16
|
-
private options;
|
|
17
|
-
private chunkLoadingContext;
|
|
18
|
-
hooks: {
|
|
19
|
-
strategyCase: SyncWaterfallHook<unknown, import("tapable").UnsetAdditionalOptions>;
|
|
20
|
-
};
|
|
21
|
-
constructor(runtimeRequirements: Set<string>, options: DynamicFilesystemChunkLoadingRuntimeModuleOptions, chunkLoadingContext: ChunkLoadingContext);
|
|
22
|
-
/**
|
|
23
|
-
* @private
|
|
24
|
-
* @param {Chunk} chunk chunk
|
|
25
|
-
* @param {string} rootOutputDir root output directory
|
|
26
|
-
* @returns {string} generated code
|
|
27
|
-
*/
|
|
28
|
-
_generateBaseUri(chunk: Chunk, rootOutputDir: string): string;
|
|
29
|
-
/**
|
|
30
|
-
* @private
|
|
31
|
-
* @param {unknown[]} items item to log
|
|
32
|
-
*/
|
|
33
|
-
_getLogger(...items: unknown[]): string;
|
|
34
|
-
/**
|
|
35
|
-
* @returns {string} runtime code
|
|
36
|
-
*/
|
|
37
|
-
generate(): string;
|
|
38
|
-
}
|
|
39
|
-
export default DynamicFilesystemChunkLoadingRuntimeModule;
|