-
Notifications
You must be signed in to change notification settings - Fork 7
/
.umirc.ts
70 lines (69 loc) · 1.95 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
69
70
import path from 'path';
import { defineConfig } from 'umi';
export default defineConfig({
base: '/designer',
publicPath: '/designer/',
outputPath: './dist/designer/',
title: 'Tango Playground',
routes: [
{
exact: true,
path: '/',
component: 'index',
name: '首页',
},
{
exact: false,
path: '/:name',
component: 'index',
name: '首页',
},
{ path: '/mail', component: 'mail' },
{ path: '/docs', component: 'docs' },
],
npmClient: 'yarn',
mfsu: false,
codeSplitting: false,
externals: {
react: 'React',
'react-dom': 'ReactDOM',
'styled-components': 'styled',
moment: 'moment',
antd: 'antd',
},
headScripts: [
'https://unpkg.com/[email protected]/umd/react.development.js',
'https://unpkg.com/[email protected]/umd/react-dom.development.js',
'https://unpkg.com/[email protected]/umd/react-is.production.min.js',
'https://unpkg.com/moment/min/moment-with-locales.js',
'https://unpkg.com/[email protected]/dist/styled-components.js',
'https://unpkg.com/[email protected]/dist/antd-with-locales.min.js',
'https://unpkg.com/[email protected]/standalone.js',
'https://unpkg.com/[email protected]/parser-babel.js',
],
https: {
key: path.resolve(__dirname, 'local.netease.com-key.pem'),
cert: path.resolve(__dirname, 'local.netease.com.pem'),
http2: false,
},
jsMinifier: 'terser',
devtool: 'source-map',
chainWebpack: (config: any) => {
// @see https://github.com/graphql/graphql-js/issues/1272#issuecomment-393903706
config.module
.rule('mjs')
.test(/\.mjs$/)
.include.add(/node_modules/)
.end()
.type('javascript/auto');
return config;
},
monorepoRedirect: {},
define: {
'process.env.SANDBOX_BUNDLER_URL': process.env.SANDBOX_BUNDLER_URL ?? (
process.env.NODE_ENV === 'development'
? `https://${process.env.HOST || 'local.netease.com'}:8443`
: null
),
}
});