fix(esm-library): emit empty export for empty node chunks#13462
fix(esm-library): emit empty export for empty node chunks#13462JSerFeng merged 4 commits intoweb-infra-dev:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Ensures Node-target ESM library chunks remain valid ESM even when they contain no exports by emitting an explicit empty export, and updates the corresponding snapshot.
Changes:
- Add conditional emission of
export {};for Node ESM chunks with no exports - Update snapshot output for the “empty import” external case
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/rspack-test/esmOutputCases/externals/empty-import/snapshots/esm.snap.txt | Updates snapshot to include the new export {}; emission |
| crates/rspack_plugin_esm_library/src/render.rs | Adds logic to render an empty export for Node ESM output when no exports are present |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merging this PR will not alter performance🎉 Hooray!
|
2e95380 to
890cb5f
Compare
890cb5f to
a142f60
Compare
Summary
export {}for node-target ESM chunks when a chunk has no exportsRelated links
Checklist