fix(kit): don't unsubscribe from file writing

This commit is contained in:
Daniel Roe 2023-07-31 15:44:25 +01:00
parent 3159bb4f65
commit 716a5b8341

View File

@ -232,11 +232,9 @@ export async function writeTypes (nuxt: Nuxt) {
// This is needed for Nuxt 2 which clears the build directory again before building
// https://github.com/nuxt/nuxt/blob/2.x/packages/builder/src/builder.js#L144
// @ts-expect-error TODO: Nuxt 2 hook
const unsub = nuxt.hook('builder:prepared', writeFile)
nuxt.hook('builder:prepared', writeFile)
await writeFile()
unsub()
}
function renderAttrs (obj: Record<string, string>) {