chore: simplify import comment style in output code#12163
Merged
chenjiahan merged 2 commits intomainfrom Nov 12, 2025
Merged
Conversation
✅ Deploy Preview for rspack canceled.
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR simplifies comment annotations in compiled webpack output by removing the "ESM" prefix from import/export comments, making them shorter and clearer while maintaining readability.
- Changed comment format from
/* ESM import */to/* import */ - Changed comment format from
/* ESM default export */and variants to/* export default */and corresponding variants - Updated all test snapshots to reflect the new comment format
Reviewed Changes
Copilot reviewed 112 out of 112 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_plugin_javascript/src/dependency/esm/esm_export_expression_dependency.rs | Updated export default comment formats in code generation |
| crates/rspack_core/src/dependency/runtime_template.rs | Updated import statement comment formats in code generation |
| tests/rspack-test/treeShakingCases/**/*.snap.txt (75 files) | Updated test snapshots for tree shaking cases |
| tests/rspack-test/statsOutputCases/**/*.txt (3 files) | Updated stats output snapshots with new comment format |
| tests/rspack-test/statsAPICases/*.js (2 files) | Updated hash values due to code changes |
| tests/rspack-test/hookCases/**/output.snap.txt (1 file) | Updated hook case snapshot |
| tests/rspack-test/esmOutputCases/**/*.snap.txt (6 files) | Updated ESM output snapshots |
| tests/rspack-test/diagnosticsCases/**/stats.err (1 file) | Updated error message snapshot |
| tests/rspack-test/builtinCases/**/*.snap.txt (20 files) | Updated builtin test case snapshots |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
📦 Binary Size-limit
❌ Size increased by 128bytes from 48.09MB to 48.09MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #12163 will not alter performanceComparing Summary
|
JSerFeng
approved these changes
Nov 12, 2025
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
Replaced verbose comments like
/* ESM import */and/* ESM default export */with shorter, clearer forms./* ESM import */→/* import *//* ESM default export */→/* export default */This keeps the annotations readable while reducing noise in the compiled output.
Related links
Checklist