Skip to content

Commit

Permalink
docs: add SWC compatibility note for Vite guide (#2002)
Browse files Browse the repository at this point in the history
  • Loading branch information
timofei-iatsenko authored Aug 14, 2024
1 parent 304e65b commit dc7f7aa
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions website/docs/tutorials/setup-vite.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,32 @@ The Lingui Vite integration:
npm install --save @lingui/react @lingui/macro
```
:::note
SWC Plugin support is still experimental. Semver backwards compatibility between different `@swc/core` versions [is not guaranteed](https://github.com/swc-project/swc/issues/5060).
You need to select an appropriate version of the `@lingui/swc-plugin` to match compatible `@swc/core` version.
The version of `@swc/core` is specified within the `@vitejs/plugin-react-swc` package.
To ensure that the resolved version of `@swc/core` is one of the supported versions, you may utilize the `resolutions` field in the `package.json` file, which is supported by Yarn:
```json
"resolutions": {
"@swc/core": "1.3.56"
},
```
or `overrides` for >[email protected]
```json
"overrides": {
"@swc/core": "1.3.56"
},
```
For more information on compatibility, please refer to the [Compatibility section](https://github.com/lingui/swc-plugin#compatibility).
:::
2. Setup Lingui in `vite.config.ts`:
```ts title="vite.config.ts"
Expand Down

0 comments on commit dc7f7aa

Please sign in to comment.