build(css): resolve @import in unminified CSS output - #44
Merged
Conversation
Bundle CSS @import statements at build time for both .css and .min.css outputs, mirroring the existing JS build behavior and removing the need for css/build/lib/ copy workarounds.
2 tasks
Screenfeed
reviewed
Sep 3, 2026
Comment on lines
+59
to
+62
| expect( unminifiedCss ).toContain( '.partial' ); | ||
| expect( minifiedCss ).toContain( '.partial' ); | ||
| expect( unminifiedCss ).toContain( '.entry' ); | ||
| expect( minifiedCss ).toContain( '.entry' ); |
There was a problem hiding this comment.
Maybe useless but we could test that the content is minified or not too.
- Minified:
.partial{ - Not minified:
.partial {
What do you think?
Member
Author
There was a problem hiding this comment.
Good idea, even though unit tests already cover the minimize flag.
See e8817bd
Verify integration output preserves readable CSS spacing in .css files and minified selector syntax in .min.css files.
Screenfeed
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Resolve CSS
@importstatements at build time for both unminified (.css) and minified (.min.css) outputs.Why?
Closes the gap where only minified CSS had imports bundled, forcing plugins to ship
css/build/lib/partials forSCRIPT_DEBUGusers. Aligns CSS with the existing JS bundling behavior (part of polylang/polylang-pro#1430).How?
CopyPluginfromtransformCssEntry; emit[name].cssand[name].min.cssfrom the same entry.copy-webpack-pluginpeer dependency.Test plan
npm testpasses (51 tests)@wpsyntex/polylang-build-scripts@2.4.0before merging dependent PRs