{
proxy: {
'/api': {
target: 'http://server-ip:8080/',
changeOrigin: true,
},
},
dynamicImport: {
loading: "@/components/Loading"
},
analyze: {
analyzerMode: 'server',
analyzerPort: 8888,
openAnalyzer: true,
generateStatsFile: false,
statsFilename: 'stats.json',
logLevel: 'info',
defaultSizes: 'parsed',
},
chunks: ['react', 'react-dom', 'echarts', 'antd', 'vendors', 'umi'],
chainWebpack(config) {
config.optimization.splitChunks({
chunks: "all",
automaticNameDelimiter: "~",
name: true,
minSize: 30000,
minChunks: 1,
cacheGroups: {
react: {
name: "react",
test: /[\\/]node_modules[\\/](react)[\\/]/,
priority: -9,
enforce: true,
},
reactDom: {
name: "react-dom",
test: /[\\/]node_modules[\\/](react-dom)[\\/]/,
priority: -9,
enforce: true,
},
echarts: {
name: "echarts",
test: /[\\/]node_modules[\\/](echarts)[\\/]/,
priority: -9,
enforce: true,
},
antd: {
name: "antd",
test: /[\\/]node_modules[\\/](@ant-design|antd|antd-mobile)[\\/]/,
priority: -10,
enforce: true,
},
vendors: {
name: "vendors",
test: /[\\/]node_modules[\\/]/,
priority: -11,
enforce: true,
},
},
});
},
}