ModuleFederationPlugin
I have been asked to implement a ModuleFederationPlugin , I'm new to this all and I can't find any information on doing this with nuxt3. I am also using ssr: false if I add builder: 'webpack' or vite: false (stackoverflow) to the config it does not build. Any help appreciated please.
I have tried this in nuxt.config.ts
const { ModuleFederationPlugin } = require('webpack').container;
export default defineNuxtConfig({
app: {
baseURL: '/my_reports/'
},
ssr: false,
...
build: {
output: {
filename: 'remoteEntry.js',
},
plugins: [
new ModuleFederationPlugin({
name: 'my_report_module',
filename: 'remoteEntry.js',
exposes: {
'./my_reports': 'debug',
},
shared: {
vue: {
singleton: true,
},
},
}),
],
},
});
0 Replies