@module-federation/node 0.0.0-docs-remove-invalid-lark-link-20251205062649
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/LICENSE +21 -0
- package/README.md +235 -0
- package/dist/jest.config.d.ts +11 -0
- package/dist/jest.config.js +19 -0
- package/dist/jest.config.js.map +1 -0
- package/dist/package.json +90 -0
- package/dist/src/filesystem/stratagies.d.ts +18 -0
- package/dist/src/filesystem/stratagies.js +124 -0
- package/dist/src/filesystem/stratagies.js.map +1 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.js +22 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/plugins/AutomaticPublicPathPlugin.d.ts +9 -0
- package/dist/src/plugins/AutomaticPublicPathPlugin.js +38 -0
- package/dist/src/plugins/AutomaticPublicPathPlugin.js.map +1 -0
- package/dist/src/plugins/ChunkCorrelationPlugin.d.ts +61 -0
- package/dist/src/plugins/ChunkCorrelationPlugin.js +441 -0
- package/dist/src/plugins/ChunkCorrelationPlugin.js.map +1 -0
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.d.ts +17 -0
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.js +121 -0
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.js.map +1 -0
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.d.ts +40 -0
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js +128 -0
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js.map +1 -0
- package/dist/src/plugins/EntryChunkTrackerPlugin.d.ts +13 -0
- package/dist/src/plugins/EntryChunkTrackerPlugin.js +41 -0
- package/dist/src/plugins/EntryChunkTrackerPlugin.js.map +1 -0
- package/dist/src/plugins/NodeFederationPlugin.d.ts +46 -0
- package/dist/src/plugins/NodeFederationPlugin.js +88 -0
- package/dist/src/plugins/NodeFederationPlugin.js.map +1 -0
- package/dist/src/plugins/RemotePublicPathRuntimeModule.d.ts +10 -0
- package/dist/src/plugins/RemotePublicPathRuntimeModule.js +134 -0
- package/dist/src/plugins/RemotePublicPathRuntimeModule.js.map +1 -0
- package/dist/src/plugins/StreamingTargetPlugin.d.ts +28 -0
- package/dist/src/plugins/StreamingTargetPlugin.js +59 -0
- package/dist/src/plugins/StreamingTargetPlugin.js.map +1 -0
- package/dist/src/plugins/UniversalFederationPlugin.d.ts +45 -0
- package/dist/src/plugins/UniversalFederationPlugin.js +85 -0
- package/dist/src/plugins/UniversalFederationPlugin.js.map +1 -0
- package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.d.ts +5 -0
- package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.js +28 -0
- package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.js.map +1 -0
- package/dist/src/plugins/webpackChunkUtilities.d.ts +50 -0
- package/dist/src/plugins/webpackChunkUtilities.js +304 -0
- package/dist/src/plugins/webpackChunkUtilities.js.map +1 -0
- package/dist/src/recordDynamicRemoteEntryHashPlugin.d.ts +3 -0
- package/dist/src/recordDynamicRemoteEntryHashPlugin.js +65 -0
- package/dist/src/recordDynamicRemoteEntryHashPlugin.js.map +1 -0
- package/dist/src/runtimePlugin.d.ts +22 -0
- package/dist/src/runtimePlugin.js +280 -0
- package/dist/src/runtimePlugin.js.map +1 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/types/index.js +3 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/utils/flush-chunks.d.ts +11 -0
- package/dist/src/utils/flush-chunks.js +177 -0
- package/dist/src/utils/flush-chunks.js.map +1 -0
- package/dist/src/utils/hot-reload.d.ts +12 -0
- package/dist/src/utils/hot-reload.js +292 -0
- package/dist/src/utils/hot-reload.js.map +1 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.js +19 -0
- package/dist/src/utils/index.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,292 @@
|
|
|
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
|
+
exports.revalidate = exports.fetchRemote = exports.createFetcher = exports.checkFakeRemote = exports.checkMedusaConfigChange = exports.checkUnreachableRemote = exports.performReload = void 0;
|
|
7
|
+
exports.getFetchModule = getFetchModule;
|
|
8
|
+
const flush_chunks_1 = require("./flush-chunks");
|
|
9
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
10
|
+
const helpers_1 = __importDefault(require("@module-federation/runtime/helpers"));
|
|
11
|
+
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const getRequire = () => {
|
|
13
|
+
//@ts-ignore
|
|
14
|
+
return typeof __non_webpack_require__ !== 'undefined'
|
|
15
|
+
? __non_webpack_require__
|
|
16
|
+
: eval('require');
|
|
17
|
+
};
|
|
18
|
+
function callsites() {
|
|
19
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
|
20
|
+
try {
|
|
21
|
+
let result = [];
|
|
22
|
+
Error.prepareStackTrace = (_, callSites) => {
|
|
23
|
+
const callSitesWithoutCurrent = callSites.slice(1);
|
|
24
|
+
result = callSitesWithoutCurrent;
|
|
25
|
+
return callSitesWithoutCurrent;
|
|
26
|
+
};
|
|
27
|
+
new Error().stack;
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const find = function (moduleName) {
|
|
35
|
+
if (moduleName[0] === '.') {
|
|
36
|
+
// Use custom callsites function
|
|
37
|
+
const stack = callsites();
|
|
38
|
+
for (const frame of stack) {
|
|
39
|
+
const filename = frame.getFileName();
|
|
40
|
+
if (filename && filename !== module.filename) {
|
|
41
|
+
moduleName = path_1.default.resolve(path_1.default.dirname(filename), moduleName);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
return getRequire().resolve(moduleName);
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Removes a module from the cache. We need this to re-load our http_request !
|
|
55
|
+
* see: https://stackoverflow.com/a/14801711/1148249
|
|
56
|
+
*/
|
|
57
|
+
const decache = async function (moduleName) {
|
|
58
|
+
//@ts-ignore
|
|
59
|
+
moduleName = find(moduleName);
|
|
60
|
+
if (!moduleName) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const currentChunk = getRequire().cache[__filename];
|
|
64
|
+
// Run over the cache looking for the files
|
|
65
|
+
// loaded by the specified module name
|
|
66
|
+
searchCache(moduleName, function (mod) {
|
|
67
|
+
delete getRequire().cache[mod.id];
|
|
68
|
+
});
|
|
69
|
+
try {
|
|
70
|
+
// Remove cached paths to the module.
|
|
71
|
+
// Thanks to @bentael for pointing this out.
|
|
72
|
+
//@ts-ignore
|
|
73
|
+
Object.keys(currentChunk.constructor._pathCache).forEach(function (cacheKey) {
|
|
74
|
+
if (cacheKey.indexOf(moduleName) > -1) {
|
|
75
|
+
//@ts-ignore
|
|
76
|
+
delete currentChunk.constructor._pathCache[cacheKey];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
//null
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Runs over the cache to search for all the cached
|
|
86
|
+
* files
|
|
87
|
+
*/
|
|
88
|
+
const searchCache = function (moduleName, callback) {
|
|
89
|
+
// Resolve the module identified by the specified name
|
|
90
|
+
let mod = getRequire().resolve(moduleName);
|
|
91
|
+
const visited = {};
|
|
92
|
+
// Check if the module has been resolved and found within
|
|
93
|
+
// the cache no else so #ignore else https://git.io/vtgMI
|
|
94
|
+
/* istanbul ignore else */
|
|
95
|
+
//@ts-ignore
|
|
96
|
+
if (mod && (mod = getRequire().cache[mod]) !== undefined) {
|
|
97
|
+
// Recursively go over the results
|
|
98
|
+
(function run(current) {
|
|
99
|
+
visited[current.id] = true;
|
|
100
|
+
// Go over each of the module's children and
|
|
101
|
+
// run over it
|
|
102
|
+
current.children.forEach(function (child) {
|
|
103
|
+
// ignore .node files, decaching native modules throws a
|
|
104
|
+
// "module did not self-register" error on second require
|
|
105
|
+
if (path_1.default.extname(child.filename) !== '.node' && !visited[child.id]) {
|
|
106
|
+
run(child);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
// Call the specified callback providing the
|
|
110
|
+
// found module
|
|
111
|
+
callback(current);
|
|
112
|
+
//@ts-ignore
|
|
113
|
+
})(mod);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const hashmap = globalThis.mfHashMap || {};
|
|
117
|
+
globalThis.moduleGraphDirty = false;
|
|
118
|
+
const requireCacheRegex = /(remote|server|hot-reload|react-loadable-manifest|runtime|styled-jsx)/;
|
|
119
|
+
const performReload = async (shouldReload) => {
|
|
120
|
+
if (!shouldReload) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
const req = getRequire();
|
|
124
|
+
const gs = new Function('return globalThis')();
|
|
125
|
+
const entries = gs.entryChunkCache || new Set();
|
|
126
|
+
//@ts-ignore
|
|
127
|
+
gs.__FEDERATION__.__INSTANCES__.map((i) => {
|
|
128
|
+
//@ts-ignore
|
|
129
|
+
i.moduleCache.forEach((mc) => {
|
|
130
|
+
if (mc.remoteInfo && mc.remoteInfo.entryGlobalName) {
|
|
131
|
+
delete gs[mc.remoteInfo.entryGlobalName];
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
i.moduleCache.clear();
|
|
135
|
+
if (gs[i.name]) {
|
|
136
|
+
delete gs[i.name];
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
//@ts-ignore
|
|
140
|
+
__webpack_require__?.federation?.instance?.moduleCache?.clear();
|
|
141
|
+
helpers_1.default.global.resetFederationGlobalInfo();
|
|
142
|
+
globalThis.moduleGraphDirty = false;
|
|
143
|
+
globalThis.mfHashMap = {};
|
|
144
|
+
if (!entries) {
|
|
145
|
+
Object.keys(req.cache).forEach((key) => {
|
|
146
|
+
if (requireCacheRegex.test(key)) {
|
|
147
|
+
decache(key); // Use decache here
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
for (const entry of entries) {
|
|
153
|
+
decache(entry);
|
|
154
|
+
//reload entries again
|
|
155
|
+
await getRequire()(entry);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return true;
|
|
159
|
+
};
|
|
160
|
+
exports.performReload = performReload;
|
|
161
|
+
const checkUnreachableRemote = (remoteScope) => {
|
|
162
|
+
for (const property in remoteScope.remotes) {
|
|
163
|
+
if (!remoteScope[property]) {
|
|
164
|
+
console.error('unreachable remote found', property, 'hot reloading to refetch');
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return false;
|
|
169
|
+
};
|
|
170
|
+
exports.checkUnreachableRemote = checkUnreachableRemote;
|
|
171
|
+
const checkMedusaConfigChange = (remoteScope, fetchModule) => {
|
|
172
|
+
//@ts-ignore
|
|
173
|
+
if (remoteScope._medusa) {
|
|
174
|
+
//@ts-ignore
|
|
175
|
+
for (const property in remoteScope._medusa) {
|
|
176
|
+
fetchModule(property)
|
|
177
|
+
.then((res) => res.json())
|
|
178
|
+
.then((medusaResponse) => {
|
|
179
|
+
if (medusaResponse.version !==
|
|
180
|
+
//@ts-ignore
|
|
181
|
+
remoteScope?._medusa[property].version) {
|
|
182
|
+
console.log('medusa config changed', property, 'hot reloading to refetch');
|
|
183
|
+
(0, exports.performReload)(true);
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return false;
|
|
190
|
+
};
|
|
191
|
+
exports.checkMedusaConfigChange = checkMedusaConfigChange;
|
|
192
|
+
const checkFakeRemote = (remoteScope) => {
|
|
193
|
+
for (const property in remoteScope._config) {
|
|
194
|
+
let remote = remoteScope._config[property];
|
|
195
|
+
const resolveRemote = async () => {
|
|
196
|
+
remote = await remote();
|
|
197
|
+
};
|
|
198
|
+
if (typeof remote === 'function') {
|
|
199
|
+
resolveRemote();
|
|
200
|
+
}
|
|
201
|
+
if (remote.fake) {
|
|
202
|
+
console.log('fake remote found', property, 'hot reloading to refetch');
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return false;
|
|
207
|
+
};
|
|
208
|
+
exports.checkFakeRemote = checkFakeRemote;
|
|
209
|
+
const createFetcher = (url, fetchModule, name, cb) => {
|
|
210
|
+
return fetchModule(url)
|
|
211
|
+
.then((re) => {
|
|
212
|
+
if (!re.ok) {
|
|
213
|
+
throw new Error(`Error loading remote: status: ${re.status}, content-type: ${re.headers.get('content-type')}`);
|
|
214
|
+
}
|
|
215
|
+
return re.text();
|
|
216
|
+
})
|
|
217
|
+
.then((contents) => {
|
|
218
|
+
const hash = crypto_1.default.createHash('md5').update(contents).digest('hex');
|
|
219
|
+
cb(hash);
|
|
220
|
+
})
|
|
221
|
+
.catch((e) => {
|
|
222
|
+
console.error('Remote', name, url, 'Failed to load or is not online', e);
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
exports.createFetcher = createFetcher;
|
|
226
|
+
const fetchRemote = (remoteScope, fetchModule) => {
|
|
227
|
+
const fetches = [];
|
|
228
|
+
let needReload = false;
|
|
229
|
+
for (const property in remoteScope) {
|
|
230
|
+
const name = property;
|
|
231
|
+
const container = remoteScope[property];
|
|
232
|
+
const url = container.entry;
|
|
233
|
+
const fetcher = (0, exports.createFetcher)(url, fetchModule, name, (hash) => {
|
|
234
|
+
if (hashmap[name]) {
|
|
235
|
+
if (hashmap[name] !== hash) {
|
|
236
|
+
hashmap[name] = hash;
|
|
237
|
+
needReload = true;
|
|
238
|
+
console.log(name, 'hash is different - must hot reload server');
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
hashmap[name] = hash;
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
fetches.push(fetcher);
|
|
246
|
+
}
|
|
247
|
+
return Promise.all(fetches).then(() => {
|
|
248
|
+
return needReload;
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
exports.fetchRemote = fetchRemote;
|
|
252
|
+
//@ts-ignore
|
|
253
|
+
const revalidate = async (fetchModule = getFetchModule() || (() => { }), force = false) => {
|
|
254
|
+
if (globalThis.moduleGraphDirty) {
|
|
255
|
+
force = true;
|
|
256
|
+
}
|
|
257
|
+
const remotesFromAPI = (0, flush_chunks_1.getAllKnownRemotes)();
|
|
258
|
+
//@ts-ignore
|
|
259
|
+
return new Promise((res) => {
|
|
260
|
+
if (force) {
|
|
261
|
+
if (Object.keys(hashmap).length !== 0) {
|
|
262
|
+
res(true);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if ((0, exports.checkMedusaConfigChange)(remotesFromAPI, fetchModule)) {
|
|
267
|
+
res(true);
|
|
268
|
+
}
|
|
269
|
+
if ((0, exports.checkFakeRemote)(remotesFromAPI)) {
|
|
270
|
+
res(true);
|
|
271
|
+
}
|
|
272
|
+
(0, exports.fetchRemote)(remotesFromAPI, fetchModule).then((val) => {
|
|
273
|
+
res(val);
|
|
274
|
+
});
|
|
275
|
+
}).then((shouldReload) => {
|
|
276
|
+
return (0, exports.performReload)(shouldReload);
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
exports.revalidate = revalidate;
|
|
280
|
+
function getFetchModule() {
|
|
281
|
+
//@ts-ignore
|
|
282
|
+
const loadedModule =
|
|
283
|
+
//@ts-ignore
|
|
284
|
+
globalThis.webpackChunkLoad || global.webpackChunkLoad || global.fetch;
|
|
285
|
+
if (loadedModule) {
|
|
286
|
+
return loadedModule;
|
|
287
|
+
}
|
|
288
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
289
|
+
const nodeFetch = require('node-fetch');
|
|
290
|
+
return nodeFetch.default || nodeFetch;
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=hot-reload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hot-reload.js","sourceRoot":"","sources":["../../../src/utils/hot-reload.ts"],"names":[],"mappings":";;;;;;AA4UA,wCAWC;AAvVD,iDAAoD;AACpD,oDAA4B;AAC5B,iFAAyD;AACzD,gDAAwB;AAOxB,MAAM,UAAU,GAAG,GAAgB,EAAE;IACnC,YAAY;IACZ,OAAO,OAAO,uBAAuB,KAAK,WAAW;QACnD,CAAC,CAAE,uBAAuC;QAC1C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACtB,CAAC,CAAC;AAEF,SAAS,SAAS;IAChB,MAAM,kBAAkB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACnD,IAAI,CAAC;QACH,IAAI,MAAM,GAAU,EAAE,CAAC;QACvB,KAAK,CAAC,iBAAiB,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE;YACzC,MAAM,uBAAuB,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACnD,MAAM,GAAG,uBAAuB,CAAC;YACjC,OAAO,uBAAuB,CAAC;QACjC,CAAC,CAAC;QAEF,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC;QAClB,OAAO,MAAM,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,KAAK,CAAC,iBAAiB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,MAAM,IAAI,GAAG,UAAU,UAAkB;IACvC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QAC1B,gCAAgC;QAChC,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;QAC1B,KAAK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AAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA9BW,QAAA,UAAU,cA8BrB;AAEF,SAAgB,cAAc;IAC5B,YAAY;IACZ,MAAM,YAAY;IAChB,YAAY;IACZ,UAAU,CAAC,gBAAgB,IAAI,MAAM,CAAC,gBAAgB,IAAI,MAAM,CAAC,KAAK,CAAC;IACzE,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,8DAA8D;IAC9D,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACxC,OAAO,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hot-reload"), exports);
|
|
18
|
+
__exportStar(require("./flush-chunks"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,iDAA+B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"public": true,
|
|
3
|
+
"name": "@module-federation/node",
|
|
4
|
+
"version": "0.0.0-docs-remove-invalid-lark-link-20251205062649",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./dist/src/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/src/index.js",
|
|
10
|
+
"require": "./dist/src/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json",
|
|
13
|
+
"./runtimePlugin": "./dist/src/runtimePlugin.js",
|
|
14
|
+
"./record-dynamic-remote-entry-hash-plugin": "./dist/src/recordDynamicRemoteEntryHashPlugin.js",
|
|
15
|
+
"./utils": {
|
|
16
|
+
"import": "./dist/src/utils/index.js",
|
|
17
|
+
"require": "./dist/src/utils/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./src/plugins/NodeFederationPlugin.js": "./dist/src/plugins/NodeFederationPlugin.js",
|
|
20
|
+
"./universe-entry-chunk-tracker-plugin": "./dist/src/plugins/UniverseEntryChunkTrackerPlugin.js",
|
|
21
|
+
"./src/*": "./dist/src/*"
|
|
22
|
+
},
|
|
23
|
+
"typesVersions": {
|
|
24
|
+
"*": {
|
|
25
|
+
".": [
|
|
26
|
+
"./dist/src/index.d.ts"
|
|
27
|
+
],
|
|
28
|
+
"runtimePlugin": [
|
|
29
|
+
"./dist/src/runtimePlugin.d.ts"
|
|
30
|
+
],
|
|
31
|
+
"utils": [
|
|
32
|
+
"./dist/src/utils/index.d.ts"
|
|
33
|
+
],
|
|
34
|
+
"record-dynamic-remote-entry-hash-plugin": [
|
|
35
|
+
"./dist/src/record-dynamic-remote-entry-hash-plugin.d.ts"
|
|
36
|
+
],
|
|
37
|
+
"universe-entry-chunk-tracker-plugin": [
|
|
38
|
+
"./dist/src/plugins/UniverseEntryChunkTrackerPlugin.d.ts"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist/",
|
|
44
|
+
"README.md"
|
|
45
|
+
],
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"tags": [
|
|
50
|
+
"module-federation",
|
|
51
|
+
"node",
|
|
52
|
+
"webpack",
|
|
53
|
+
"node-federation",
|
|
54
|
+
"node-module-federation",
|
|
55
|
+
"ssr"
|
|
56
|
+
],
|
|
57
|
+
"types": "src/index.d.ts",
|
|
58
|
+
"description": "Module Federation helper for Node",
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "git+https://github.com/module-federation/core.git",
|
|
62
|
+
"directory": "packages/node"
|
|
63
|
+
},
|
|
64
|
+
"author": "Zack Jackson <zackary.l.jackson@gmail.com>",
|
|
65
|
+
"license": "MIT",
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"btoa": "1.2.1",
|
|
68
|
+
"encoding": "^0.1.13",
|
|
69
|
+
"node-fetch": "2.7.0",
|
|
70
|
+
"@module-federation/sdk": "0.0.0-docs-remove-invalid-lark-link-20251205062649",
|
|
71
|
+
"@module-federation/runtime": "0.0.0-docs-remove-invalid-lark-link-20251205062649",
|
|
72
|
+
"@module-federation/enhanced": "0.0.0-docs-remove-invalid-lark-link-20251205062649"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"react": "^16||^17||^18||^19",
|
|
76
|
+
"react-dom": "^16||^17||^18||^19",
|
|
77
|
+
"webpack": "^5.40.0"
|
|
78
|
+
},
|
|
79
|
+
"peerDependenciesMeta": {
|
|
80
|
+
"react": {
|
|
81
|
+
"optional": true
|
|
82
|
+
},
|
|
83
|
+
"react-dom": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
86
|
+
"next": {
|
|
87
|
+
"optional": true
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|