-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathvue.config.js
48 lines (47 loc) · 1.22 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
46
47
48
const path = require('path')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = ['js', 'css']
function resolve(dir) {
return path.join(__dirname, dir)
}
let configureWebpack = {}
if (process.env.NODE_ENV === 'production') {
configureWebpack = {
externals: {
vue: 'Vue',
'vue-router': 'VueRouter',
'element-plus': 'ElementPlus',
xlsx: 'XLSX',
},
plugins: [
new CompressionWebpackPlugin({
filename: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
threshold: 10240,
minRatio: 0.8,
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
// warnings: false,
drop_debugger: true,
drop_console: true,
pure_funcs: ['console.log'],
},
},
sourceMap: false,
parallel: true,
}),
],
}
}
module.exports = {
configureWebpack,
productionSourceMap: false,
devServer: {
port: 7007,
},
publicPath: process.env.DEPLOY_ENV ? '/editable-table/' : '/', // deploy to github page
}