fix: swc-loader should not respect .swcrc#12222
Merged
chenjiahan merged 6 commits intomainfrom Nov 18, 2025
Merged
Conversation
✅ Deploy Preview for rspack canceled.
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR reverts the behavior introduced in PR #11906 where swc-loader would respect .swcrc configuration files. The fix explicitly sets swcrc: false in the SWC options to prevent the loader from reading and applying .swcrc files, ensuring that only the options provided in the loader configuration are used.
- Explicitly disables
.swcrcfile lookup by settingswcrc: falsein SWC options - Adds a test case to verify that
.swcrcfiles are ignored by the loader
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_loader_swc/src/options.rs | Sets swcrc: false explicitly to prevent the loader from respecting .swcrc configuration files |
| tests/rspack-test/configCases/builtin-swc-loader/swcrc/rspack.config.js | Adds test configuration with basic TypeScript loader setup |
| tests/rspack-test/configCases/builtin-swc-loader/swcrc/index.js | Adds test case to verify .swcrc is ignored |
| tests/rspack-test/configCases/builtin-swc-loader/swcrc/a.ts | Adds test source file with simple export |
| tests/rspack-test/configCases/builtin-swc-loader/swcrc/.swcrc | Adds .swcrc file with ES2015 target to test that it's ignored |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/rspack-test/configCases/builtin-swc-loader/swcrc/index.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
swc-loader should not respect to .swcrcswc-loader should not respect .swcrc
Contributor
📦 Binary Size-limit
🙈 Size remains the same at 47.46MB |
CodSpeed Performance ReportMerging #12222 will not alter performanceComparing Summary
|
…pack into 11-17-fix/default-swcrc
chenjiahan
approved these changes
Nov 18, 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
Since #11906,
swc-loaderwill respect.swcrc, which is a little breaking (and useless). This pr reverts the behavior.Links
envandjsc.targetcannot be used together rsbuild#6485Checklist