Skip to content

Commit 17cc60c

Browse files
authored
docs(vite-plugin-vue-i18n): update configuration (#144)
1 parent 5dea712 commit 17cc60c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/vite-plugin-vue-i18n/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,12 @@ If you are using the runtime version, you will need to compile before importing
4646

4747
#### Vite Config
4848

49-
the below example that `examples/composition/vite.config.ts`:
50-
5149
```ts
52-
import path from 'path'
5350
import { defineConfig } from 'vite'
51+
import { resolve, dirname } from 'node:path'
52+
import { fileURLToPath } from 'url'
5453
import vue from '@vitejs/plugin-vue'
55-
import vueI18n from '@intlify/vite-plugin-vue-i18n'
54+
import { vueI18n } from '@intlify/vite-plugin-vue-i18n'
5655

5756
export default defineConfig({
5857
plugins: [
@@ -62,7 +61,7 @@ export default defineConfig({
6261
// compositionOnly: false,
6362

6463
// you need to set i18n resource including paths !
65-
include: path.resolve(__dirname, './path/to/src/locales/**')
64+
include: resolve(dirname(fileURLToPath(import.meta.url)), './path/to/src/locales/**'),
6665
})
6766
]
6867
})

0 commit comments

Comments
 (0)