@@ -3,27 +3,32 @@ import AntdDayjsWebpackPlugin from 'antd-dayjs-webpack-plugin';
33import  routeConfig  from  './routeConfig' ; 
44
55export  default  defineConfig ( { 
6+   antd : { } , 
7+   esbuild : { } , 
8+   // 配置具体含义见:https://github.com/umijs/umi-webpack-bundle-analyzer#options-for-plugin 
9+   analyze : { 
10+     analyzerMode : 'server' , 
11+     analyzerPort : 8888 , 
12+     openAnalyzer : true , 
13+     // generate stats file while ANALYZE_DUMP exist 
14+     generateStatsFile : false , 
15+     statsFilename : 'stats.json' , 
16+     logLevel : 'info' , 
17+     defaultSizes : 'parsed' ,  // stat  // gzip 
18+   } , 
619  dynamicImport : { 
720    loading : '@/components/LoadingPage/index' , 
821  } , 
9-   outputPath : 'build' , 
10-   antd : { } , 
11-   esbuild : { } , 
12-   dynamicImportSyntax : { } , 
13-   hash : true , 
14-   routes : routeConfig , 
15-   metas : [ 
16-     {  name : 'msapplication-TileColor' ,  content : '#da532c'  } , 
17-     {  name : 'theme-color' ,  content : '#ffffff'  } , 
18-   ] , 
1922  externals : { 
2023    react : 'window.React' , 
2124    'react-dom' : 'window.ReactDOM' , 
2225  } , 
23-   scripts : [ 
24-     'https://cdn.bootcdn.net/ajax/libs/react/17.0.1/umd/react.production.min.js' , 
25-     'https://cdn.bootcdn.net/ajax/libs/react-dom/17.0.1/umd/react-dom.production.min.js' , 
26-   ] , 
26+   hash : true , 
27+   history : { 
28+     type : 'hash' , 
29+   } , 
30+   ignoreMomentLocale : true , 
31+   inlineLimit : 10 , 
2732  links : [ 
2833    { 
2934      rel : 'apple-touch-icon' , 
@@ -49,28 +54,16 @@ export default defineConfig({
4954      href : '//at.alicdn.com/t/font_1905159_jylqduh3ufd.css' , 
5055    } , 
5156  ] , 
52-   inlineLimit : 10 , 
53-   chunks : [ 'vendors' ,  'umi' ] , 
57+   scripts : [ 
58+     'https://cdn.bootcdn.net/ajax/libs/react/17.0.1/umd/react.production.min.js' , 
59+     'https://cdn.bootcdn.net/ajax/libs/react-dom/17.0.1/umd/react-dom.production.min.js' , 
60+   ] , 
61+   outputPath : 'build' , 
62+   routes : routeConfig , 
63+   theme : { } , 
64+   title : 'PC端开发模板' , 
65+   webpack5 : { } , 
5466  chainWebpack ( config )  { 
5567    config . plugin ( 'dayjs' ) . use ( AntdDayjsWebpackPlugin ) ; 
56-     config . merge ( { 
57-       optimization : { 
58-         splitChunks : { 
59-           chunks : 'all' , 
60-           automaticNameDelimiter : '.' , 
61-           name : true , 
62-           minSize : 30000 , 
63-           minChunks : 1 , 
64-           cacheGroups : { 
65-             vendors : { 
66-               name : 'vendors' , 
67-               chunks : 'all' , 
68-               test : / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] / , 
69-               priority : - 12 , 
70-             } , 
71-           } , 
72-         } , 
73-       } , 
74-     } ) ; 
7568  } , 
7669} ) ; 
0 commit comments