-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
49 lines (46 loc) · 942 Bytes
/
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
45
46
47
48
49
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
let plugins
let output
if(process.env.NODE_ENV === 'production'){
const base_url = process.env.BASE_URL
output = {
publicPath: base_url,
filename: "[hash].[name].js"
}
plugins = [
new UglifyJsPlugin({
parallel: true,
uglifyOptions: {
ecma: 8,
compress: {
passes: 2,
ecma: 8
},
parse: {
html5_comments: false
},
toplevel: true,
output: {
beautify: false,
ecma: 8
}
}
})
]
}
else{
plugins = []
output = {}
}
module.exports = {
configureWebpack: {
output,
plugins,
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
}
}
}