-
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
Scripts: Webpack config update to minimize CSS #33676
Scripts: Webpack config update to minimize CSS #33676
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @christianztamayo! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
3777bf8
to
318bdaa
Compare
318bdaa
to
7ce501b
Compare
Adds the optimize-css-assets-webpack-plugin to the minimizer config
6d3203e
to
895b5b3
Compare
895b5b3
to
16a2663
Compare
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.
I tested this PR and it works as advertised. Thank you for the improvement 👍🏻
Congratulations on your first merged pull request, @christianztamayo! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
@gziolo This should probably be released as a breaking change because it can impact users which have their own PostCSS config which already includes cssnano (which optimize-css-assets-webpack-plugin uses by default) with a custom config for allowed optimisations. Since sass-loader seems to minify the CSS already, should we maybe extend the default PostCSS config to use cssnano instead? Related:
|
@ocean90, if we can avoid all the hassle by extending the default PostCSS config then it would be the best solution. Let's explore that approach. We have some time (2 weeks) because the new Gutenberg plugin was cut before I merged these changes 😄 |
I opened a follow-up: #33750. |
Description
The previous configuration does not have CSS minification included aside from the
sass-loader
built-in which only affects SCSS files. (Closes #33643, Related: #29624)How has this been tested?
build
command does not minify CSS files #33643 and checked that regular CSS are now minifiedTypes of changes
Added the optimize-css-assets-webpack-plugin to the minimizer config.
Checklist:
*.native.js
files for terms that need renaming or removal).