-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue.config.js
67 lines (64 loc) · 1.72 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const CompressionWebpackPlugin = require('compression-webpack-plugin');
const productionGzipExtensions = ['js', 'css'];
const shell = require("shelljs");
shell.cp(process.cwd() + "/config/" + process.env.NULS_ENV + ".js",process.cwd() + "/src/config.js");
const isProduction = process.env.NODE_ENV === 'production';
// const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
// .BundleAnalyzerPlugin;
module.exports = {
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'en',
localeDir: 'locales',
enableInSFC: false
}
},
configureWebpack: config => {
if (isProduction) {
config.plugins.push(new CompressionWebpackPlugin({
algorithm: 'gzip',
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
threshold: 10240,
minRatio: 0.8
}));
// config.plugins.push(new BundleAnalyzerPlugin())
}
// config.externals = {
// 'vue': 'Vue',
// 'vue-router': 'VueRouter',
// /*'vuex': 'Vuex',*/
// 'moment': 'moment',
// 'echarts': 'echarts',
// 'element-ui': 'ELEMENT',
// }
},
baseUrl: undefined,
outputDir: undefined,
assetsDir: undefined,
runtimeCompiler: undefined,
productionSourceMap: false,
parallel: undefined,
transpileDependencies: [
'vue-echarts',
'resize-detector'
],
css: {
sourceMap: true
},
devServer: {
port: 8035,
host: '0.0.0.0',
https: false, // https:{type:Boolean}
open: true, //配置自动启动浏览器
proxy: {// 配置跨域处理
'/api': {
target: 'http://192.168.1.127:8080/',
changeOrigin: true, // 是否跨域
pathRewrite: {
'^/api': '/'
}
}
}
}
};