Vant postcss-pxtorem配置


1.npm i -S amfe-flexible    

import 'amfe-flexible'

2.

npm i postcss-pxtorem@5.1.1 --save-dev

 

在根目录下创建 .postcssrc.js

module.exports = {
    plugins: {
        'postcss-pxtorem': {
            rootValue({ file }) {
                return file.indexOf('vant') !== -1 ? 37.5 : 75
            },
            propList: ['*'],
        },
    },
};

 

posted @ 2022-01-11 18:51  jayy520  阅读(377)  评论(0)    收藏  举报