calvinhnzr / slides

work in progress
0 stars 0 forks source link

[FEATURE] Migrate to Astro #2

Closed calvinhnzr closed 3 days ago

calvinhnzr commented 5 days ago

Motivation: Dynamic imports of Folder and Subfolders of mdx

calvinhnzr commented 3 days ago

First Migration Atempt failed. Not working like the bewished way:

calvinhnzr commented 3 days ago

Alternative Solution found: https://vite.dev/guide/features#glob-import

const modules = import.meta.glob("@/slides/*.mdx")

for (const path in modules) {
  modules[path]().then((module) => {
    // Verwende das importierte Modul
    console.log(module)
  })
}