Skip to content

Commit

Permalink
docs(vite-setup): add missing dependencies and show ts configuration (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
timofei-iatsenko authored Mar 23, 2023
1 parent 5533437 commit c28e451
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions website/docs/tutorials/setup-vite.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Lingui Vite integration:
1. Install `@lingui/cli`, `babel-plugin-macros` as development dependencies and `@lingui/macro`, `@lingui/react` as a runtime dependency:

```bash npm2yarn
npm install --save-dev @lingui/cli babel-plugin-macros
npm install --save-dev @lingui/cli @lingui/vite-plugin babel-plugin-macros
npm install --save @lingui/react @lingui/macro
```

Expand Down Expand Up @@ -45,7 +45,7 @@ The Lingui Vite integration:
1. Install `@lingui/cli`, `@lingui/swc-plugin` as development dependencies and `@lingui/macro`, `@lingui/react` as a runtime dependency:
```bash npm2yarn
npm install --save-dev @lingui/cli @lingui/swc-plugin
npm install --save-dev @lingui/cli @lingui/vite-plugin @lingui/swc-plugin
npm install --save @lingui/react @lingui/macro
```
Expand All @@ -67,18 +67,20 @@ The Lingui Vite integration:
```
## Further Setup
1. Create a `lingui.config.js` file with LinguiJS configuration in the root of your project (next to `package.json`). Replace `src` with a directory name where you have source files:
```js title="lingui.config.js"
/** @type {import('@lingui/conf').LinguiConfig} */
module.exports = {
locales: ["en", "cs", "fr"],
catalogs: [{
path: "src/locales/{locale}",
include: ["src"]
}],
format: "po"
1. Create a `lingui.config.ts` file with LinguiJS configuration in the root of your project (next to `package.json`). Replace `src` with a directory name where you have source files:
```ts title="lingui.config.ts"
import type { LinguiConfig } from "@lingui/conf"
const config: LinguiConfig = {
locales: ["en", "cs", "fr"],
catalogs: [{
path: "src/locales/{locale}",
include: ["src"]
}],
}
export default config
```
PO format is recommended for message catalogs, and could be compiled on the fly thanks to `@lingui/vite-plugin`.
Expand Down

1 comment on commit c28e451

@vercel
Copy link

@vercel vercel bot commented on c28e451 Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.