Skip to content

Commit

Permalink
docs: add more instructions about the Node.js TSConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
sodatea committed Apr 24, 2023
1 parent aedae83 commit 3ee6c93
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -36,7 +36,16 @@ First install the base tsconfig and types for the Node.js version you are target
npm add -D @tsconfig/node18 @types/node@18
```

Then extend the Node.js tsconfig and the Vue tsconfig in your `tsconfig.json`:
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",
"compilerOptions": [
"types": ["node"]
]
```

Otherwise, if you are trying to use Vue components in Node.js environments (e.g. Server Side Rendering, Vitest, etc.), you will need to extend the Vue TSConfig along with the Node.js TSConfig:

```json
"extends": [
Expand Down

0 comments on commit 3ee6c93

Please sign in to comment.