module federation
This commit is contained in:
49
web/craco.config.js
Normal file
49
web/craco.config.js
Normal file
@ -0,0 +1,49 @@
|
||||
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",
|
||||
},
|
||||
}),
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user