-
Notifications
You must be signed in to change notification settings - Fork 2
/
vue.config.js
44 lines (39 loc) · 1.21 KB
/
vue.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
const webpack = require('webpack')
const GitRevisionPlugin = require('git-revision-webpack-plugin')
const packageJson = require('./package.json')
const gitRevisionPlugin = new GitRevisionPlugin({
versionCommand: 'describe --tags --abbrev=0 --always',
commithashCommand: 'rev-parse --short HEAD'
})
const env = {
VERSION: gitRevisionPlugin.version(),
BUILD: gitRevisionPlugin.commithash(),
LICENSE: packageJson['license'],
AUTHOR: packageJson['author']['name']
}
if (process.env.SNAKE_SERVER_HOST) {
env.SNAKE_SERVER_HOST = process.env.SNAKE_SERVER_HOST
}
if (process.env.SNAKE_SERVER_PORT) {
env.SNAKE_SERVER_PORT = process.env.SNAKE_SERVER_PORT
}
if (process.env.SNAKE_SERVER_WEB_SCHEME) {
env.SNAKE_SERVER_WEB_SCHEME = process.env.SNAKE_SERVER_WEB_SCHEME
}
if (process.env.SNAKE_SERVER_SOCKET_SCHEME) {
env.SNAKE_SERVER_SOCKET_SCHEME = process.env.SNAKE_SERVER_SOCKET_SCHEME
}
if (process.env.SNAKE_SERVER_ENABLE_MOCK) {
env.SNAKE_SERVER_ENABLE_MOCK = process.env.SNAKE_SERVER_ENABLE_MOCK
}
const environmentPlugin = new webpack.EnvironmentPlugin(env)
module.exports = {
baseUrl: '.',
productionSourceMap: false,
configureWebpack: {
plugins: [
gitRevisionPlugin,
environmentPlugin
]
}
}