-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkite.config.js
More file actions
78 lines (75 loc) · 1.96 KB
/
kite.config.js
File metadata and controls
78 lines (75 loc) · 1.96 KB
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
74
75
76
77
78
// 此文件是 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.8,
theme: {
'font-family': 'Microsoft YaHei'
},
env: NODE_ENV,
publicStatic: ProcessCwd('static'),
client: {
port: 8081, // 前台调试端口号
assetsSubDirectory: 'static',
proxy: {
target: `http://localhost:8080`, // client ssr
changeOrigin: true,
secure: false,
pathRewrite: {
'^/client': '/client',
'^/graphql': '/graphql'
}
},
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(''),
srcDir: ProcessCwd('src'),
outDir: IS_NODE_ENV
? ProcessCwd('_admin')
: ProcessCwd('static/_admin'),
publicPath: IS_NODE_ENV ? './' : '/_admin/',
proxy: {
'/api-admin/v1': {
target: `http://localhost:8080/`,
secure: false,
changeOrigin: true,
pathRewrite: {
'^/api-admin/v1': '/',
}
},
'/default': {
target: `http://localhost:8080/`,
secure: false,
changeOrigin: true
},
'/upload': {
target: `http://localhost:8080/`,
secure: false,
changeOrigin: true
}
}
},
server: {
// server
default_avatar: '/default/img/avatar.jpeg', // 所有使用的默认头像
port: 8086, // 生产环境运行端口号
ininProt: 8085 // 初始化项目端口号
}
}