mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 15:10:58 +00:00
fix(nuxt): exclude nitro output dir from type checking (#19532)
This commit is contained in:
parent
4a934a5069
commit
17f080cad1
@ -1,5 +1,5 @@
|
|||||||
import { existsSync, promises as fsp } from 'node:fs'
|
import { existsSync, promises as fsp } from 'node:fs'
|
||||||
import { resolve, join } from 'pathe'
|
import { resolve, join, relative } from 'pathe'
|
||||||
import { createNitro, createDevServer, build, prepare, copyPublicAssets, writeTypes, scanHandlers, prerender } from 'nitropack'
|
import { createNitro, createDevServer, build, prepare, copyPublicAssets, writeTypes, scanHandlers, prerender } from 'nitropack'
|
||||||
import type { NitroConfig, Nitro } from 'nitropack'
|
import type { NitroConfig, Nitro } from 'nitropack'
|
||||||
import { logger, resolvePath } from '@nuxt/kit'
|
import { logger, resolvePath } from '@nuxt/kit'
|
||||||
@ -226,6 +226,9 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
|||||||
await scanHandlers(nitro)
|
await scanHandlers(nitro)
|
||||||
await writeTypes(nitro)
|
await writeTypes(nitro)
|
||||||
}
|
}
|
||||||
|
// Exclude nitro output dir from typescript
|
||||||
|
opts.tsConfig.exclude = opts.tsConfig.exclude || []
|
||||||
|
opts.tsConfig.exclude.push(relative(nuxt.options.buildDir, resolve(nuxt.options.rootDir, nitro.options.output.dir)))
|
||||||
opts.references.push({ path: resolve(nuxt.options.buildDir, 'types/nitro.d.ts') })
|
opts.references.push({ path: resolve(nuxt.options.buildDir, 'types/nitro.d.ts') })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user