-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
50 lines (47 loc) · 1.18 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
49
//去console插件
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
//gzip压缩插件
const CompressionWebpackPlugin = require('compression-webpack-plugin');
module.exports = {
// outputDir: process.env.outputDir,
// assetsDir: 'static',
// baseUrl: '/vue-project',
configureWebpack: config => {
let plugins = [
// new UglifyJsPlugin({
// uglifyOptions: {
// compress: {
// warnings: false,
// drop_debugger: true,
// drop_console: true
// }
// },
// // sourceMap: false,
// parallel: true
// }),
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
threshold: 10240,
minRatio: 0.8
})
];
if (process.env.NODE_ENV !== 'development') {
config.plugins = [...config.plugins, ...plugins];
}
},
devServer: {
// open: false,
// host: '0.0.0.0',
// port: 8000,
// https: false,
// hotOnly: false,
proxy: {
'/api': {
target: 'http://127.0.0.1:8012',
changeOrigin: true
}
}
}
};