Skip to content

Commit 109d23e

Browse files
authored
docs: Add SSR configuration guide for vue-i18n plugin (#2262)
1 parent 3a37800 commit 109d23e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/guide/advanced/optimization.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,23 @@ The replacement value **must be boolean literals** and cannot be strings, otherw
178178
You can use pre-translation(server-side rendering) with vue-i18n-extensions package.
179179
180180
About how to usage, see [here](https://github.com/intlify/vue-i18n-extensions).
181+
182+
## SSR (Server-Side Rendering)
183+
184+
### Configure plugin for SSR
185+
186+
For SSR applications, you need to configure the `ssr` option in [@intlify/unplugin-vue-i18n](https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#ssr):
187+
188+
```js
189+
// vite.config.ts
190+
import { defineConfig } from 'vite'
191+
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
192+
193+
export default defineConfig({
194+
plugins: [
195+
VueI18nPlugin({
196+
ssr: true, // Enable SSR support
197+
}),
198+
],
199+
})
200+
```

0 commit comments

Comments
 (0)