Skip to content

fix: add declaration for unused harmony import specifier#20286

Merged
alexander-akait merged 4 commits intomainfrom
issue-20151
Jan 12, 2026
Merged

fix: add declaration for unused harmony import specifier#20286
alexander-akait merged 4 commits intomainfrom
issue-20151

Conversation

@hai-x
Copy link
Member

@hai-x hai-x commented Jan 5, 2026

Summary

What kind of change does this PR introduce?

Fixes #20151 and fixes #20276.

We will generate a var declaration (i.e. var unused_import_specifier) for unused import specifiers to reduce the likelihood of the entry module being wrapped in an IIFE.

Notably, the declaration will be safely removed after minimize, so i think the pros outweigh the costs.

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?

No

@changeset-bot
Copy link

changeset-bot bot commented Jan 5, 2026

🦋 Changeset detected

Latest commit: 34f5861

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 5, 2026

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

Install it locally:

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

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 5, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing issue-20151 (34f5861) with main (dc644c4)

Summary

✅ 72 untouched benchmarks

@hai-x hai-x marked this pull request as ready for review January 6, 2026 16:46
@alexander-akait alexander-akait merged commit fd55587 into main Jan 12, 2026
51 of 52 checks passed
@alexander-akait alexander-akait deleted the issue-20151 branch January 12, 2026 16:13
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.

Unused function in ESM code winds up incorrectly referencing a global

2 participants

Comments