Skip to content

fix(css): skip JS module generation for unused CSS exports#20337

Merged
alexander-akait merged 2 commits intomainfrom
css
Jan 21, 2026
Merged

fix(css): skip JS module generation for unused CSS exports#20337
alexander-akait merged 2 commits intomainfrom
css

Conversation

@xiaoxiaojx
Copy link
Member

Summary
Avoid generating JavaScript modules for CSS exports that are not used, reducing unnecessary output and bundle size.

What kind of change does this PR introduce?
fix

Did you add tests for your changes?
Yes

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

@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

🦋 Changeset detected

Latest commit: 0352894

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack Patch

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2026

This PR is packaged and the instant preview is available (13c679a).

Install it locally:

  • npm
npm i -D webpack@https://pkg.pr.new/webpack@13c679a
  • yarn
yarn add -D webpack@https://pkg.pr.new/webpack@13c679a
  • pnpm
pnpm add -D webpack@https://pkg.pr.new/webpack@13c679a


if (generateContext.concatenationScope) {
const source = new ConcatSource();
/** @type {Set<string>} */
Copy link
Member

Choose a reason for hiding this comment

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

Let's return types here and for exports var too, it was a part of types coverage and we can merge

@alexander-akait
Copy link
Member

Thanks

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 21, 2026

Merging this PR will not alter performance

✅ 72 untouched benchmarks


Comparing css (0352894) with main (b2ad09d)

Open in CodSpeed

@alexander-akait alexander-akait merged commit 13c679a into main Jan 21, 2026
89 of 92 checks passed
@alexander-akait alexander-akait deleted the css branch January 21, 2026 15:29
@alexander-akait
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants