2 Commits

Author SHA1 Message Date
zhaoguoqiang 45d716e3eb Merge branch 'guoqiang' into test 3 years ago
zhaoguoqiang 66a2084e36 1 3 years ago
  1. 11
      postcss.config.js

11
postcss.config.js

@ -1,9 +1,10 @@
const path = require('path'); const path = require('path');
const unit = require('./src/config/translatedUnit_server');
module.exports = ({ module.exports = ({
file file
}) => { }) => {
const designWidth = file.dirname.includes(path.join('node_modules', 'vant')) ? 375 : 750;
const designWidth = file.dirname.includes(path.join('node_modules', 'vant')) ? 350 : 750;
return { return {
plugins: { plugins: {
autoprefixer: {}, autoprefixer: {},
@ -21,7 +22,13 @@ module.exports = ({
minPixelValue: 1, // 默认值1,小于或等于1px则不进行转换 minPixelValue: 1, // 默认值1,小于或等于1px则不进行转换
mediaQuery: true, mediaQuery: true,
exclude: [], exclude: [],
landscape: false
landscape: false,
rules: {
path: 'vant',
fn(pixels, translated) {
return `${translated * 2}${unit.vw}`;
},
},
} }
} }
} }

Loading…
Cancel
Save