1
1
// https://umijs.org/config/
2
2
import { defineConfig } from 'umi' ;
3
+ import { join } from 'path' ;
4
+
3
5
import defaultSettings from './defaultSettings' ;
4
6
import proxy from './proxy' ;
5
7
import routes from './routes' ;
@@ -12,9 +14,13 @@ export default defineConfig({
12
14
dva : {
13
15
hmr : true ,
14
16
} ,
15
- history : {
16
- type : 'browser' ,
17
+ layout : {
18
+ // https://umijs.org/zh-CN/plugins/plugin-layout
19
+ locale : true ,
20
+ siderWidth : 208 ,
21
+ ...defaultSettings ,
17
22
} ,
23
+ // https://umijs.org/zh-CN/plugins/plugin-locale
18
24
locale : {
19
25
// default zh-CN
20
26
default : 'zh-CN' ,
@@ -23,7 +29,7 @@ export default defineConfig({
23
29
baseNavigator : true ,
24
30
} ,
25
31
dynamicImport : {
26
- loading : '@/components/PageLoading/index ' ,
32
+ loading : '@ant-design/pro-layout/es/PageLoading ' ,
27
33
} ,
28
34
targets : {
29
35
ie : 11 ,
@@ -34,14 +40,33 @@ export default defineConfig({
34
40
theme : {
35
41
'primary-color' : defaultSettings . primaryColor ,
36
42
} ,
43
+ // esbuild is father build tools
44
+ // https://umijs.org/plugins/plugin-esbuild
45
+ esbuild : { } ,
37
46
title : false ,
38
47
ignoreMomentLocale : true ,
39
48
proxy : proxy [ REACT_APP_ENV || 'dev' ] ,
40
49
manifest : {
41
50
basePath : '/' ,
42
51
} ,
43
- // 快速刷新功能 https://umijs.org/config#fastrefresh
52
+ // Fast Refresh 热更新
44
53
fastRefresh : { } ,
45
- esbuild : { } ,
54
+ openAPI : [
55
+ {
56
+ requestLibPath : "import { request } from 'umi'" ,
57
+ // 或者使用在线的版本
58
+ // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
59
+ schemaPath : join ( __dirname , 'oneapi.json' ) ,
60
+ mock : false ,
61
+ } ,
62
+ {
63
+ requestLibPath : "import { request } from 'umi'" ,
64
+ schemaPath : 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json' ,
65
+ projectName : 'swagger' ,
66
+ } ,
67
+ ] ,
68
+ nodeModulesTransform : { type : 'none' } ,
69
+ mfsu : { } ,
46
70
webpack5 : { } ,
71
+ exportStatic : { } ,
47
72
} ) ;
0 commit comments