module federation
This commit is contained in:
50
kms/kms-frontend/craco.config.js
Normal file
50
kms/kms-frontend/craco.config.js
Normal file
@ -0,0 +1,50 @@
|
||||
const { ModuleFederationPlugin } = require("webpack").container;
|
||||
|
||||
module.exports = {
|
||||
devServer: {
|
||||
port: 3001,
|
||||
historyApiFallback: true,
|
||||
},
|
||||
webpack: {
|
||||
plugins: {
|
||||
add: [
|
||||
new ModuleFederationPlugin({
|
||||
name: 'kms',
|
||||
filename: 'remoteEntry.js',
|
||||
exposes: {
|
||||
'./App': './src/federated/KMSApp',
|
||||
'./SearchProvider': './src/federated/SearchProvider',
|
||||
},
|
||||
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