Skip to content

Commit

Permalink
feat: add support for .mts (fixes #161) (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre authored Oct 30, 2023
1 parent 1194562 commit c0b5007
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

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

## 3.4.0

- Add `devTarget` option (fixes [#141](https://github.com/vitejs/vite-plugin-react-swc/issues/141))
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const transformWithOptions = async (
const decorators = options?.tsDecorators ?? false;
const parser: ParserConfig | undefined = id.endsWith(".tsx")
? { syntax: "typescript", tsx: true, decorators }
: id.endsWith(".ts")
: id.endsWith(".ts") || id.endsWith(".mts")
? { syntax: "typescript", tsx: false, decorators }
: id.endsWith(".jsx")
? { syntax: "ecmascript", jsx: true }
Expand Down

0 comments on commit c0b5007

Please sign in to comment.