animotionjs / animotion

🪄 Create beautiful presentations with Svelte
https://animotion.pages.dev
MIT License
1.38k stars 41 forks source link

fix: import `defineProps` separately to allow import in module #44

Closed paoloricciuti closed 1 month ago

paoloricciuti commented 1 month ago

As per title...the problem is that import.meta.glob with eager get's converted to a series of static import...this means that as soon as you imported something from @animotion/core the module resolution would've:

  1. imported index
  2. imported /components/index
  3. imported /components/slides
  4. in there imported the slide component with import.meta.glob before the defineProps import...so it was undefined

I moved the export to the root index before the export * so that now it's immediately defined (p.s. i've also changed the defineProps to only import the type of Slide).

mattcroat commented 1 month ago

thank you 😄