postcss.config.cjs 1023 B

12345678910111213141516171819202122232425262728293031
  1. // module.exports = {
  2. // plugins: {
  3. // autoprefixer: {},
  4. // // https://github.com/evrone/postcss-px-to-viewport/blob/HEAD/README_CN.md
  5. // // https://www.shangmayuan.com/a/455cef3107c848f9a6190e82.html
  6. // 'postcss-px-to-viewport': {
  7. // unitToConvert: 'px', // 需要转换的单位,默认为"px"
  8. // viewportWidth: 750, // 设计稿的宽度
  9. // unitPrecision: 4,// 单位转换后保留的精度
  10. // viewportUnit: 'vw', //(String) 希望使用的视口单位
  11. // fontViewportUnit: 'vw', //(String) 字体使用的视口单位
  12. // }
  13. // }
  14. // }
  15. // postcss.config.js
  16. module.exports = {
  17. plugins: {
  18. autoprefixer: {},
  19. // postcss-pxtorem 插件的版本需要 >= 5.0.0
  20. 'postcss-pxtorem': {
  21. rootValue({ file }) {
  22. return 37.5;
  23. //return file.indexOf('vant') !== -1 ? 37.5 : 75;
  24. },
  25. propList: ['*'],
  26. },
  27. },
  28. };