Skip to content
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: Fix CSS imports not minified #56516

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

benoitchantre
Copy link
Contributor

Runs PostCSS on the imported files.

Closes #55885.

What?

Allows CSS imports to be minified.

Why?

The files produced by npm run build should be minified.

How?

The webpack config is adjusted to use PostCSS on imported files also.

Testing Instructions

Use custom webpack.config.js and set an entry for a stylesheet.
In the stylesheet, add an import to get the content of another stylesheet.
Run the build script.

You shoud get a dist file with minified content.
Without this fix, the content that is imported is not minified.

See #55885

Testing Instructions for Keyboard

Runs PostCSS on the imported files.

Closes WordPress#55885.
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 24, 2023
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @benoitchantre! 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.

@gziolo gziolo added [Package] Scripts /packages/scripts [Type] Bug An existing feature does not function as intended labels Nov 24, 2023
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening PR with the fix so quickly and confirming it works.

@gziolo
Copy link
Member

gziolo commented Dec 5, 2023

I included a changelog entry for the package in 957f570, and I’m enabling auto-merge on this PR.

@gziolo gziolo enabled auto-merge (squash) December 5, 2023 06:18
@gziolo gziolo changed the title Fix CSS imports not minified Dec 5, 2023
@gziolo gziolo merged commit a5a4edf into WordPress:trunk Dec 5, 2023
50 checks passed
Copy link

github-actions bot commented Dec 5, 2023

Congratulations on your first merged pull request, @benoitchantre! 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Scripts /packages/scripts [Type] Bug An existing feature does not function as intended
3 participants