Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Commit c0b5007

Browse files
authored
feat: add support for .mts (fixes #161) (#166)
1 parent 1194562 commit c0b5007

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Add support for `.mts` (fixes [#161](https://github.com/vitejs/vite-plugin-react-swc/issues/161))
6+
57
## 3.4.0
68

79
- Add `devTarget` option (fixes [#141](https://github.com/vitejs/vite-plugin-react-swc/issues/141))

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const transformWithOptions = async (
205205
const decorators = options?.tsDecorators ?? false;
206206
const parser: ParserConfig | undefined = id.endsWith(".tsx")
207207
? { syntax: "typescript", tsx: true, decorators }
208-
: id.endsWith(".ts")
208+
: id.endsWith(".ts") || id.endsWith(".mts")
209209
? { syntax: "typescript", tsx: false, decorators }
210210
: id.endsWith(".jsx")
211211
? { syntax: "ecmascript", jsx: true }

0 commit comments

Comments
 (0)