@module-federation/vite 1.16.7 → 1.16.8
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/lib/index.js +7 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2116,7 +2116,9 @@ const addEntry = ({ entryName, entryPath, fileName, inject = "entry", forceClien
|
|
|
2116
2116
|
await Promise.allSettled(__mfRemotePreloads);` : `await initHost();`;
|
|
2117
2117
|
const importCode = `
|
|
2118
2118
|
(async () => {
|
|
2119
|
-
const
|
|
2119
|
+
const __mfHostInit = await ${importExpression(initSrc)};
|
|
2120
|
+
await __mfHostInit.__tla;
|
|
2121
|
+
const { initHost } = __mfHostInit;
|
|
2120
2122
|
${preloadBlock}
|
|
2121
2123
|
})().then(() => ${importExpression(entrySrc)});
|
|
2122
2124
|
`;
|
|
@@ -2477,7 +2479,7 @@ const REACT_REFRESH_PROXY_MODULE = [
|
|
|
2477
2479
|
].join("\n");
|
|
2478
2480
|
const reactAdapter = {
|
|
2479
2481
|
name: "react",
|
|
2480
|
-
pluginNames: ["vite:react-refresh", "vite:react-swc
|
|
2482
|
+
pluginNames: ["vite:react-refresh", "vite:react-swc"],
|
|
2481
2483
|
remote: { configureServer({ server }) {
|
|
2482
2484
|
let reactRefreshRuntime;
|
|
2483
2485
|
server.middlewares.use((req, res, next) => {
|
|
@@ -5164,7 +5166,9 @@ export default __mfShared.default ?? __mfShared;`
|
|
|
5164
5166
|
const optimizeDeps = config.optimizeDeps ??= {};
|
|
5165
5167
|
optimizeDeps.include ??= [];
|
|
5166
5168
|
optimizeDeps.exclude ??= [];
|
|
5167
|
-
|
|
5169
|
+
const shouldBypassOptimizeDep = isLitShare(key) || key === "react" && hasPackageDependency("react-redux", root);
|
|
5170
|
+
if (optimizeDeps.include.includes(key)) optimizeDeps.exclude = optimizeDeps.exclude.filter((dep) => dep !== key);
|
|
5171
|
+
else if (shouldBypassOptimizeDep) optimizeDeps.exclude.push(key);
|
|
5168
5172
|
else optimizeDeps.include.push(key);
|
|
5169
5173
|
for (const subpath of getCommonSharedSubpaths(key)) {
|
|
5170
5174
|
getLoadShareModulePath(subpath, isRolldown);
|