forked from maoxiaoquan/kite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkite.config.js
73 lines (70 loc) · 1.74 KB
/
kite.config.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
72
73
// 此文件是 kite 的总配置文件
const path = require('path')
const NODE_ENV = process.env.NODE_ENV || 'development'
const IS_NODE_ENV = process.env.NODE_ENV === 'development'
function ProcessCwd (val) {
return path.resolve(process.cwd(), val)
}
module.exports = {
version: '0.1',
theme: {
'font-family': 'Microsoft YaHei'
},
env: NODE_ENV,
publicStatic: ProcessCwd('static'),
client: {
port: 8081,
assetsSubDirectory: 'static',
proxy: {
target: `http://localhost:8086`, // client ssr
changeOrigin: true,
secure: false,
pathRewrite: {
'^/client': '/client'
}
},
assetsRoot: IS_NODE_ENV
? ProcessCwd('client/_client')
: ProcessCwd('static/_client'),
publicPath: IS_NODE_ENV ? '/' : '/_client/',
devtool: IS_NODE_ENV ? 'cheap-module-eval-source-map' : '#source-map',
dev: {
notifyOnErrors: true,
useEslint: true,
showEslintErrorsInOverlay: false,
cssSourceMap: true
}
},
admin: {
// admin spa
port: 8083,
basePath: ProcessCwd('admin'),
srcDir: ProcessCwd('admin/src'),
outDir: IS_NODE_ENV
? ProcessCwd('admin/_admin')
: ProcessCwd('static/_admin'),
publicPath: IS_NODE_ENV ? './' : '_admin/',
proxy: {
'/api-admin/v1': {
target: `http://localhost:8086/`,
secure: false,
changeOrigin: true
},
'/default': {
target: `http://localhost:8086/`,
secure: false,
changeOrigin: true
},
'/upload': {
target: `http://localhost:8086/`,
secure: false,
changeOrigin: true
}
}
},
server: {
// server
default_avatar: '/default/img/avatar.jpeg', // 所有使用的默认头像
port: 8086
}
}