Skip to content

Commit

Permalink
fix: nuxt
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed Oct 6, 2023
1 parent 503e22e commit 976379e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,21 @@ build({

You might not need this plugin for Nuxt. Use `@productdevbook/ts-i18n/nuxt` instead.

```ts
// nuxt.config.ts

export default defineNuxtConfig({
modules: [
'@productdevbook/ts-i18n/nuxt',
],

tsI18n: {
exportFilePath: './i18n.d.ts',
localesFolder: 'locales',
selectLanguage: 'en',
},
})
```

<br></details>

Expand Down
4 changes: 2 additions & 2 deletions src/unplugin/nuxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export interface ModuleOptions extends Options {

export default defineNuxtModule<ModuleOptions>({
meta: {
name: 'ts-i18n',
configKey: 'unpluginStarter',
name: 'tsI18n',
configKey: 'tsI18n',
},
setup(options, _nuxt) {
addVitePlugin(() => vite(options))
Expand Down

0 comments on commit 976379e

Please sign in to comment.