-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make PostCSS plugin async to improve performance #11548
Conversation
This way we can improve the `fs.readFileSync` to a bunch of `fs.promises.readFile` in a `Promise.all` instead.
8b5a56f
to
9d55f9f
Compare
* make main plugin async This way we can improve the `fs.readFileSync` to a bunch of `fs.promises.readFile` in a `Promise.all` instead. * make CLI plugin async * update CHANGELOG
* make main plugin async This way we can improve the `fs.readFileSync` to a bunch of `fs.promises.readFile` in a `Promise.all` instead. * make CLI plugin async * update CHANGELOG
* make main plugin async This way we can improve the `fs.readFileSync` to a bunch of `fs.promises.readFile` in a `Promise.all` instead. * make CLI plugin async * update CHANGELOG
FYI: This change broke support for NativeWind on React Native. Triggers a "Use process(css).then(cb) to work with async plugins" error when running 3.3.3. Any insight from the Tailwind team on the reasons? I suspect the error is being thrown by Babel. |
FYI: This change also break the postCss plugin postcss-multiple-tailwind. |
I created postcss-multiple-tailwind, but since tailwindcss v2.3 there has been internal support for this functionality. You should use that instead of my plugin. |
Error! |
|
This PR improves the performance by making the main plugin async. This means that we can replace a bunch of
fs.readFileSync
calls for each template file with aPromise.all(f => fs.promises.readFile(f))
instead, without blocking IO.