Skip to content

Commit fb04afc

Browse files
author
chj_damon
committed
feat: 开启msfu
修改require写法为import写法 bump依赖版本
1 parent b40013c commit fb04afc

File tree

11 files changed

+1416
-13707
lines changed

11 files changed

+1416
-13707
lines changed

config/config.prod.ts

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,32 @@ import AntdDayjsWebpackPlugin from 'antd-dayjs-webpack-plugin';
33
import routeConfig from './routeConfig';
44

55
export 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: /[\\/]node_modules[\\/]/,
69-
priority: -12,
70-
},
71-
},
72-
},
73-
},
74-
});
7568
},
7669
});

config/config.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ import AntdDayjsWebpackPlugin from 'antd-dayjs-webpack-plugin';
33
import routeConfig from './routeConfig';
44

55
export default defineConfig({
6-
antd: {},
6+
antd: {
7+
dark: false,
8+
compact: false,
9+
},
710
esbuild: {},
811
dynamicImportSyntax: {},
12+
fastRefresh: {},
913
hash: true,
10-
outputPath: 'build',
11-
routes: routeConfig,
12-
metas: [
13-
{ name: 'msapplication-TileColor', content: '#da532c' },
14-
{ name: 'theme-color', content: '#ffffff' },
15-
],
14+
history: {
15+
type: 'hash',
16+
},
17+
ignoreMomentLocale: true,
18+
mfsu: {},
1619
links: [
1720
{
1821
rel: 'apple-touch-icon',
@@ -38,6 +41,11 @@ export default defineConfig({
3841
href: '//at.alicdn.com/t/font_1905159_jylqduh3ufd.css',
3942
},
4043
],
44+
proxy: {},
45+
routes: routeConfig,
46+
theme: {},
47+
title: 'PC端开发模板',
48+
webpack5: {},
4149
chainWebpack(config) {
4250
config.plugin('dayjs').use(AntdDayjsWebpackPlugin);
4351
},

0 commit comments

Comments
 (0)