Open dengyizhenfeng opened 2 years ago
same question
@KODerFunk
+1
same question
same question
yarn add react-scripts@4
+1
+1,can't use in Vite
+1,can't use in Vite
same,i used vite.
I wrote a version that supports plugin8 based on this repository. here
you can use my plugin instead. repo Postcss 8 compat.
using the transform func and unit you can transform px to any unit
such as pxtoviewport
pxtorpx({
unit: 'vw',
transform: (x) => {
// 750 / 100 = x / y
// assume your design base on 750px
return x * (100 / 750);
},
})
I use Vue3+Vite,my solution is: first step: npm uninstall postcss second step: npm install postcss@6.0.0
should submit a pull request
Probably not the plugin's reason. My project is using vue3+vite+typescript+vant, and then I got an error configuring vant's style shrink, and then I got the same issue as you. But once I fixed the vant misconfiguration, postcss-px-to-viewport worked fine. It's likely that the UI library you're using is configured incorrectly.
I referenced postcss-px-to-viewport in the project created by vue-cli, and there will be a prompt when packaging
Building for production...postcss-px-to-viewport: postcss.plugin was deprecated. Migration guide: https://evilmartians.com/chronicles/postcss-8-plugin-migration