Skip to content

Commit

Permalink
docs: update the examples to use Node.js 22 as it's the active LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Nov 9, 2024
1 parent 22e15e3 commit 354b7df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ Add one of the available configurations to your `tsconfig.json`:
First install the base tsconfig and types for the Node.js version you are targeting, for example:

```sh
npm add -D @tsconfig/node18 @types/node@18
npm add -D @tsconfig/node22 @types/node@22
```

If you are not using any bundlers, the Node.js code doesn't rely on any Vue/Vite-specific features, then these would be enough, you may not need to extend the Vue TSConfig:

```json
"extends": "@tsconfig/node18/tsconfig.json",
"extends": "@tsconfig/node22/tsconfig.json",
"compilerOptions": {
"types": ["node"]
}
Expand All @@ -49,15 +49,15 @@ Otherwise, if you are trying to use Vue components in Node.js environments (e.g.

```json
"extends": [
"@tsconfig/node18/tsconfig.json",
"@tsconfig/node22/tsconfig.json",
"@vue/tsconfig/tsconfig.json"
],
"compilerOptions": {
"types": ["node"]
}
```

Make sure to place `@vue/tsconfig/tsconfig.json` *after* `@tsconfig/node18/tsconfig.json` so that it takes precedence.
Make sure to place `@vue/tsconfig/tsconfig.json` *after* `@tsconfig/node22/tsconfig.json` so that it takes precedence.

## Emitting Declaration Files

Expand Down

0 comments on commit 354b7df

Please sign in to comment.