From 0306b15713e65ec448852a3db34c63c098026b78 Mon Sep 17 00:00:00 2001 From: frami Date: Thu, 25 Apr 2024 13:02:29 -0300 Subject: [PATCH 1/2] feat: upgrade swc_core to 0.91.0 --- Cargo.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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"] } From 017d0b02e5f9b666a9bfcff218b59cdc7defebde Mon Sep 17 00:00:00 2001 From: frami Date: Thu, 25 Apr 2024 13:07:30 -0300 Subject: [PATCH 2/2] 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` |