“提供者”的 Webpack 配置:
new ModuleFederationPlugin({
...
remotes: {
...
},
exposes: {
"./api-helpers": "./src/api-helpers",
"./menu-items": "./src/menu-items",
},
shared: {
...
},
我在消費者身上得到了這個:

這與中的hiphen有關menu-items嗎?
uj5u.com熱心網友回復:
我的消費者遙控器配置不正確:
'store': 'store@http://localhost:4019/remoteEntry.js',
'api-helpers': 'store@http://localhost:4002/remoteEntry.js'
將第二行更改為以下內容可解決此問題。
'api-helpers': 'api-helpers@http://localhost:4002/remoteEntry.js'
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/454936.html
標籤:网页包 webpack-module-federation
