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
fix(vite): remove postcss-url
and duplicate postcss-import
#23861
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Shouldn't this mention/link to #20533 since all the related issue were merged into that one ? |
For CSS minification, I am not sure if users would want full control over which tool to use, maybe could be an option as |
postcss-url
and duplicate postcss-import
pluginspostcss-url
and duplicate postcss-import
I think that would be a very nice idea. |
Full control is good, but also with the most performant (sensible) default (likely There's not much in the docs other than Nuxt is pre-configured to use I know there's the Anyway, ideally Nuxt 3 takes care of all of the above for us (inlined critical CSS, fastest minification and purging), and maybe explains the optimal pre-configured choice (lightning) - but then lets us opt for other less performant options if it's somehow a project requirement. |
π Linked issue
resolves #15765
β Type of change
π Description
This was a fun deep-dive.
Investigating the linked issue, I found that we are adding
postcss-import
- and so is vite. In addition, I believe the key featurespostcss-url
(which was causing the bug) are in fact already covered by Vite's list of features:Accordingly, this PR removes both plugins (or rather, doesn't add them).
I suspect removing these two plugins will improve our performance as well as fix the bug. I would also consider we reconsider whether to include
cssnano
or defer to vite's esbuild/lightningcss minificiation step in future (cc: antfu).π Checklist