-
Notifications
You must be signed in to change notification settings - Fork 25
/
.umirc.js
71 lines (69 loc) · 1.69 KB
/
.umirc.js
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
69
70
71
// ref: https://umijs.org/config/
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';
const chainWebpack = (config, { webpack }) => {
config.plugin('monaco-editor').use(MonacoWebpackPlugin, [
{
language: ['json', 'html', 'javascript', 'typescript'],
},
]);
};
export default {
treeShaking: true,
publicPath: './',
routes: [
{ path: '/', redirect: '/login' },
{ path: '/drag', component: '../pages/DragView' },
{ path: '/login', component: '../pages/login' },
{ path: '/register', component: '../pages/register' },
{ path: '/:id/componentDrag', component: '../pages/componentDrag' },
{
path: '/',
component: '../layout/basicLayout',
routes: [
{
path: '/org',
component: '../pages/organizationSquare/index',
},
{
path: '/comsquare',
component: '../pages/componentSquare/index',
},
{
path: '/codePreview',
component: '../pages/codePreview/index'
},
],
},
],
plugins: [
// ref: https://umijs.org/plugin/umi-plugin-react.html
[
'umi-plugin-react',
{
antd: true,
dva: true,
dynamicImport: { webpackChunkName: true },
title: '前端可视化-reactDrag',
dll: false,
routes: {
exclude: [
/models\//,
/services\//,
/model\.(t|j)sx?$/,
/service\.(t|j)sx?$/,
/components\//,
/common\//,
],
},
},
],
],
proxy: {
'/api': {
target: 'http://localhost:3000/api',
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
chainWebpack,
};