Skip to content

Commit

Permalink
docs: note about ssr noExternal
Browse files Browse the repository at this point in the history
Close #349
  • Loading branch information
posva committed May 9, 2024
1 parent da90820 commit 63beb30
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,20 @@ VueRouter({
::: tip
Highlight any of the options to see more details about it.
:::

## SSR

It might be necessary to mark `vue-router` as `noExternal` in your `vite.config.js` in development mode:

```ts{7}
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import VueRouter from 'unplugin-vue-router/vite'
export default defineConfig(({ mode }) => ({
ssr: {
noExternal: mode === 'development' ? ['vue-router'] : [],
},
plugins: [VueRouter(), Vue()],
}))
```

0 comments on commit 63beb30

Please sign in to comment.