Skip to content

Commit

Permalink
docs: add instructions about moduleResolution: Bundler
Browse files Browse the repository at this point in the history
See #323
  • Loading branch information
posva committed Feb 26, 2024
1 parent 80a2251 commit 76f9392
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 11 additions & 7 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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...
}
}
```

Expand Down

0 comments on commit 76f9392

Please sign in to comment.