import { defineConfig } from 'umi';
export default defineConfig({
nodeModulesTransform: {
type: 'none',
},
theme: {
// 'primary-color': '#111D61', //更改主题色
// main_width: '1440px', //自定义全局样式变量
},
links: [{ rel: 'icon', href: '/favicon.ico' }], //图标
title: 'xxx管理系统',
//开启按需加载
dynamicImport: {},
// 开启按需加载后把 css 打包成一个文件
chainWebpack(config: any) {
config.optimization.splitChunks({
cacheGroups: {
styles: {
name: 'styles',
test: /\.(css|scss)$/,
chunks: 'async',
minChunks: 1,
minSize: 0,
},
},
});
},
antd: {}, //启用后自动配置 babel-plugin-import实现antd按需加载 false 表示不开启 {} 表示开启
routes: [
{ path: '/', redirect: '/login' },
{ path: '/login', component: '@/pages/Login/index.jsx' }, //登录
{ path: '/404', component: '@/pages/404.jsx' }, //404
],
hash: true, //开启打包文件的hash值后缀,
//跨域
proxy: {
'/api': {
target: 'url', //跨域地址本地使用
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
fastRefresh: {},
});
umi+dva打包配置/跨域处理//图标修改
最新推荐文章于 2023-08-08 17:15:21 发布