Skip to content

Commit

Permalink
Scripts: Import CSS files before optimization (WordPress#61121)
Browse files Browse the repository at this point in the history
* Import CSS files before optimization

Closes WordPress#61112.

* Update changelog

Co-authored-by: benoitchantre <benoitchantre@git.wordpress.org>
Co-authored-by: gziolo <gziolo@git.wordpress.org>
  • Loading branch information
3 people authored and bph committed Aug 31, 2024
1 parent 135cbe5 commit 48d929a
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
63 changes: 63 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
"npm-run-all": "4.1.5",
"patch-package": "8.0.0",
"postcss": "8.4.38",
"postcss-import": "16.1.0",
"postcss-loader": "6.2.1",
"postcss-local-keyframes": "^0.0.2",
"prettier": "npm:wp-prettier@3.0.3",
Expand Down
4 changes: 4 additions & 0 deletions packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Enhancements

- Inlines CSS files imported from other CSS files before optimization in the `build` command ([#61121](https://github.com/WordPress/gutenberg/pull/61121)).

### Bug Fixes

- Added chunk filename in webpack config to avoid reading stale files ([#58176](https://github.com/WordPress/gutenberg/pull/58176)).
Expand Down
1 change: 1 addition & 0 deletions packages/scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const cssLoaders = [
plugins: isProduction
? [
...postcssPlugins,
require( 'postcss-import' ),
require( 'cssnano' )( {
// Provide a fallback configuration if there's not
// one explicitly available in the project.
Expand Down
1 change: 1 addition & 0 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"npm-package-json-lint": "^6.4.0",
"npm-packlist": "^3.0.0",
"postcss": "^8.4.5",
"postcss-import": "^16.1.0",
"postcss-loader": "^6.2.1",
"prettier": "npm:wp-prettier@3.0.3",
"puppeteer-core": "^13.2.0",
Expand Down

0 comments on commit 48d929a

Please sign in to comment.