Sybrn
Sybrn
NNuxt
Created by Sybrn on 1/18/2025 in #❓・help
Nuxt Layer auto import types automate
I created a project with a layer for my types. I have exported them and looking for a way to auto-import them instead of using import type { Hallo } from '../types/types/Hallo'; Inside the Nuxt config of the types packages I added this:
imports: {
dirs: [
'types/**'
]
}
imports: {
dirs: [
'types/**'
]
}
Now I do have the auto imports working in the app layer that extends this types layer. But it only works after I ran nuxt prepare where it generates the types in .nuxt/types folder. Is there a way to automate that I can add or change types in my type layer without the need of running nuxt prepare? Thanks!
6 replies