From 3ee6c93b3bd1d5f1b6e339b63aba07467c6264de Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 24 Apr 2023 15:23:28 +0800 Subject: [PATCH] docs: add more instructions about the Node.js TSConfig --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 33fd6d9..092f065 100644 --- a/README.md +++ b/README.md @@ -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": [