long
5 天以前 7ccdf15645b82b8be8a165b20cbb34294c3f6e9b
提交 | 用户 | age
3ac5f2 1 // https://github.com/michael-ciniawsky/postcss-load-config
J 2
3 module.exports = {
4   "plugins": {
5     "postcss-import": {},
6     "postcss-url": {},
7     "postcss-px-to-viewport-opt": {
8       viewportWidth: 1440,// 设计稿宽度
9       viewportHeight: 900,// 设计稿高度,可以不指定
10       unitPrecision: 3,// px to vw无法整除时,保留几位小数
11       viewportUnit: 'vw',// 转换成vw单位    
12       selectorBlackList: ['.ignore', '.hairlines'],// 不转换的类名
13       minPixelValue: 1,// 小于1px不转换
14       mediaQuery: false, // 允许媒体查询中转换
15       exclude: /(\/|\\)(node_modules)(\/|\\)/          // 排除node_modules文件中第三方css文件
16     },
17     "postcss-viewport-units": {},
18     "cssnano": {
19       // preset: "advanced",
20       // autoprefixer: false,// 和cssnext同样具有autoprefixer,保留一个
21       // "postcss-zindex": false
22       "cssnano-preset-advanced": {
23         "zindex": false,
24         "autoprefixer": false
25       }
26     },
27     // to edit target browsers: use "browserslist" field in package.json
28     // "autoprefixer": {}
29   }
30 }