diff --git a/Cargo.toml b/Cargo.toml index c6a4f5e..52d7910 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,18 +24,18 @@ strip = "symbols" [dependencies] serde = { version = "1.0.197", features = ["derive"] } serde_json = "1.0.115" -swc_core = { version = "0.90.30", features = ["ecma_plugin_transform"] } -swc_ecma_ast = "0.112.7" -swc_ecma_visit = "0.98.7" +swc_core = { version = "0.91.0", features = ["ecma_plugin_transform"] } +swc_ecma_ast = "0.113.0" +swc_ecma_visit = "0.99.0" swc_plugin_macro = "0.9.16" [dev-dependencies] swc_atoms = "0.6.6" swc_common = "0.33.22" -swc_ecma_parser = "0.143.13" -swc_ecma_transforms_base = "0.137.19" -swc_ecma_transforms_testing = "0.140.18" -swc_ecma_transforms_typescript = "0.188.18" -swc_ecma_utils = "0.127.17" +swc_ecma_parser = "0.144.0" +swc_ecma_transforms_base = "0.138.0" +swc_ecma_transforms_testing = "0.141.0" +swc_ecma_transforms_typescript = "0.189.0" +swc_ecma_utils = "0.128.0" testing = "0.35.22" tracing = { version="0.1", features = ["release_max_level_info"] } 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` |