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.
32 lines
1.0 KiB
32 lines
1.0 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')) ? 375 : 750;
|
|
let isVant = file && file.dirname && file.dirname.indexOf("vant") > -1;
|
|
let rootValue = isVant ? 375 : 750; // 判断条件 请自行调整
|
|
return {
|
|
plugins: {
|
|
autoprefixer: {},
|
|
"postcss-px-to-viewport": {
|
|
unitToConvert: "px",
|
|
viewportWidth: rootValue,
|
|
propList: ["*"],
|
|
unitPrecision: 2, // 转换后的精度,即小数点位数
|
|
viewportUnit: "vw",
|
|
fontViewportUnit: "vw",
|
|
selectorBlackList: [],
|
|
landscapeUnit: 'vh', // 横屏时使用的单位
|
|
landscapeWidth: 667, // 横屏时使用的视口宽度
|
|
selectorBlackList: [], // 指定不转换为视窗单位的类名
|
|
minPixelValue: 1, // 默认值1,小于或等于1px则不进行转换
|
|
mediaQuery: true,
|
|
exclude: [],
|
|
landscape: false,
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|