|
@@ -1,43 +1,47 @@
|
|
|
// https://umijs.org/config/
|
|
// https://umijs.org/config/
|
|
|
-import { defineConfig } from 'umi';
|
|
|
|
|
-import defaultSettings from './defaultSettings';
|
|
|
|
|
-import proxy from './proxy';
|
|
|
|
|
-import routes from './routes';
|
|
|
|
|
-const { REACT_APP_ENV } = process.env;
|
|
|
|
|
|
|
+import { defineConfig } from 'umi'
|
|
|
|
|
+import defaultSettings from './defaultSettings'
|
|
|
|
|
+import proxy from './proxy'
|
|
|
|
|
+import routes from './routes'
|
|
|
|
|
+const { REACT_APP_ENV } = process.env
|
|
|
export default defineConfig({
|
|
export default defineConfig({
|
|
|
hash: true,
|
|
hash: true,
|
|
|
antd: {},
|
|
antd: {},
|
|
|
dva: {
|
|
dva: {
|
|
|
- hmr: true,
|
|
|
|
|
|
|
+ hmr: true
|
|
|
},
|
|
},
|
|
|
history: {
|
|
history: {
|
|
|
- type: 'browser',
|
|
|
|
|
|
|
+ type: 'browser'
|
|
|
},
|
|
},
|
|
|
locale: {
|
|
locale: {
|
|
|
// default zh-CN
|
|
// default zh-CN
|
|
|
default: 'zh-CN',
|
|
default: 'zh-CN',
|
|
|
antd: false,
|
|
antd: false,
|
|
|
// default true, when it is true, will use `navigator.language` overwrite default
|
|
// default true, when it is true, will use `navigator.language` overwrite default
|
|
|
- baseNavigator: false,
|
|
|
|
|
|
|
+ baseNavigator: false
|
|
|
},
|
|
},
|
|
|
dynamicImport: {
|
|
dynamicImport: {
|
|
|
- loading: '@/components/PageLoading/index',
|
|
|
|
|
|
|
+ loading: '@/components/PageLoading/index'
|
|
|
},
|
|
},
|
|
|
targets: {
|
|
targets: {
|
|
|
- ie: 11,
|
|
|
|
|
|
|
+ ie: 11
|
|
|
},
|
|
},
|
|
|
// umi routes: https://umijs.org/docs/routing
|
|
// umi routes: https://umijs.org/docs/routing
|
|
|
routes,
|
|
routes,
|
|
|
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
|
|
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
|
|
|
theme: {
|
|
theme: {
|
|
|
- 'primary-color': defaultSettings.primaryColor,
|
|
|
|
|
|
|
+ 'primary-color': defaultSettings.primaryColor
|
|
|
},
|
|
},
|
|
|
title: false,
|
|
title: false,
|
|
|
ignoreMomentLocale: true,
|
|
ignoreMomentLocale: true,
|
|
|
proxy: proxy[REACT_APP_ENV || 'dev'],
|
|
proxy: proxy[REACT_APP_ENV || 'dev'],
|
|
|
manifest: {
|
|
manifest: {
|
|
|
- basePath: '/',
|
|
|
|
|
|
|
+ basePath: '/'
|
|
|
},
|
|
},
|
|
|
exportStatic: {},
|
|
exportStatic: {},
|
|
|
esbuild: {},
|
|
esbuild: {},
|
|
|
-});
|
|
|
|
|
|
|
+ extraBabelPlugins: [
|
|
|
|
|
+ '@babel/plugin-proposal-nullish-coalescing-operator',
|
|
|
|
|
+ '@babel/plugin-proposal-optional-chaining'
|
|
|
|
|
+ ]
|
|
|
|
|
+})
|