-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.umirc.ts
68 lines (67 loc) · 1.51 KB
/
.umirc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { defineConfig } from '@umijs/max';
import devConfig from './devConfig';
import openapiConfig from './openapiConfig';
import prodConfig from './prodConfig';
let extraConfig = {};
switch (process.env.NODE_ENV) {
case 'production':
extraConfig = prodConfig;
break;
case 'api':
extraConfig = openapiConfig;
break;
default:
extraConfig = devConfig;
break;
}
console.log('env:', process.env.NODE_ENV);
const config = defineConfig({
// unocss
plugins: [require.resolve('@umijs/plugins/dist/unocss')],
unocss: {
watch: ['src/**/*.{ts,tsx,js,jsx}'],
},
// unocss end
// 二级目录+hash
history: {
type: 'hash',
},
publicPath:
process.env.NODE_ENV === 'production'
? '/umi-antd-tool/'
: '/umi-antd-tool/',
// 二级目录+hash end
// https://umijs.org/docs/max/antd
antd: {},
// https://umijs.org/docs/max/access
access: {},
// // https://umijs.org/docs/max/react-query
// reactQuery: {
// devtool: true,
// queryClient: true,
// },
// // https://umijs.org/docs/max/dva#%E9%85%8D%E7%BD%AE-dva
// dva: {
// },
// https://umijs.org/docs/max/data-flow
model: {},
// https://umijs.org/docs/max/data-flow
initialState: {},
// https://umijs.org/docs/max/request
request: {},
layout: {
title: '',
locale: false,
},
mfsu: {
// strategy: 'normal',
strategy: 'eager',
esbuild: true,
cacheDirectory: 'node_modules/.cache/mfsu',
},
npmClient: 'pnpm',
});
export default {
...config,
...extraConfig,
};