Skip to content

Commit 48d929a

Browse files
benoitchantrebenoitchantregziolo
authored andcommitted
Scripts: Import CSS files before optimization (WordPress#61121)
* Import CSS files before optimization Closes WordPress#61112. * Update changelog Co-authored-by: benoitchantre <[email protected]> Co-authored-by: gziolo <[email protected]>
1 parent 135cbe5 commit 48d929a

File tree

5 files changed

+70
-0
lines changed

5 files changed

+70
-0
lines changed

package-lock.json

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@
228228
"npm-run-all": "4.1.5",
229229
"patch-package": "8.0.0",
230230
"postcss": "8.4.38",
231+
"postcss-import": "16.1.0",
231232
"postcss-loader": "6.2.1",
232233
"postcss-local-keyframes": "^0.0.2",
233234
"prettier": "npm:[email protected]",

packages/scripts/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Enhancements
6+
7+
- Inlines CSS files imported from other CSS files before optimization in the `build` command ([#61121](https://github.com/WordPress/gutenberg/pull/61121)).
8+
59
### Bug Fixes
610

711
- Added chunk filename in webpack config to avoid reading stale files ([#58176](https://github.com/WordPress/gutenberg/pull/58176)).

packages/scripts/config/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ const cssLoaders = [
119119
plugins: isProduction
120120
? [
121121
...postcssPlugins,
122+
require( 'postcss-import' ),
122123
require( 'cssnano' )( {
123124
// Provide a fallback configuration if there's not
124125
// one explicitly available in the project.

packages/scripts/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"npm-package-json-lint": "^6.4.0",
7474
"npm-packlist": "^3.0.0",
7575
"postcss": "^8.4.5",
76+
"postcss-import": "^16.1.0",
7677
"postcss-loader": "^6.2.1",
7778
"prettier": "npm:[email protected]",
7879
"puppeteer-core": "^13.2.0",

0 commit comments

Comments
 (0)