|
@ -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}`; |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|