docs: clarify that bridge.typescript option must be set. (#23503)

This commit is contained in:
Ryota Watanabe 2023-10-03 01:02:49 +09:00 committed by GitHub
parent ad2a900fda
commit 46114393f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View File

@ -5,6 +5,19 @@
- Remove `@nuxt/typescript-build`: Bridge enables same functionality - Remove `@nuxt/typescript-build`: Bridge enables same functionality
- Remove `@nuxt/typescript-runtime` and `nuxt-ts`: Nuxt 2 has built-in runtime support - Remove `@nuxt/typescript-runtime` and `nuxt-ts`: Nuxt 2 has built-in runtime support
### Set `bridge.typescript`
```ts
import { defineNuxtConfig } from '@nuxt/bridge'
export default defineNuxtConfig({
bridge: {
typescript: true,
nitro: false // If migration to Nitro is complete, set to true
}
})
```
## Update `tsconfig.json` ## Update `tsconfig.json`
If you are using TypeScript, you can edit your `tsconfig.json` to benefit from auto-generated Nuxt types: If you are using TypeScript, you can edit your `tsconfig.json` to benefit from auto-generated Nuxt types:

View File

@ -43,7 +43,8 @@ import { defineNuxtConfig } from '@nuxt/bridge'
export default defineNuxtConfig({ export default defineNuxtConfig({
bridge: { bridge: {
capi: true capi: true,
nitro: false // If migration to Nitro is complete, set to true
} }
}) })
``` ```

View File

@ -12,7 +12,8 @@ If you need to use the Options API, there is a `head()` method you can use when
import { defineNuxtConfig } from '@nuxt/bridge' import { defineNuxtConfig } from '@nuxt/bridge'
export default defineNuxtConfig({ export default defineNuxtConfig({
bridge: { bridge: {
meta: true meta: true,
nitro: false // If migration to Nitro is complete, set to true
} }
}) })
``` ```