2 ms·
One day browsers will natively support modules and "Bundle Splitting" as the article calls it will just be the intuitive and automatic thing to do. Until then w
by akersten 5y ago
One day browsers will natively support modules and "Bundle Splitting" as the article calls it will just be the intuitive and automatic thing to do. Until then we have webpack.
- mattacular 5y agoMost browsers do support js modules today but it's kind of an awkward situation to say the least. And if you need to support older browsers you may as well not bother, you probably use Webpack and/or Babel (or TypeScript) anyway for other reasons. Especially if you're trying to do isomorphic stuff for an SSR app, as NodeJS then has its own pile of idiosyncrasies and baggage around module support. This situation has been playing out for many years and it has only gotten more confusing.
- dbbk 5y agoThey do…
- engido9740 5y agoUnless you're still supporting IE, which is a big gotcha for some I know, then modules are a go now: https://caniuse.com/?search=modules https://caniuse.com/?search=modules Vite is one of the first tools I know of taking advantage of this: https://vitejs.dev/ https://vitejs.dev/ "On demand file serving over native ESM, no bundling required!" I just launched a small production site using SvelteKit, which now uses this under the hood.