49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
const { ModuleFederationPlugin } = require("webpack").container;
|
|
|
|
module.exports = {
|
|
devServer: {
|
|
port: 3000,
|
|
historyApiFallback: true,
|
|
},
|
|
webpack: {
|
|
plugins: {
|
|
add: [
|
|
new ModuleFederationPlugin({
|
|
name: 'shell',
|
|
filename: 'remoteEntry.js',
|
|
remotes: {
|
|
kms: 'kms@http://localhost:3001/remoteEntry.js',
|
|
},
|
|
shared: {
|
|
react: {
|
|
singleton: true,
|
|
requiredVersion: '^19.1.1'
|
|
},
|
|
'react-dom': {
|
|
singleton: true,
|
|
requiredVersion: '^19.1.1'
|
|
},
|
|
'react-router-dom': {
|
|
singleton: true,
|
|
requiredVersion: '^7.8.2'
|
|
},
|
|
antd: {
|
|
singleton: true,
|
|
requiredVersion: '^5.27.1'
|
|
},
|
|
axios: {
|
|
singleton: true
|
|
}
|
|
},
|
|
}),
|
|
],
|
|
},
|
|
configure: (webpackConfig) => ({
|
|
...webpackConfig,
|
|
output: {
|
|
...webpackConfig.output,
|
|
publicPath: "auto",
|
|
},
|
|
}),
|
|
},
|
|
}; |