From 8b3e1f028c521d7a3f1e4b068411e4a0a0f38577 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 22 May 2024 17:59:05 +0200 Subject: [PATCH] docs: update ts instructions --- README.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 50579d6c6..1d13f608d 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ build({ ## Setup -After installing, **you should run your dev server** (usually `npm run dev`) **to generate the first version of the types**. Then you need to add the types to your `tsconfig.json`: +After installing, **you should run your dev server** (usually `npm run dev`) **to generate the first version of the types**. Then you need to add the types to your `tsconfig.json`. ```json { @@ -129,9 +129,27 @@ After installing, **you should run your dev server** (usually `npm run dev`) **t // ... "compilerOptions": { // ... - "moduleResolution": "Bundler", + "moduleResolution": "Bundler" + // ... + } +} +``` + +Then, if you have an `env.d.ts` file like the one created by `npm vue create `, add the `unplugin-vue-router/client` types to it: + +```ts +// env.d.ts +/// +/// +``` + +If you don't have an `env.d.ts` file, you can create one and add the unplugin-vue-router types to it _or_ you can add them to the `types` property in your `tsconfig.json`: + +```json +{ + "compilerOptions": { + // ... "types": [ - // ... "unplugin-vue-router/client" ] }