-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpostcss.config.js
More file actions
34 lines (34 loc) · 909 Bytes
/
Copy pathpostcss.config.js
File metadata and controls
34 lines (34 loc) · 909 Bytes
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
module.exports = {
// 自动添加css厂商前缀
plugins: [
require('autoprefixer')({
overrideBrowserslist: [
'Android 4.1',
'iOS 7.1',
'last 2 versions',
'> 1%',
'chrome >= 5',
'ie >= 9',
'firefox >= 5',
'opera >= 10',
'safari >= 5'
]
}),
require('postcss-pxtorem')({
rootValue: 96, // 基准大小 baseSize,需要和setrem.js中相同
propList: ['*'],
unitPrecision: 3, // rem的小数点后位数
exclude: /node_modules/i
})
]
// 下面设置方式与上面等效
// plugins: {
// "autoprefixer":{
// overrideBrowserslist: ['last 2 versions', '> 1%', 'chrome >= 5', 'ie >= 8', 'firefox >= 5', 'opera >= 10']
// },
// "postcss-px2rem-exclude": {
// remUnit: 100, // 100px = 1rem
// remPrecision: 2 // rem的小数点后位数
// }
// }
}