From 101eaa9bafaca1a76a8bb6270c0b63ee92bec4cb Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 20 Oct 2021 13:53:13 +0100 Subject: [PATCH] fix(nuxt3): restore `auto-imports.d.ts` to `nuxt.d.ts` (#1282) --- packages/nuxt3/src/auto-imports/module.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nuxt3/src/auto-imports/module.ts b/packages/nuxt3/src/auto-imports/module.ts index 0a6cf1bb5b..e468bf2a7b 100644 --- a/packages/nuxt3/src/auto-imports/module.ts +++ b/packages/nuxt3/src/auto-imports/module.ts @@ -77,6 +77,11 @@ export default defineNuxtModule({ } await updateAutoImports() + // Add generated types to `nuxt.d.ts` + nuxt.hook('prepare:types', ({ references }) => { + references.push({ path: resolve(nuxt.options.buildDir, 'auto-imports.d.ts') }) + }) + // Watch composables/ directory nuxt.hook('builder:watch', async (_, path) => { const _resolved = resolve(nuxt.options.srcDir, path)