long
5 天以前 7ccdf15645b82b8be8a165b20cbb34294c3f6e9b
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
// https://github.com/michael-ciniawsky/postcss-load-config
 
module.exports = {
  "plugins": {
    "postcss-import": {},
    "postcss-url": {},
    "postcss-px-to-viewport-opt": {
      viewportWidth: 1440,// 设计稿宽度
      viewportHeight: 900,// 设计稿高度,可以不指定
      unitPrecision: 3,// px to vw无法整除时,保留几位小数
      viewportUnit: 'vw',// 转换成vw单位    
      selectorBlackList: ['.ignore', '.hairlines'],// 不转换的类名
      minPixelValue: 1,// 小于1px不转换
      mediaQuery: false, // 允许媒体查询中转换
      exclude: /(\/|\\)(node_modules)(\/|\\)/          // 排除node_modules文件中第三方css文件
    },
    "postcss-viewport-units": {},
    "cssnano": {
      // preset: "advanced",
      // autoprefixer: false,// 和cssnext同样具有autoprefixer,保留一个
      // "postcss-zindex": false
      "cssnano-preset-advanced": {
        "zindex": false,
        "autoprefixer": false
      }
    },
    // to edit target browsers: use "browserslist" field in package.json
    // "autoprefixer": {}
  }
}