I am trying to create the most basic webpack module federation proof of concept example.
Webpack config in the host app:
...
plugins: [
new ModuleFederationPlugin({
name: "hostApp",
remotes: {
libApp: `libApp@http://localhost:3000/libApp`,
},
}),
],
...
Webpack config in the dependency app:
...
plugins: [
new ModuleFederationPlugin({
name: "libApp",
filename: "libApp.js",
exposes: {
"./moduleA": "./src/moduleA",
"./moduleB": "./src/moduleB",
}
})
],
...
What is wrong with this configuration?
Also, is it possible to set up dependency app to export a single js file with all exposed modules included (as a single webpack module)?