feat(nuxt): support separate server tsconfig (#20559)

This commit is contained in:
Daniel Roe 2023-05-15 16:36:30 +01:00 committed by GitHub
parent e9b2f6286c
commit 33e2bd3dc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -92,7 +92,9 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
layer => resolve(layer.config.srcDir, 'app.config')
),
typescript: {
generateTsConfig: false
strict: true,
generateTsConfig: true,
tsconfigPath: 'tsconfig.server.json'
},
publicAssets: [
nuxt.options.dev

View File

@ -1,3 +1,9 @@
let counter = 0
const test = () => () => {
// TODO: useNuxtApp should be undefined when type-testing a nitro route
useNuxtApp()
}
test()
export default defineEventHandler(() => ({ count: counter++ }))

View File

@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}