Skip to content

fix: swc-loader should not respect .swcrc#12222

Merged
chenjiahan merged 6 commits intomainfrom
11-17-fix/default-swcrc
Nov 18, 2025
Merged

fix: swc-loader should not respect .swcrc#12222
chenjiahan merged 6 commits intomainfrom
11-17-fix/default-swcrc

Conversation

@CPunisher
Copy link
Copy Markdown
Contributor

@CPunisher CPunisher commented Nov 18, 2025

Summary

Since #11906, swc-loader will respect .swcrc, which is a little breaking (and useless). This pr reverts the behavior.

Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 18, 2025 03:15
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 18, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit becda6e
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/691c0138f74dd600088747dc

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 18, 2025
@CPunisher CPunisher requested a review from chenjiahan November 18, 2025 03:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 .swcrc file lookup by setting swcrc: false in SWC options
  • Adds a test case to verify that .swcrc files 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.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@CPunisher CPunisher changed the title fix: swc-loader should not respect to .swcrc fix: swc-loader should not respect .swcrc Nov 18, 2025
chenjiahan
chenjiahan previously approved these changes Nov 18, 2025
Copy link
Copy Markdown
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 18, 2025

📦 Binary Size-limit

Comparing becda6e to docs: remove HomeBackground and navTransparent hack (#12224) by Soon

🙈 Size remains the same at 47.46MB

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 18, 2025

CodSpeed Performance Report

Merging #12222 will not alter performance

Comparing 11-17-fix/default-swcrc (becda6e) with main (848f76a)

Summary

✅ 17 untouched

@chenjiahan chenjiahan enabled auto-merge (squash) November 18, 2025 05:27
@chenjiahan chenjiahan merged commit 2f78a97 into main Nov 18, 2025
47 checks passed
@chenjiahan chenjiahan deleted the 11-17-fix/default-swcrc branch November 18, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: env and jsc.target cannot be used together

3 participants