fix: multiple bugfixes and optimizations in CSS modules#20648
Merged
alexander-akait merged 9 commits intomainfrom Mar 16, 2026
Merged
fix: multiple bugfixes and optimizations in CSS modules#20648alexander-akait merged 9 commits intomainfrom
alexander-akait merged 9 commits intomainfrom
Conversation
- Fix third code point position in walkCssTokens number detection (pos → pos+1) - Fix multiline CSS comment regex to match across line breaks - Fix swapped :import/:export in error message - Fix comma callback incorrectly popping balanced stack, causing stray ')' in output - Fix cache comparison missing inheritance array length check - Fix match.index mutation side effect in publicPathAutoRegex replacement - Fix typo GRID_TEMPLATE_ARES → GRID_TEMPLATE_AREAS - Remove duplicate grid-column-start property setting - Move publicPathAutoRegex to module scope to avoid repeated construction - Precompute merged callbacks in consumeUntil to avoid per-token object spread - Simplify redundant nested ternary in CssGenerator - Replace spread+reduce with for-of loop for Map→Object conversion - Merge duplicate getCompilationHooks calls in CssLoadingRuntimeModule Co-Authored-By: Claude Opus 4.6 <[email protected]>
🦋 Changeset detectedLatest commit: 188d13d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
This PR is packaged and the instant preview is available (d109a43). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@d109a43
yarn add -D webpack@https://pkg.pr.new/webpack@d109a43
pnpm add -D webpack@https://pkg.pr.new/webpack@d109a43 |
Update walkCssTokens snapshot for correct number token parsing (-.1, +.1 now correctly recognized as number tokens instead of delim + number). Update postcss-modules-plugins snapshots for correct :local() comma handling (stray ')' no longer in output). Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add three test cases with multiline comments in @value declarations: - @value with multiline comments around name, colon, and value - @value import with multiline comments around name, from, and request - @value empty with multiline comment as value These cover the CSS_COMMENT regex fix (.*? → [\s\S]*?) ensuring multiline comments are correctly stripped during @value parsing. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…tests Co-Authored-By: Claude Opus 4.6 <[email protected]>
Merging this PR will degrade performance by 24.89%
Performance Changes
Comparing |
Clean up 94 obsolete snapshots for chunks-order, import-meta-env, and extract-source-map-css test cases. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This reverts commit 652e2f0.
Update postcss-modules-plugins snapshots reflecting the comma balanced stack fix (removal of stray ')' in :local() output). Add missing CSS test snapshots for ConfigCacheTestCases. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
alexander-akait
approved these changes
Mar 16, 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.
Summary
What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Existing
Does this PR introduce a breaking change?
No
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Nothing
Use of AI
Partial