I'm looking to use a component from a remote application in my host application using module federation. Is it possible to dynamically change the remote url in the webpack.config file to include slugs which can change during runtime?
Webpack config file
plugins: [
new ModuleFederationPlugin(
{
name: 'MFE2',
filename:
'remoteEntry.js',
remotes: {
MFE1:
'MFE1@http://localhost:8083/remoteEntry.js',
},
}
),
new HtmlWebpackPlugin({
template:
'./public/index.html',
}),
],
From the example above i'd like to change the remote url to extract the component from localhost:8083/[slug]/remoteEntry.js
Not sure if module federation supports including components that are created based on the slug in the url?
Any help is appreciated!!