Hint
Ship modern ESM to capable browsers and legacy transpiled bundle to IE/old browsers — reduces bundle size for majority of users
Differential serving ships two builds: a modern one (ES2020+ with minimal transpilation) and a legacy one (ES5 for old browsers).
<!-- Modern browsers load this (smaller, faster) -->
<script type="module" src="app.modern.js"></script>
<!-- Legacy browsers (IE11) load this; modern browsers ignore it -->
<script nomodule src="app.legacy.js"></script>
Why it matters:
In practice: Vite handles this automatically via @vitejs/plugin-legacy. Next.js's browserslist config controls transpilation targets.