vue.config.js
1.4 KB
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
const { defineConfig } = require('@vue/cli-service')
const px2rem = require('postcss-px2rem')
console.log('---------------构建环境:' + process.env.VUE_APP_MODE + '------------------')
module.exports = defineConfig({
transpileDependencies: true,
productionSourceMap: false,
chainWebpack: (config) => {
config.plugin('html').tap(args => {
args[0].title = '网页标题'; // 设置网页标题
args[0].meta = {
description: 'Your Description', // 设置网页描述
keywords: 'keyword1, keyword2, keyword3' // 设置关键词
};
return args;
});
// px自动转化rem
config.module
.rule('scss')
.test(/\.scss$/)
.oneOf('vue')
.resourceQuery(/\?vue/)
.use('postcss-loader')
.loader('postcss-loader')
.tap((args) => {
args.postcssOptions = {
plugins: [
px2rem({
// 设计稿尺寸 / 10
remUnit: 75
})
]
};
return args;
})
},
devServer: {
open: true,
// host: 'localhost',
port: 8080,
proxy: {
"/report": {
target: 'https://jdlog-test.uu.cc',
changeOrigin: true,
pathRewrite: {
'^/report': ''
}
},
"/dev-web-gateway": {
target: 'http://dev-ms.ids111.com:10030/',
changeOrigin: true
}
}
}
})