https://github.com/mindreframer/vitejs-react-bundle-split-example
Minimal dependency-free showcase for code-splitting in Vite.js (v2) + React
https://github.com/mindreframer/vitejs-react-bundle-split-example
bundling codesplitting vitejs
Last synced: about 1 month ago
JSON representation
Minimal dependency-free showcase for code-splitting in Vite.js (v2) + React
- Host: GitHub
- URL: https://github.com/mindreframer/vitejs-react-bundle-split-example
- Owner: mindreframer
- Created: 2021-03-31T15:45:10.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-31T16:22:10.000Z (about 5 years ago)
- Last Synced: 2025-08-31T09:38:24.485Z (9 months ago)
- Topics: bundling, codesplitting, vitejs
- Language: TypeScript
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
### Minimal dependency-free showcase for code-splitting in Vite.js (v2) + React
- uses convention to load pages (/pages/Page\*.tsx)
- generates the pagesMap.ts file (to keep the mapping automated) - `yarn gen:pageMap`
- provides a loading component
### Useful links:
- https://vitejs.dev/guide/features.html#glob-import
- https://github.com/mrmlnc/fast-glob#pattern-syntax
- https://twitter.com/youyuxi/status/1351355267296993280 (With import.meta.glob you don't really need plugins for Next/Nuxt-style file-system routing in Vite - and it works with SSR already )
- https://github.com/vitejs/vite/issues/1875
### Alternatives, that did not work out (still useful to see the concepts)
⏳ A higher order component for loading components with promises.
- https://github.com/jamiebuilds/react-loadable