-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.umirc.ts
41 lines (38 loc) · 940 Bytes
/
.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
import { defineConfig } from 'umi';
import { Routes } from './src/router';
// @ts-ignore
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV);
export default defineConfig({
nodeModulesTransform: {
type: 'none',
},
dynamicImport: {},
analyze: {
analyzerMode: 'server',
analyzerPort: 8888,
openAnalyzer: true,
// generate stats file while ANALYZE_DUMP exist
generateStatsFile: false,
statsFilename: 'stats.json',
logLevel: 'info',
defaultSizes: 'parsed', // stat // gzip
},
routes: Routes,
title: false,
proxy: {
'/api/': {
target: 'http://127.0.0.1:7788',
changeOrigin: true,
pathRewrite: {
'^/api/': '',
},
},
},
headScripts: [
{
content: IS_PROD ? `window.sp_prefix = '{{.prefix}}';` : `window.sp_prefix = 'admin';`,
},
],
outputPath: 'simple_admin_templates',
publicPath: '/simple_admin_static/',
});