-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add SWC compatibility note for Vite guide (#2002)
- Loading branch information
1 parent
304e65b
commit dc7f7aa
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|