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)