-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkoot.config.js
142 lines (84 loc) · 3.03 KB
/
koot.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/**
* @module kootConfig
*
* Koot.js 项目配置
*
* 配置文档请查阅: [https://koot.js.org/#/config]
*/
const fs = require('fs-extra')
const path = require('path')
module.exports = {
/**************************************************************************
* 项目信息
*************************************************************************/
name: "eslint-prettier-sample",
type: 'react',
dist: "./dist",
template: './src/index.ejs',
templateInject: './src/index.inject.js',
routes: './src/routes',
store: './src/store',
cookiesToStore: true,
i18n: [
['zh', './src/locales/zh.json'],
['en', './src/locales/en.json'],
],
pwa: true,
aliases: {
'@src': path.resolve('./src'),
'@assets': path.resolve('./src/assets'),
'@components': path.resolve('./src/components'),
'@constants': path.resolve('./src/constants'),
'@locales': path.resolve('./src/locales'),
'@router': path.resolve('./src/router'),
'@services': path.resolve('./src/services'),
'@store': path.resolve('./src/store'),
'@views': path.resolve('./src/views'),
'~vars.less': path.resolve('./src/constants/less-variables/_all.less')
},
defines: {
__SVG_ICON_PACK__: JSON.stringify(fs.readFileSync(path.resolve(__dirname, './src/assets/symbol-defs.svg'), 'utf-8')).replace(/\n/g, '')
},
staticCopyFrom: path.resolve(__dirname, './src/assets/public'),
// 更多选项请查阅文档...
/**************************************************************************
* 客户端生命周期
*************************************************************************/
// 选项请查阅文档...
/**************************************************************************
* 服务器端设置 & 生命周期
*************************************************************************/
port: 8081,
proxyRequestOrigin: {
protocol: 'https',
},
serverBefore: './src/server/before.js',
// 更多选项请查阅文档...
/**************************************************************************
* Webpack 相关
*************************************************************************/
webpackConfig: require('./config/webpack'),
webpackBefore: async ({ dist }) => {
// 每次打包前清空打包目录
if (process.env.WEBPACK_BUILD_STAGE === 'client') {
await fs.emptyDir(dist)
}
},
// 更多选项请查阅文档...
/**************************************************************************
* 开发环境
*************************************************************************/
devPort: 3088,
devDll: [
'react',
'react-dom',
'redux',
'react-redux',
'react-router',
'react-router-redux',
'koot',
'axios',
'classnames'
],
// 更多选项请查阅文档...
}