移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
875 B

  1. const AutoPrefixer = require("autoprefixer");
  2. const px2rem = require("postcss-px2rem");
  3. module.exports = ({ file }) => {
  4.   let remUnit;
  5.   // 判断条件 请自行调整 我使用的是 mand-mobile ui 没有对vant引入进行测试
  6.   //link https://github.com/youzan/vant/issues/1181
  7.   if (file && file.dirname && file.dirname.indexOf("vant") > -1) {
  8.     remUnit = 37.5;
  9.   }else {
  10.     remUnit = 75;
  11.   }
  12.   return {
  13.     plugins: [
  14.      px2rem({ remUnit: remUnit}),
  15.      AutoPrefixer({ browsers: ["last 20 versions", "android >= 4.0"] })
  16.     ],
  17. "postcss-pxtorem": {
  18. rootValue: 23.4375, // 640
  19. propList: ['*'],
  20. selectorBlackList: ['.tree-xxx'],
  21. minPixelValue: 1,
  22. exclude: /vue-search-tree/ig // src 目录下样式全部不转义
  23. }
  24.   };
  25. };