11import { IConfig , IPlugin } from 'umi-types' ;
2-
32import defaultSettings from './defaultSettings' ; // https://umijs.org/config/
3+
44import slash from 'slash2' ;
55import webpackPlugin from './plugin.config' ;
6-
76const { pwa, primaryColor } = defaultSettings ;
8-
97const plugins : IPlugin [ ] = [
108 [
119 'umi-plugin-react' ,
@@ -14,19 +12,12 @@ const plugins: IPlugin[] = [
1412 dva : {
1513 hmr : true ,
1614 } ,
17- locale : {
18- // default false
19- enable : true ,
20- // default zh-CN
21- default : 'zh-CN' ,
22- // default true, when it is true, will use `navigator.language` overwrite default
23- baseNavigator : true ,
15+ locale : true ,
16+ dynamicImport : {
17+ loadingComponent : './components/PageLoading/index' ,
18+ webpackChunkName : true ,
19+ level : 3 ,
2420 } ,
25- // dynamicImport: {
26- // loadingComponent: './components/PageLoading/index',
27- // webpackChunkName: true,
28- // level: 3,
29- // },
3021 pwa : pwa
3122 ? {
3223 workboxPluginMode : 'InjectManifest' ,
@@ -41,6 +32,7 @@ const plugins: IPlugin[] = [
4132 // include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'],
4233 // exclude: ['@babel/runtime', 'netlify-lambda'],
4334 // },
35+ dll : true ,
4436 } ,
4537 ] ,
4638 [
@@ -53,7 +45,6 @@ const plugins: IPlugin[] = [
5345 } ,
5446 ] ,
5547] ;
56-
5748export default {
5849 plugins,
5950 block : {
@@ -82,14 +73,29 @@ export default {
8273 path : '/' ,
8374 component : '../layouts/SecurityLayout' ,
8475 routes : [
85- { path : '/' , redirect : '/dashboard' } ,
86- { path : '/dashboard' , component : './Dashboard/Home' } ,
76+ {
77+ path : '/' ,
78+ redirect : '/dashboard' ,
79+ } ,
80+ {
81+ path : '/dashboard' ,
82+ component : './Dashboard/Home' ,
83+ } ,
8784 {
8885 path : '/system' ,
8986 routes : [
90- { path : '/system/menu' , component : './Menu/MenuList' } ,
91- { path : '/system/role' , component : './Role/RoleList' } ,
92- { path : '/system/user' , component : './User/UserList' } ,
87+ {
88+ path : '/system/menu' ,
89+ component : './Menu/MenuList' ,
90+ } ,
91+ {
92+ path : '/system/role' ,
93+ component : './Role/RoleList' ,
94+ } ,
95+ {
96+ path : '/system/user' ,
97+ component : './User/UserList' ,
98+ } ,
9399 ] ,
94100 } ,
95101 {
0 commit comments