-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(ui): minify css #7988
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
feat(ui): minify css #7988
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds CSS minification to the UI components package by integrating cssnano into the build process and updating the dependency list.
- Introduce
cssnano
in devDependencies and PostCSS config - Reorder and sort devDependencies in
package.json
after runningpnpm install
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/ui-components/package.json | Added cssnano to devDependencies and sorted entries |
packages/ui-components/.postcssrc.json | Included cssnano plugin for CSS post-processing |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/ui-components/.postcssrc.json:5
- [nitpick] Consider configuring cssnano to only run in production builds (e.g., via an environment-specific PostCSS config) to avoid unnecessary minification overhead during development.
"cssnano": {}
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #7988 +/- ##
==========================================
+ Coverage 73.10% 73.12% +0.02%
==========================================
Files 95 95
Lines 8355 8354 -1
Branches 219 218 -1
==========================================
+ Hits 6108 6109 +1
+ Misses 2246 2244 -2
Partials 1 1 ☔ View full report in Codecov by Sentry. |
I should ask though, why isn't Tailwind doing this for us? It appears to have support for optimization + minification: https://github.com/tailwindlabs/tailwindcss/blob/88b9f15b65588a87c5b6b13316530b4aecbc1b0b/packages/%40tailwindcss-postcss/src/index.ts#L55 (appears to use lightningcss: https://github.com/tailwindlabs/tailwindcss/blob/main/packages/%40tailwindcss-node/src/optimize.ts) |
I didn't know that was supported on PostCSS, the docs say to use |
Those are v3 docs ;) |
Fixes #7982 by
cssnano
-ing the styles prepublish.(Also
pnpm i
sorted thepackage.json
)