From 76f9392160d824ab307aa8f3ef049298179e26a8 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 26 Feb 2024 11:14:16 +0100 Subject: [PATCH] docs: add instructions about moduleResolution: Bundler See #323 --- CHANGELOG.md | 2 +- docs/introduction.md | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8ea99b5c..e98da222b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -149,7 +149,7 @@ For people using the file-based routing, you now need to add `unplugin-vue-route - Data Loaders now return an `isLoading` property instead of `pending`. This aligns better with the wording of Data Loaders being in a loading state rather than pending, which can have more meanings. - - You know need to add `unplugin-vue-router/client` to the `types` property of your tsconfig. See [setup](https://uvr.esm.is/introduction.html#setup) for an example. + - You know need to add `unplugin-vue-router/client` to the `types` property of your tsconfig. See [setup](https://uvr.esm.is/introduction.html#setup) for an example. This file contains the augmentation of the `vue-router/auto` module that was previously in `typed-router.d.ts`. You also need to set the `modeResolution` to `Bundler` in your `tsconfig.json`. - the existing `defineLoader` is being replaced by a basic loader without cache. The version with cache will be implemented diff --git a/docs/introduction.md b/docs/introduction.md index 696f83953..229368154 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -76,21 +76,25 @@ build({ ## Setup -After adding this plugin, **start the dev server** (usually `npm run dev`) **to generate the first version of the types** at `typed-router.d.ts` which should be added to your `tsconfig.json` along with `unplugin-vue-router/client` to `types`. This is what it should look like: +After adding this plugin, **start the dev server** (usually `npm run dev`) **to generate the first version of the types** at `typed-router.d.ts` which should be added to your `tsconfig.json` along with `unplugin-vue-router/client` to `types` and `"moduleResolution": "Bundler"`. This is what it should look like: ::: code-group -```json{4,8} [tsconfig.json] +```json{4,8,11} [tsconfig.json] { "include": [ // other files... "./typed-router.d.ts" ], - "types": [ - // other types... - "unplugin-vue-router/client" - ] - // other options... + "compilerOptions": { + // ... + "moduleResolution": "Bundler", + "types": [ + // other types... + "unplugin-vue-router/client" + ] + // other options... + } } ```