Skip to content

fix(core): support numbered preprocessor css rules#1538

Merged
Timeless0911 merged 3 commits intomainfrom
david/fix-core-style-rule-suffix
Mar 17, 2026
Merged

fix(core): support numbered preprocessor css rules#1538
Timeless0911 merged 3 commits intomainfrom
david/fix-core-style-rule-suffix

Conversation

@Timeless0911
Copy link
Contributor

@Timeless0911 Timeless0911 commented Mar 17, 2026

Summary

Handle bundleless CSS extraction for numbered sass / less rule ids created when multiple preprocessor plugins are registered.

This keeps lib CSS extraction working for additional preprocessor rules such as sass-1 instead of only the base rule id.

Related Links

N/A

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings March 17, 2026 08:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates lib CSS extraction to recognize “numbered” preprocessor rule IDs (e.g., sass-1) that are generated when multiple preprocessor plugins are registered, ensuring bundleless builds still swap in libCssExtractLoader.

Changes:

  • Extend rule matching logic to include numbered preprocessor rule IDs (e.g., sass-1, less-2) when applying the lib CSS extract loader.
  • Adjust bundler-chain modification to iterate over matched rule IDs instead of only the base rule ID.
  • Add an integration test asserting inspectConfig() output includes loader replacement for both sass and sass-1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/integration/javascript-api/inspect-config/index.test.ts Adds integration coverage for numbered sass-* rules in bundleless inspect output.
packages/core/src/css/cssConfig.ts Updates lib CSS extraction rule matching to handle numbered preprocessor rule IDs.

@Timeless0911 Timeless0911 merged commit 669d454 into main Mar 17, 2026
7 checks passed
@Timeless0911 Timeless0911 deleted the david/fix-core-style-rule-suffix branch March 17, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants