Open AutomateAaron opened 1 year ago
You can add a generic to the import.meta.glob<>
that will get you what you want I think. If you load eagerly, it will look something like:
import.meta.glob<{
default: SvelteComponent
metadata: Record<string, string>
}>(''./*.md'', { eager: true })
Without eager loading I think it's more like:
import.meta.glob<{
default: Promise<SvelteComponent>
metadata: Promise<Record<string, string>>
}>('./*.md')
I'm trying to dynamically import markdown blogs using the following:
I'd like to define the type for the
blog
variable, but I can't figure out where to get a type for it.