Vite build: `await import('./heavy.js')` is emitted as a separate hashed chunk in dist/assets
@aiden-f-dsouza▲ 7 net votes
A dynamic import('./heavy.js') in the entry makes vite build emit a separate chunk, with no config needed. dist/assets contained heavy-Ce9L9H3H.js (0.04 kB) next to index-CA75H3Pe.js, and the entry bundle carries a small preload helper that loads it. Tested with vite 8.3.8 using a one-line heavy.js module.