postcss.config.js 834 B

12345678910111213141516
  1. module.exports = {
  2. plugins: {
  3. // autoprefixer: {}, // 用来自动处理浏览器前缀的一个插件。 // VueCLI 内部已经配置了 autoprefixer 插件
  4. 'postcss-pxtorem': {
  5. rootValue({ file }) {
  6. // TODO: rootValue
  7. return file.indexOf('vant') !== -1 ? 37.5 : 41.4 // vant 使用375, 其他使用设计图 414?
  8. },
  9. unitPrecision: 5, //小数位
  10. minPixelValue: 1, //转换的最小单位
  11. selectorBlackList: [], //忽略的样式, 正则 // vant样式忽略
  12. propList: ['*'], // 需要做转化处理的属性,如`hight`、`width`、`margin`等,`*`表示全部,正则
  13. // exclude 这个属性可以配置不需要转换的资源 直接写文件名就行,不需要后缀
  14. },
  15. },
  16. }