cuth / postcss-pxtorem

Convert pixel units to rem (root em) units using PostCSS
MIT License
2.02k stars 174 forks source link

[object Object] is not a PostCSS plugin #74

Open zj1234jz opened 3 years ago

zj1234jz commented 3 years ago

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

Fantasy1316 commented 2 years ago

I have the same problem, nedd help!

budarin commented 2 years ago

postcss-pixels-to-rem: postcss.plugin was deprecated. Migration guide: https://evilmartians.com/chronicles/postcss-8-plugin-migration