移动端
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.
 
 

22 line
648 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.   };
  18. };