fix(nuxt3): restore auto-imports.d.ts to nuxt.d.ts (#1282)

This commit is contained in:
Daniel Roe 2021-10-20 13:53:13 +01:00 committed by GitHub
parent ffb05fc734
commit 101eaa9baf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,11 @@ export default defineNuxtModule<AutoImportsOptions>({
} }
await updateAutoImports() 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 // Watch composables/ directory
nuxt.hook('builder:watch', async (_, path) => { nuxt.hook('builder:watch', async (_, path) => {
const _resolved = resolve(nuxt.options.srcDir, path) const _resolved = resolve(nuxt.options.srcDir, path)