vue + postcss-pxtorem
安装好postcss-pxtorem 之后也出现了.postcssrc.js 文件,但是文件中只有三个参数
module.exports = {"plugins": {"postcss-import": {},"postcss-url": {},// to edit target browsers: use "browserslist" field in package.json'autoprefixer': {}}
}
手动加上
module.exports = {"plugins": {"postcss-import": {},"postcss-url": {},// to edit target browsers: use "browserslist" field in package.json'autoprefixer': {browsers: ['Android >= 4.0', 'iOS >= 7']},'postcss-pxtorem': {rootValue: 37.5, //vant-UI的官方根字体大小是37.5propList: ['*']}}
}
就报错了: loading PostCSS config: Invalid PostCSS Plugin found: [3]
解决办法:重新安装postcss-pxtorem 指定5.0.0版本 就可以了