|
| 1 | +// https://umijs.org/config/ |
| 2 | +import { defineConfig } from 'umi'; |
| 3 | +import defaultSettings from './defaultSettings'; |
| 4 | +import proxy from './proxy'; |
| 5 | + |
| 6 | +const { REACT_APP_ENV } = process.env; |
| 7 | + |
| 8 | +export default defineConfig({ |
| 9 | + nodeModulesTransform: { |
| 10 | + type: 'none', |
| 11 | + exclude: [], |
| 12 | + }, |
| 13 | + history: { type: 'hash' }, |
| 14 | + dll: false, |
| 15 | + hash: true, |
| 16 | + antd: {}, |
| 17 | + dva: { |
| 18 | + hmr: true, |
| 19 | + }, |
| 20 | + // base: '/admin/', |
| 21 | + publicPath: '/admin/', |
| 22 | + // layout: { |
| 23 | + // name: 'Ant Design Pro', |
| 24 | + // locale: true, |
| 25 | + // }, |
| 26 | + locale: { |
| 27 | + // default zh-CN |
| 28 | + default: 'zh-CN', |
| 29 | + // default true, when it is true, will use `navigator.language` overwrite default |
| 30 | + antd: true, |
| 31 | + baseNavigator: true, |
| 32 | + }, |
| 33 | + // dynamicImport: { |
| 34 | + // loading: '@/components/PageLoading/index', |
| 35 | + // }, |
| 36 | + dynamicImport: false, |
| 37 | + targets: { |
| 38 | + ie: 11, |
| 39 | + }, |
| 40 | + // umi routes: https://umijs.org/docs/routing |
| 41 | + routes: [ |
| 42 | + { |
| 43 | + path: '/user', |
| 44 | + layout: false, |
| 45 | + routes: [ |
| 46 | + { |
| 47 | + name: 'login', |
| 48 | + path: '/user/login', |
| 49 | + component: './user/login', |
| 50 | + }, |
| 51 | + ], |
| 52 | + }, |
| 53 | + { |
| 54 | + component: '@/layouts/Index', |
| 55 | + routes: [ |
| 56 | + { |
| 57 | + path: '/quark', |
| 58 | + routes: [ |
| 59 | + { |
| 60 | + path: '/quark/engine', |
| 61 | + component: './Quark/Engine', |
| 62 | + }, |
| 63 | + ], |
| 64 | + }, |
| 65 | + { path: '/account', component: '../pages/Account/Settings/Info' }, |
| 66 | + { |
| 67 | + path: '/account/settings', |
| 68 | + component: '../pages/Account/Settings/Info', |
| 69 | + }, |
| 70 | + { |
| 71 | + path: '/account/settings/info', |
| 72 | + component: '../pages/Account/Settings/Info', |
| 73 | + }, |
| 74 | + { |
| 75 | + path: '/account/settings/security', |
| 76 | + component: '../pages/Account/Settings/Security', |
| 77 | + }, |
| 78 | + { |
| 79 | + path: '/', |
| 80 | + redirect: '/quark/engine?api=admin/dashboard/index', |
| 81 | + }, |
| 82 | + { |
| 83 | + component: './404', |
| 84 | + }, |
| 85 | + ], |
| 86 | + }, |
| 87 | + ], |
| 88 | + // Theme for antd: https://ant.design/docs/react/customize-theme-cn |
| 89 | + theme: { |
| 90 | + // ...darkTheme, |
| 91 | + 'primary-color': defaultSettings.primaryColor, |
| 92 | + }, |
| 93 | + // @ts-ignore |
| 94 | + title: false, |
| 95 | + ignoreMomentLocale: true, |
| 96 | + proxy: proxy[REACT_APP_ENV || 'dev'], |
| 97 | + manifest: { |
| 98 | + basePath: '/', |
| 99 | + }, |
| 100 | +}); |
0 commit comments