-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvue.config.js
45 lines (41 loc) · 1.09 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
45
var HtmlWebpackPlugin = require('html-webpack-plugin')
var version = process.env.VERSION || 'latest'
var product_type = process.env.PRODUCT_TYPE
module.exports = {
assetsDir: version,
productionSourceMap: false,
configureWebpack: {
resolve: {
alias: {
// 'vue$': 'vue/dist/vue.esm.js' // Full version with template compiler
}
}
},
chainWebpack: config => {
config
.plugin('viewer-html')
.use(HtmlWebpackPlugin, [{
filename: `./${version}/view.html`,
template: './public/view.html',
inject: true,
product_type: product_type
}])
config
.plugin('editor-html')
.use(HtmlWebpackPlugin, [{
filename: `./${version}/edit.html`,
template: './public/edit.html',
inject: true,
product_type: product_type
}])
config
.plugin('copy')
.tap(args => {
// constructor parameter for 'CopyWebpackPlugin'
args[0][0].ignore.push('view.html')
args[0][0].ignore.push('edit.html')
args[0][0].to = `${version}/`
return args
})
}
};