when i use postcss-pxtorem as a plugin has a error for it
[object Object] is not a PostCSS plugin
this is my postcss.config.js
module.exports = {
plugins: {
"postcss-preset-env":{} ,
"postcss-pxtorem":{
rootValue: 75,// 因为适配方案是把 1/10的屏幕的宽度作为1rem, 而设计稿是 750, 所以 remUnit = 750/10 = 75
unitPrecision: 4,// 转换精度,小数点后3位
replace: true,
propList: ['*'],
},
}
}
and my package.json was
{
"postcss": "^8.3.1",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-preset-env": "^6.7.0",
"postcss-pxtorem": "^6.0.0",
"webpack": "^5.38.1",
"webpack-cli": "^4.7.2",
}
when i use postcss-pxtorem as a plugin has a error for it [object Object] is not a PostCSS plugin this is my postcss.config.js module.exports = { plugins: { "postcss-preset-env":{} , "postcss-pxtorem":{ rootValue: 75,// 因为适配方案是把 1/10的屏幕的宽度作为1rem, 而设计稿是 750, 所以 remUnit = 750/10 = 75 unitPrecision: 4,// 转换精度,小数点后3位 replace: true, propList: ['*'], }, } }
and my package.json was { "postcss": "^8.3.1", "postcss-import": "^11.0.0", "postcss-loader": "^2.0.8", "postcss-preset-env": "^6.7.0", "postcss-pxtorem": "^6.0.0", "webpack": "^5.38.1", "webpack-cli": "^4.7.2", }
i need help thanks