数据报表
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.
 
 
 

37 lines
1.1 KiB

const path = require('path');
const unit = require('./src/config/translatedUnit_server');
module.exports = ({
file
}) => {
// const designWidth = file.dirname.includes(path.join('node_modules', 'vant')) ? 350 : 750;
const designWidth = file.dirname.includes('node_modules/vant') ? 375 : 750;
return {
plugins: {
autoprefixer: {},
"postcss-px-to-viewport": {
unitToConvert: "px",
viewportWidth: designWidth,
propList: ["*"],
unitPrecision: 3, // 转换后的精度,即小数点位数
viewportUnit: "vw",
fontViewportUnit: "vw",
selectorBlackList: [],
landscapeUnit: 'vh', // 横屏时使用的单位
landscapeWidth: 667, // 横屏时使用的视口宽度
selectorBlackList: [], // 指定不转换为视窗单位的类名
minPixelValue: 1, // 默认值1,小于或等于1px则不进行转换
mediaQuery: true,
exclude: [],
landscape: false,
rules: {
path: 'vant',
fn(pixels, translated) {
return `${translated * 2}${unit.vw}`;
},
},
}
}
}
}