-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvue.config.js
More file actions
57 lines (54 loc) · 1.79 KB
/
vue.config.js
File metadata and controls
57 lines (54 loc) · 1.79 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
const path = require('path')
function resolve(dir) {
return path.join(__dirname, '.', dir)
}
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? './' : './',
lintOnSave:false,
css:{
loaderOptions:{
postcss:{
plugins: [
require("autoprefixer")({
// 配置使用 autoprefixer
overrideBrowserslist: ["last 15 versions"]
}),
require("postcss-pxtorem")({
rootValue: 37.5, // 换算的基数
// 忽略转换正则匹配项。插件会转化所有的样式的px。比如引入了三方UI,也会被转化。目前我使用 selectorBlackList字段,来过滤
//如果个别地方不想转化px。可以简单的使用大写的 PX 或 Px 。
selectorBlackList: ["ig"],
propList: ["*"],
exclude: /node_modules/
})
]
}
}
},
devServer:{
port:8080,
open:true
},
chainWebpack: config => {
config.module.rules.delete("svg"); //重点:删除默认配置中处理svg,
config.module
.rule('svg-sprite-loader')
.test(/\.svg$/)
.include
.add(resolve('src/icons')) //处理svg目录
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
},
// pluginOptions: {
// 'style-resources-loader': {
// preProcessor: 'sass',
// patterns: [
// path.resolve(__dirname, './src/assets/styles/*.scss') //你的.scss文件所在目录
// ]
// }
// }
}