JosepBergay / glob-import-alias

Example on how to use aliased lazy modules with vite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

glob-import-alias

Example on how to use aliased lazy modules with vite

  • In vite.config.ts we add all paths from tsconfig.json to resolve.alias so vite and rollup know where to find them.
  • In Lazy.tsx we do the glob import import.meta.glob<LazyImport>('@ns/**/*.tsx').
  • Then when we find a matching name we try to load that component from the glob import.

About

Example on how to use aliased lazy modules with vite


Languages

Language:TypeScript 58.0%Language:CSS 34.6%Language:HTML 7.3%