@module-federation/vite 1.1.1 → 1.1.3
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/README.md +4 -0
- package/lib/index.cjs +8 -7
- package/lib/index.esm.js +8 -7
- package/lib/index.modern.js +13 -7
- package/lib/index.umd.js +8 -7
- package/lib/utils/normalizeModuleFederationOptions.d.ts +1 -1
- package/package.json +23 -21
package/README.md
CHANGED
|
@@ -15,6 +15,10 @@ This plugin makes Module Federation work together with [Vite](https://vitejs.dev
|
|
|
15
15
|
|
|
16
16
|
### [React](https://github.com/gioboa/react-microfrontend-demo)<br>
|
|
17
17
|
|
|
18
|
+
### [Svelte](https://github.com/gioboa/svelte-microfrontend-demo)<br>
|
|
19
|
+
|
|
20
|
+
### [SolidJS](https://github.com/gioboa/solid-microfrontend-demo)<br>
|
|
21
|
+
|
|
18
22
|
### [More examples here](https://github.com/module-federation/vite/tree/main/examples)<br>
|
|
19
23
|
|
|
20
24
|
## Try this crazy example with all these bundlers together
|
package/lib/index.cjs
CHANGED
|
@@ -383,7 +383,7 @@ function normalizeModuleFederationOptions(options) {
|
|
|
383
383
|
dev: options.dev,
|
|
384
384
|
dts: options.dts,
|
|
385
385
|
getPublicPath: options.getPublicPath,
|
|
386
|
-
shareStrategy: options.shareStrategy
|
|
386
|
+
shareStrategy: options.shareStrategy || 'version-first'
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
389
|
|
|
@@ -621,7 +621,7 @@ function generateRemoteEntry(options) {
|
|
|
621
621
|
return item[1];
|
|
622
622
|
}).join('\n') + "\n import exposesMap from \"" + VIRTUAL_EXPOSES + "\"\n import {usedShared, usedRemotes} from \"" + getLocalSharedImportMapPath() + "\"\n import {\n initResolve\n } from \"" + virtualRuntimeInitStatus.getImportId() + "\"\n async function init(shared = {}) {\n const initRes = runtimeInit({\n name: " + JSON.stringify(options.name) + ",\n remotes: usedRemotes,\n shared: usedShared,\n plugins: [" + pluginImportNames.map(function (item) {
|
|
623
623
|
return item[0] + "()";
|
|
624
|
-
}).join(', ') + "],\n " + (options.shareStrategy ? "shareStrategy: " + options.shareStrategy : '') + "\n });\n initRes.initShareScopeMap('" + options.shareScope + "', shared);\n initResolve(initRes)\n return initRes\n }\n\n function getExposes(moduleName) {\n if (!(moduleName in exposesMap)) throw new Error(`Module ${moduleName} does not exist in container.`)\n return (exposesMap[moduleName])().then(res => () => res)\n }\n export {\n init,\n getExposes as get\n }\n ";
|
|
624
|
+
}).join(', ') + "],\n " + (options.shareStrategy ? "shareStrategy: '" + options.shareStrategy + "'" : '') + "\n });\n initRes.initShareScopeMap('" + options.shareScope + "', shared);\n try {\n await Promise.all(await initRes.initializeSharing('" + options.shareScope + "', {strategy: '" + options.shareStrategy + "'}));\n } catch (e) {\n console.error(e)\n }\n initResolve(initRes)\n return initRes\n }\n\n function getExposes(moduleName) {\n if (!(moduleName in exposesMap)) throw new Error(`Module ${moduleName} does not exist in container.`)\n return (exposesMap[moduleName])().then(res => () => res)\n }\n export {\n init,\n getExposes as get\n }\n ";
|
|
625
625
|
}
|
|
626
626
|
/**
|
|
627
627
|
* Inject entry file, automatically init when used as host,
|
|
@@ -980,13 +980,13 @@ function pluginModuleParseEnd (excludeFn) {
|
|
|
980
980
|
apply: 'build',
|
|
981
981
|
moduleParsed: function moduleParsed(module) {
|
|
982
982
|
var id = module.id;
|
|
983
|
-
if (excludeFn(id)) {
|
|
984
|
-
return;
|
|
985
|
-
}
|
|
986
983
|
if (id === VIRTUAL_EXPOSES) {
|
|
987
984
|
// When the entry JS file is empty and only contains exposes export code, it’s necessary to wait for the exposes modules to be resolved in order to collect the dependencies being used.
|
|
988
985
|
exposesParseEnd = true;
|
|
989
986
|
}
|
|
987
|
+
if (excludeFn(id)) {
|
|
988
|
+
return;
|
|
989
|
+
}
|
|
990
990
|
parseEndSet.add(id);
|
|
991
991
|
if (exposesParseEnd && parseStartSet.size === parseEndSet.size) {
|
|
992
992
|
_resolve(1);
|
|
@@ -1250,14 +1250,14 @@ function federation(mfUserOptions) {
|
|
|
1250
1250
|
entryName: 'virtualExposes',
|
|
1251
1251
|
entryPath: VIRTUAL_EXPOSES
|
|
1252
1252
|
}), [pluginProxyRemoteEntry(), pluginProxyRemotes(options)], pluginModuleParseEnd(function (id) {
|
|
1253
|
-
return id.includes(getHostAutoInitImportId()) || id.includes(REMOTE_ENTRY_ID) || id.includes(getLocalSharedImportMapPath());
|
|
1253
|
+
return id.includes(getHostAutoInitImportId()) || id.includes(REMOTE_ENTRY_ID) || id.includes(VIRTUAL_EXPOSES) || id.includes(getLocalSharedImportMapPath());
|
|
1254
1254
|
}), proxySharedModule({
|
|
1255
1255
|
shared: shared
|
|
1256
1256
|
}), [PluginDevProxyModuleTopLevelAwait(), {
|
|
1257
1257
|
name: 'module-federation-vite',
|
|
1258
1258
|
enforce: 'post',
|
|
1259
1259
|
config: function config(_config, _ref) {
|
|
1260
|
-
var _config$optimizeDeps, _config$optimizeDeps2, _config$optimizeDeps3;
|
|
1260
|
+
var _config$optimizeDeps, _config$optimizeDeps2, _config$optimizeDeps3, _config$optimizeDeps4;
|
|
1261
1261
|
// TODO: singleton
|
|
1262
1262
|
_config.resolve.alias.push({
|
|
1263
1263
|
find: '@module-federation/runtime',
|
|
@@ -1266,6 +1266,7 @@ function federation(mfUserOptions) {
|
|
|
1266
1266
|
(_config$optimizeDeps = _config.optimizeDeps) == null || (_config$optimizeDeps = _config$optimizeDeps.include) == null || _config$optimizeDeps.push('@module-federation/runtime');
|
|
1267
1267
|
(_config$optimizeDeps2 = _config.optimizeDeps) == null || (_config$optimizeDeps2 = _config$optimizeDeps2.include) == null || _config$optimizeDeps2.push('__mf__virtual');
|
|
1268
1268
|
(_config$optimizeDeps3 = _config.optimizeDeps) == null || (_config$optimizeDeps3 = _config$optimizeDeps3.needsInterop) == null || _config$optimizeDeps3.push('__mf__virtual');
|
|
1269
|
+
(_config$optimizeDeps4 = _config.optimizeDeps) == null || (_config$optimizeDeps4 = _config$optimizeDeps4.needsInterop) == null || _config$optimizeDeps4.push(getLocalSharedImportMapPath());
|
|
1269
1270
|
}
|
|
1270
1271
|
}], Manifest());
|
|
1271
1272
|
}
|
package/lib/index.esm.js
CHANGED
|
@@ -360,7 +360,7 @@ function normalizeModuleFederationOptions(options) {
|
|
|
360
360
|
dev: options.dev,
|
|
361
361
|
dts: options.dts,
|
|
362
362
|
getPublicPath: options.getPublicPath,
|
|
363
|
-
shareStrategy: options.shareStrategy
|
|
363
|
+
shareStrategy: options.shareStrategy || 'version-first'
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
366
|
|
|
@@ -598,7 +598,7 @@ function generateRemoteEntry(options) {
|
|
|
598
598
|
return item[1];
|
|
599
599
|
}).join('\n') + "\n import exposesMap from \"" + VIRTUAL_EXPOSES + "\"\n import {usedShared, usedRemotes} from \"" + getLocalSharedImportMapPath() + "\"\n import {\n initResolve\n } from \"" + virtualRuntimeInitStatus.getImportId() + "\"\n async function init(shared = {}) {\n const initRes = runtimeInit({\n name: " + JSON.stringify(options.name) + ",\n remotes: usedRemotes,\n shared: usedShared,\n plugins: [" + pluginImportNames.map(function (item) {
|
|
600
600
|
return item[0] + "()";
|
|
601
|
-
}).join(', ') + "],\n " + (options.shareStrategy ? "shareStrategy: " + options.shareStrategy : '') + "\n });\n initRes.initShareScopeMap('" + options.shareScope + "', shared);\n initResolve(initRes)\n return initRes\n }\n\n function getExposes(moduleName) {\n if (!(moduleName in exposesMap)) throw new Error(`Module ${moduleName} does not exist in container.`)\n return (exposesMap[moduleName])().then(res => () => res)\n }\n export {\n init,\n getExposes as get\n }\n ";
|
|
601
|
+
}).join(', ') + "],\n " + (options.shareStrategy ? "shareStrategy: '" + options.shareStrategy + "'" : '') + "\n });\n initRes.initShareScopeMap('" + options.shareScope + "', shared);\n try {\n await Promise.all(await initRes.initializeSharing('" + options.shareScope + "', {strategy: '" + options.shareStrategy + "'}));\n } catch (e) {\n console.error(e)\n }\n initResolve(initRes)\n return initRes\n }\n\n function getExposes(moduleName) {\n if (!(moduleName in exposesMap)) throw new Error(`Module ${moduleName} does not exist in container.`)\n return (exposesMap[moduleName])().then(res => () => res)\n }\n export {\n init,\n getExposes as get\n }\n ";
|
|
602
602
|
}
|
|
603
603
|
/**
|
|
604
604
|
* Inject entry file, automatically init when used as host,
|
|
@@ -957,13 +957,13 @@ function pluginModuleParseEnd (excludeFn) {
|
|
|
957
957
|
apply: 'build',
|
|
958
958
|
moduleParsed: function moduleParsed(module) {
|
|
959
959
|
var id = module.id;
|
|
960
|
-
if (excludeFn(id)) {
|
|
961
|
-
return;
|
|
962
|
-
}
|
|
963
960
|
if (id === VIRTUAL_EXPOSES) {
|
|
964
961
|
// When the entry JS file is empty and only contains exposes export code, it’s necessary to wait for the exposes modules to be resolved in order to collect the dependencies being used.
|
|
965
962
|
exposesParseEnd = true;
|
|
966
963
|
}
|
|
964
|
+
if (excludeFn(id)) {
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
967
|
parseEndSet.add(id);
|
|
968
968
|
if (exposesParseEnd && parseStartSet.size === parseEndSet.size) {
|
|
969
969
|
_resolve(1);
|
|
@@ -1227,14 +1227,14 @@ function federation(mfUserOptions) {
|
|
|
1227
1227
|
entryName: 'virtualExposes',
|
|
1228
1228
|
entryPath: VIRTUAL_EXPOSES
|
|
1229
1229
|
}), [pluginProxyRemoteEntry(), pluginProxyRemotes(options)], pluginModuleParseEnd(function (id) {
|
|
1230
|
-
return id.includes(getHostAutoInitImportId()) || id.includes(REMOTE_ENTRY_ID) || id.includes(getLocalSharedImportMapPath());
|
|
1230
|
+
return id.includes(getHostAutoInitImportId()) || id.includes(REMOTE_ENTRY_ID) || id.includes(VIRTUAL_EXPOSES) || id.includes(getLocalSharedImportMapPath());
|
|
1231
1231
|
}), proxySharedModule({
|
|
1232
1232
|
shared: shared
|
|
1233
1233
|
}), [PluginDevProxyModuleTopLevelAwait(), {
|
|
1234
1234
|
name: 'module-federation-vite',
|
|
1235
1235
|
enforce: 'post',
|
|
1236
1236
|
config: function config(_config, _ref) {
|
|
1237
|
-
var _config$optimizeDeps, _config$optimizeDeps2, _config$optimizeDeps3;
|
|
1237
|
+
var _config$optimizeDeps, _config$optimizeDeps2, _config$optimizeDeps3, _config$optimizeDeps4;
|
|
1238
1238
|
// TODO: singleton
|
|
1239
1239
|
_config.resolve.alias.push({
|
|
1240
1240
|
find: '@module-federation/runtime',
|
|
@@ -1243,6 +1243,7 @@ function federation(mfUserOptions) {
|
|
|
1243
1243
|
(_config$optimizeDeps = _config.optimizeDeps) == null || (_config$optimizeDeps = _config$optimizeDeps.include) == null || _config$optimizeDeps.push('@module-federation/runtime');
|
|
1244
1244
|
(_config$optimizeDeps2 = _config.optimizeDeps) == null || (_config$optimizeDeps2 = _config$optimizeDeps2.include) == null || _config$optimizeDeps2.push('__mf__virtual');
|
|
1245
1245
|
(_config$optimizeDeps3 = _config.optimizeDeps) == null || (_config$optimizeDeps3 = _config$optimizeDeps3.needsInterop) == null || _config$optimizeDeps3.push('__mf__virtual');
|
|
1246
|
+
(_config$optimizeDeps4 = _config.optimizeDeps) == null || (_config$optimizeDeps4 = _config$optimizeDeps4.needsInterop) == null || _config$optimizeDeps4.push(getLocalSharedImportMapPath());
|
|
1246
1247
|
}
|
|
1247
1248
|
}], Manifest());
|
|
1248
1249
|
}
|
package/lib/index.modern.js
CHANGED
|
@@ -333,7 +333,7 @@ function normalizeModuleFederationOptions(options) {
|
|
|
333
333
|
dev: options.dev,
|
|
334
334
|
dts: options.dts,
|
|
335
335
|
getPublicPath: options.getPublicPath,
|
|
336
|
-
shareStrategy: options.shareStrategy
|
|
336
|
+
shareStrategy: options.shareStrategy || 'version-first'
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
339
|
|
|
@@ -663,9 +663,14 @@ function generateRemoteEntry(options) {
|
|
|
663
663
|
remotes: usedRemotes,
|
|
664
664
|
shared: usedShared,
|
|
665
665
|
plugins: [${pluginImportNames.map(item => `${item[0]}()`).join(', ')}],
|
|
666
|
-
${options.shareStrategy ? `shareStrategy: ${options.shareStrategy}` : ''}
|
|
666
|
+
${options.shareStrategy ? `shareStrategy: '${options.shareStrategy}'` : ''}
|
|
667
667
|
});
|
|
668
668
|
initRes.initShareScopeMap('${options.shareScope}', shared);
|
|
669
|
+
try {
|
|
670
|
+
await Promise.all(await initRes.initializeSharing('${options.shareScope}', {strategy: '${options.shareStrategy}'}));
|
|
671
|
+
} catch (e) {
|
|
672
|
+
console.error(e)
|
|
673
|
+
}
|
|
669
674
|
initResolve(initRes)
|
|
670
675
|
return initRes
|
|
671
676
|
}
|
|
@@ -1015,13 +1020,13 @@ function pluginModuleParseEnd (excludeFn) {
|
|
|
1015
1020
|
apply: 'build',
|
|
1016
1021
|
moduleParsed(module) {
|
|
1017
1022
|
const id = module.id;
|
|
1018
|
-
if (excludeFn(id)) {
|
|
1019
|
-
return;
|
|
1020
|
-
}
|
|
1021
1023
|
if (id === VIRTUAL_EXPOSES) {
|
|
1022
1024
|
// When the entry JS file is empty and only contains exposes export code, it’s necessary to wait for the exposes modules to be resolved in order to collect the dependencies being used.
|
|
1023
1025
|
exposesParseEnd = true;
|
|
1024
1026
|
}
|
|
1027
|
+
if (excludeFn(id)) {
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1025
1030
|
parseEndSet.add(id);
|
|
1026
1031
|
if (exposesParseEnd && parseStartSet.size === parseEndSet.size) {
|
|
1027
1032
|
_resolve(1);
|
|
@@ -1271,7 +1276,7 @@ function federation(mfUserOptions) {
|
|
|
1271
1276
|
entryName: 'virtualExposes',
|
|
1272
1277
|
entryPath: VIRTUAL_EXPOSES
|
|
1273
1278
|
}), pluginProxyRemoteEntry(), pluginProxyRemotes(options), ...pluginModuleParseEnd(id => {
|
|
1274
|
-
return id.includes(getHostAutoInitImportId()) || id.includes(REMOTE_ENTRY_ID) || id.includes(getLocalSharedImportMapPath());
|
|
1279
|
+
return id.includes(getHostAutoInitImportId()) || id.includes(REMOTE_ENTRY_ID) || id.includes(VIRTUAL_EXPOSES) || id.includes(getLocalSharedImportMapPath());
|
|
1275
1280
|
}), ...proxySharedModule({
|
|
1276
1281
|
shared
|
|
1277
1282
|
}), PluginDevProxyModuleTopLevelAwait(), {
|
|
@@ -1280,7 +1285,7 @@ function federation(mfUserOptions) {
|
|
|
1280
1285
|
config(config, {
|
|
1281
1286
|
command: _command
|
|
1282
1287
|
}) {
|
|
1283
|
-
var _config$optimizeDeps, _config$optimizeDeps2, _config$optimizeDeps3;
|
|
1288
|
+
var _config$optimizeDeps, _config$optimizeDeps2, _config$optimizeDeps3, _config$optimizeDeps4;
|
|
1284
1289
|
// TODO: singleton
|
|
1285
1290
|
config.resolve.alias.push({
|
|
1286
1291
|
find: '@module-federation/runtime',
|
|
@@ -1289,6 +1294,7 @@ function federation(mfUserOptions) {
|
|
|
1289
1294
|
(_config$optimizeDeps = config.optimizeDeps) == null || (_config$optimizeDeps = _config$optimizeDeps.include) == null || _config$optimizeDeps.push('@module-federation/runtime');
|
|
1290
1295
|
(_config$optimizeDeps2 = config.optimizeDeps) == null || (_config$optimizeDeps2 = _config$optimizeDeps2.include) == null || _config$optimizeDeps2.push('__mf__virtual');
|
|
1291
1296
|
(_config$optimizeDeps3 = config.optimizeDeps) == null || (_config$optimizeDeps3 = _config$optimizeDeps3.needsInterop) == null || _config$optimizeDeps3.push('__mf__virtual');
|
|
1297
|
+
(_config$optimizeDeps4 = config.optimizeDeps) == null || (_config$optimizeDeps4 = _config$optimizeDeps4.needsInterop) == null || _config$optimizeDeps4.push(getLocalSharedImportMapPath());
|
|
1292
1298
|
}
|
|
1293
1299
|
}, ...Manifest()];
|
|
1294
1300
|
}
|
package/lib/index.umd.js
CHANGED
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
dev: options.dev,
|
|
382
382
|
dts: options.dts,
|
|
383
383
|
getPublicPath: options.getPublicPath,
|
|
384
|
-
shareStrategy: options.shareStrategy
|
|
384
|
+
shareStrategy: options.shareStrategy || 'version-first'
|
|
385
385
|
};
|
|
386
386
|
}
|
|
387
387
|
|
|
@@ -619,7 +619,7 @@
|
|
|
619
619
|
return item[1];
|
|
620
620
|
}).join('\n') + "\n import exposesMap from \"" + VIRTUAL_EXPOSES + "\"\n import {usedShared, usedRemotes} from \"" + getLocalSharedImportMapPath() + "\"\n import {\n initResolve\n } from \"" + virtualRuntimeInitStatus.getImportId() + "\"\n async function init(shared = {}) {\n const initRes = runtimeInit({\n name: " + JSON.stringify(options.name) + ",\n remotes: usedRemotes,\n shared: usedShared,\n plugins: [" + pluginImportNames.map(function (item) {
|
|
621
621
|
return item[0] + "()";
|
|
622
|
-
}).join(', ') + "],\n " + (options.shareStrategy ? "shareStrategy: " + options.shareStrategy : '') + "\n });\n initRes.initShareScopeMap('" + options.shareScope + "', shared);\n initResolve(initRes)\n return initRes\n }\n\n function getExposes(moduleName) {\n if (!(moduleName in exposesMap)) throw new Error(`Module ${moduleName} does not exist in container.`)\n return (exposesMap[moduleName])().then(res => () => res)\n }\n export {\n init,\n getExposes as get\n }\n ";
|
|
622
|
+
}).join(', ') + "],\n " + (options.shareStrategy ? "shareStrategy: '" + options.shareStrategy + "'" : '') + "\n });\n initRes.initShareScopeMap('" + options.shareScope + "', shared);\n try {\n await Promise.all(await initRes.initializeSharing('" + options.shareScope + "', {strategy: '" + options.shareStrategy + "'}));\n } catch (e) {\n console.error(e)\n }\n initResolve(initRes)\n return initRes\n }\n\n function getExposes(moduleName) {\n if (!(moduleName in exposesMap)) throw new Error(`Module ${moduleName} does not exist in container.`)\n return (exposesMap[moduleName])().then(res => () => res)\n }\n export {\n init,\n getExposes as get\n }\n ";
|
|
623
623
|
}
|
|
624
624
|
/**
|
|
625
625
|
* Inject entry file, automatically init when used as host,
|
|
@@ -978,13 +978,13 @@
|
|
|
978
978
|
apply: 'build',
|
|
979
979
|
moduleParsed: function moduleParsed(module) {
|
|
980
980
|
var id = module.id;
|
|
981
|
-
if (excludeFn(id)) {
|
|
982
|
-
return;
|
|
983
|
-
}
|
|
984
981
|
if (id === VIRTUAL_EXPOSES) {
|
|
985
982
|
// When the entry JS file is empty and only contains exposes export code, it’s necessary to wait for the exposes modules to be resolved in order to collect the dependencies being used.
|
|
986
983
|
exposesParseEnd = true;
|
|
987
984
|
}
|
|
985
|
+
if (excludeFn(id)) {
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
988
|
parseEndSet.add(id);
|
|
989
989
|
if (exposesParseEnd && parseStartSet.size === parseEndSet.size) {
|
|
990
990
|
_resolve(1);
|
|
@@ -1248,14 +1248,14 @@
|
|
|
1248
1248
|
entryName: 'virtualExposes',
|
|
1249
1249
|
entryPath: VIRTUAL_EXPOSES
|
|
1250
1250
|
}), [pluginProxyRemoteEntry(), pluginProxyRemotes(options)], pluginModuleParseEnd(function (id) {
|
|
1251
|
-
return id.includes(getHostAutoInitImportId()) || id.includes(REMOTE_ENTRY_ID) || id.includes(getLocalSharedImportMapPath());
|
|
1251
|
+
return id.includes(getHostAutoInitImportId()) || id.includes(REMOTE_ENTRY_ID) || id.includes(VIRTUAL_EXPOSES) || id.includes(getLocalSharedImportMapPath());
|
|
1252
1252
|
}), proxySharedModule({
|
|
1253
1253
|
shared: shared
|
|
1254
1254
|
}), [PluginDevProxyModuleTopLevelAwait(), {
|
|
1255
1255
|
name: 'module-federation-vite',
|
|
1256
1256
|
enforce: 'post',
|
|
1257
1257
|
config: function config(_config, _ref) {
|
|
1258
|
-
var _config$optimizeDeps, _config$optimizeDeps2, _config$optimizeDeps3;
|
|
1258
|
+
var _config$optimizeDeps, _config$optimizeDeps2, _config$optimizeDeps3, _config$optimizeDeps4;
|
|
1259
1259
|
// TODO: singleton
|
|
1260
1260
|
_config.resolve.alias.push({
|
|
1261
1261
|
find: '@module-federation/runtime',
|
|
@@ -1264,6 +1264,7 @@
|
|
|
1264
1264
|
(_config$optimizeDeps = _config.optimizeDeps) == null || (_config$optimizeDeps = _config$optimizeDeps.include) == null || _config$optimizeDeps.push('@module-federation/runtime');
|
|
1265
1265
|
(_config$optimizeDeps2 = _config.optimizeDeps) == null || (_config$optimizeDeps2 = _config$optimizeDeps2.include) == null || _config$optimizeDeps2.push('__mf__virtual');
|
|
1266
1266
|
(_config$optimizeDeps3 = _config.optimizeDeps) == null || (_config$optimizeDeps3 = _config$optimizeDeps3.needsInterop) == null || _config$optimizeDeps3.push('__mf__virtual');
|
|
1267
|
+
(_config$optimizeDeps4 = _config.optimizeDeps) == null || (_config$optimizeDeps4 = _config$optimizeDeps4.needsInterop) == null || _config$optimizeDeps4.push(getLocalSharedImportMapPath());
|
|
1267
1268
|
}
|
|
1268
1269
|
}], Manifest());
|
|
1269
1270
|
}
|
|
@@ -66,7 +66,7 @@ export interface NormalizedModuleFederationOptions {
|
|
|
66
66
|
manifest: ManifestOptions | boolean;
|
|
67
67
|
dev?: boolean | PluginDevOptions;
|
|
68
68
|
dts?: boolean | PluginDtsOptions;
|
|
69
|
-
shareStrategy
|
|
69
|
+
shareStrategy: ShareStrategy;
|
|
70
70
|
getPublicPath?: string;
|
|
71
71
|
}
|
|
72
72
|
interface PluginDevOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/vite",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Vite plugin for Module Federation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -9,21 +9,6 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"lib/**/*"
|
|
11
11
|
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"prepare": "husky install",
|
|
14
|
-
"fmt": "prettier --write src",
|
|
15
|
-
"fmt.check": "prettier --check src",
|
|
16
|
-
"format": "pretty-quick",
|
|
17
|
-
"dev": "microbundle watch --no-sourcemap --compress=false",
|
|
18
|
-
"build": "rimraf lib && microbundle --no-sourcemap --compress=false",
|
|
19
|
-
"dev-rv": "pnpm -filter 'examples-rust-vite*' run dev",
|
|
20
|
-
"preview-rv": "pnpm -filter 'examples-rust-vite*' run preview",
|
|
21
|
-
"dev-vv": "pnpm -filter 'examples-vite-vite*' run dev",
|
|
22
|
-
"dev-nv": "pnpm -filter 'examples-nuxt-vite-host' -filter 'examples-vite-vite-remote' run dev",
|
|
23
|
-
"preview-vv": "pnpm -filter 'examples-vite-vite*' run preview",
|
|
24
|
-
"multi-example": "pnpm --filter \"multi-example-*\" run start",
|
|
25
|
-
"test": "vitest"
|
|
26
|
-
},
|
|
27
12
|
"repository": {
|
|
28
13
|
"type": "git",
|
|
29
14
|
"url": "git+https://github.com/module-federation/vite.git"
|
|
@@ -43,23 +28,40 @@
|
|
|
43
28
|
"url": "https://github.com/module-federation/vite/issues"
|
|
44
29
|
},
|
|
45
30
|
"homepage": "https://github.com/module-federation/vite#readme",
|
|
46
|
-
"packageManager": "pnpm@9.1.3",
|
|
47
31
|
"dependencies": {
|
|
48
32
|
"@module-federation/runtime": "^0.6.8",
|
|
49
33
|
"@rollup/pluginutils": "^5.1.0",
|
|
50
34
|
"defu": "^6.1.4",
|
|
51
35
|
"estree-walker": "^2",
|
|
52
36
|
"magic-string": "^0.30.11",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
37
|
+
"vitest": "^2.1.1",
|
|
38
|
+
"pathe": "^1.1.2"
|
|
55
39
|
},
|
|
56
40
|
"devDependencies": {
|
|
41
|
+
"@playwright/test": "^1.47.2",
|
|
42
|
+
"@types/node": "^22.7.4",
|
|
57
43
|
"husky": "^8.0.3",
|
|
58
44
|
"microbundle": "^0.15.1",
|
|
59
45
|
"mime-types": "^2.1.35",
|
|
60
46
|
"prettier": "3.3.3",
|
|
61
47
|
"pretty-quick": "^4.0.0",
|
|
62
48
|
"rimraf": "^6.0.1",
|
|
63
|
-
"vite": "^5.4.3"
|
|
49
|
+
"vite": "^5.4.3",
|
|
50
|
+
"wait-on": "^8.0.1"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"fmt": "prettier --write src",
|
|
54
|
+
"fmt.check": "prettier --check src",
|
|
55
|
+
"format": "pretty-quick",
|
|
56
|
+
"dev": "microbundle watch --no-sourcemap --compress=false",
|
|
57
|
+
"build": "rimraf lib && microbundle --no-sourcemap --compress=false",
|
|
58
|
+
"dev-rv": "pnpm -filter 'examples-rust-vite*' run dev",
|
|
59
|
+
"preview-rv": "pnpm -filter 'examples-rust-vite*' run preview",
|
|
60
|
+
"dev-vv": "pnpm -filter 'examples-vite-vite*' run dev",
|
|
61
|
+
"dev-nv": "pnpm -filter 'examples-nuxt-vite-host' -filter 'examples-vite-vite-remote' run dev",
|
|
62
|
+
"preview-vv": "pnpm -filter 'examples-vite-vite*' run preview",
|
|
63
|
+
"multi-example": "pnpm --filter \"multi-example-*\" --parallel run start",
|
|
64
|
+
"test": "vitest",
|
|
65
|
+
"e2e": "playwright test"
|
|
64
66
|
}
|
|
65
|
-
}
|
|
67
|
+
}
|