fix(nuxt): generate typed route declarations when building (#25593)

This commit is contained in:
Ryan Clements 2024-02-03 18:16:42 -05:00 committed by GitHub
parent 876d910c3f
commit 21d6dcef5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,7 +182,7 @@ export default defineNuxtModule({
await mkdir(dirname(dtsFile), { recursive: true })
await context.scanPages(false)
if (nuxt.options._prepare) {
if (nuxt.options._prepare || !nuxt.options.dev) {
// TODO: could we generate this from context instead?
const dts = await readFile(dtsFile, 'utf-8')
addTemplate({