-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
74 lines (71 loc) · 2.04 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
68
69
70
71
72
73
74
const px2rem = require("postcss-px2rem");
const CompressionWebpackPlugin = require("compression-webpack-plugin");
const postcss = px2rem({
remUnit: 80, //基准大小 baseSize,需要和rem.js中相同
});
module.exports = {
publicPath:"/tamcc",
devServer: {
// baseUrl: "/",
proxy: {
"/smartEnergy": {
target: "http://47.110.226.205:8980",
// target: "http://10.160.8.103:8090",
// target: "https://www.easy-mock.com/mock/5f3942727c850a226dfc1fbd",
// target: " http://mock.jszhong.top/mock/5f394e32af83f705d6899898",
changeOrigin: true,
},
// "/smartEnergy": {
// target: "http://218.242.28.28:802",
// changeOrigin: true,
// },
}
},
productionSourceMap: false,
css: {
loaderOptions: {
postcss: {
plugins: [postcss],
},
},
},
lintOnSave: false, // 取消 eslint 验证
// configureWebpack: {
// externals: {
// BMap: "BMap",
// },
// },
configureWebpack: (config) => {
// if (isProd) {
// 配置webpack 压缩
config.plugins.push(
new CompressionWebpackPlugin({
test: /\.js$|\.html$|\.css$/,
// 超过4kb压缩
threshold: 4096,
})
);
config.module.rules.push({
test: /\.(swf|ttf|eot|svg|woff(2))(\?[a-z0-9]+)?$/,
loader: 'file-loader',
})
// }
},
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [
]
}
},
// // 压缩图片
// chainWebpack: (config) => {
// config.module
// .rule("images")
// .use("image-webpack-loader")
// .loader("image-webpack-loader")
// .options({ bypassOnDebug: true })
// .end();
// },
outputDir: 'tamcc',
};