From 017d0b02e5f9b666a9bfcff218b59cdc7defebde Mon Sep 17 00:00:00 2001 From: frami Date: Thu, 25 Apr 2024 13:07:30 -0300 Subject: [PATCH] docs: add compatibility chart --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 57db620..b443241 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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` |