In webpack.config.js
of app-shell
:
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ModuleFederationPlugin = require('webpack').container.ModuleFederationPlugin;
const path = require('path');
module.exports = {
mode: 'development',
devServer: {
port: 8080,
},
entry: './src/bootstrap.js',
output: {
publicPath: 'http://localhost:8080/',
},
plugins: [
new ModuleFederationPlugin({
name: 'app_shell',
remotes: {
analytics_app: 'analytics_app@http://localhost:8081/remoteEntry.js',
},
shared: require('./package.json').dependencies,
}),
new HtmlWebpackPlugin({ template: './public/index.html' }),
],
};