Skip to content

Commit

Permalink
docs: add compatibility chart
Browse files Browse the repository at this point in the history
  • Loading branch information
2fd committed Apr 25, 2024
1 parent 0306b15 commit 017d0b0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ SWC Plugin for allowImportingTsExtensions

If you are using SWC to transpile your TypeScript code, and your target is `es2016` or higher, you can use this plugin to import `.ts` files extensions (instead of `.js`), and it will be transpiled to `.js` files.

## Compatibility chart

| `@swc/core` | `@rspack/core` | `swc-plugin-allow-importing-ts-extensions` |
| ----------- | -------------- | ------------------------------------------ |
| `1.4.0` | `0.6.x` | `1.0.x` |
| `1.5.0` | | `1.1.x` |

## Usage

First, setup your `tsconfig.json` to allow importing `.ts` files extensions.
Expand Down Expand Up @@ -54,6 +61,6 @@ Then, add the plugin to your `.swcrc` file.
}
```

| option | type | default | description |
| ------------------------- | --------- | ------- | -------------------------------------------------------- |
| option | type | default | description |
| ------------------------- | --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `preserveImportExtension` | `boolean` | `false` | If `true` all imports with extension `.mts` and `.cts` with be map to `.mjs` and `.cjs` respectively, otherwise it will map to `.js` |

0 comments on commit 017d0b0

Please sign in to comment.