Skip to content

Commit 63beb30

Browse files
committed
docs: note about ssr noExternal
Close #349
1 parent da90820 commit 63beb30

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/guide/configuration.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,20 @@ VueRouter({
7474
::: tip
7575
Highlight any of the options to see more details about it.
7676
:::
77+
78+
## SSR
79+
80+
It might be necessary to mark `vue-router` as `noExternal` in your `vite.config.js` in development mode:
81+
82+
```ts{7}
83+
import { defineConfig } from 'vite'
84+
import Vue from '@vitejs/plugin-vue'
85+
import VueRouter from 'unplugin-vue-router/vite'
86+
87+
export default defineConfig(({ mode }) => ({
88+
ssr: {
89+
noExternal: mode === 'development' ? ['vue-router'] : [],
90+
},
91+
plugins: [VueRouter(), Vue()],
92+
}))
93+
```

0 commit comments

Comments
 (0)