Skip to content

fix: default scriptRegex to JSX and TSX extensions - #16

Merged
chenjiahan merged 4 commits into
mainfrom
chenjiahan/skip-plain-typescript
Nov 19, 2026
Merged

chenjiahan merged 4 commits into
mainfrom
chenjiahan/skip-plain-typescript

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

A shared Rspack rule can send plain TypeScript to the Solid compiler before SWC strips its types. Default the main loader’s scriptRegex to /\.[cm]?[jt]sx$/i so it compiles JSX and TSX, including their ESM and CommonJS variants, and passes other files through to the next loader.

Projects using JSX in .js or custom extensions such as .solid can include those extensions with an explicit scriptRegex. A production build regression test compiles a TSX component that imports a typed value from a .ts file.

Related example: rstackjs/rstack-examples#528

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T11:02:24.257448Z e63a6d2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chenjiahan chenjiahan changed the title fix: skip plain TypeScript files by default fix: default scriptRegex to JSX and TSX extensions Nov 19, 2026
@chenjiahan
chenjiahan merged commit c5dd02c into main Nov 19, 2026
3 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/skip-plain-typescript branch November 19, 2026 11:03
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.

1 participant