From 7f57b8c2deb6d7334b4edace797baa1837797d19 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 21 Jul 2022 14:33:43 +0100 Subject: [PATCH 1/2] fix(nuxt): write nitro types when building --- packages/nuxt/src/core/nitro.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/nitro.ts b/packages/nuxt/src/core/nitro.ts index 086fd8ee1da..ac1db645971 100644 --- a/packages/nuxt/src/core/nitro.ts +++ b/packages/nuxt/src/core/nitro.ts @@ -141,7 +141,7 @@ export async function initNitro (nuxt: Nuxt) { // Add typed route responses nuxt.hook('prepare:types', async (opts) => { - if (nuxt.options._prepare) { + if (nuxt.options._prepare || !nuxt.options.dev) { await scanHandlers(nitro) await writeTypes(nitro) } From 6478474cd89287c0a73bc828ba0cf9ddec30c172 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 21 Jul 2022 14:48:33 +0100 Subject: [PATCH 2/2] perf: simplify test --- packages/nuxt/src/core/nitro.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/nitro.ts b/packages/nuxt/src/core/nitro.ts index ac1db645971..c938e1ccff0 100644 --- a/packages/nuxt/src/core/nitro.ts +++ b/packages/nuxt/src/core/nitro.ts @@ -141,7 +141,7 @@ export async function initNitro (nuxt: Nuxt) { // Add typed route responses nuxt.hook('prepare:types', async (opts) => { - if (nuxt.options._prepare || !nuxt.options.dev) { + if (!nuxt.options.dev) { await scanHandlers(nitro) await writeTypes(nitro) }