finds.dev← search

// the find

philipwalton/rollup-native-modules-boilerplate

★ 224 · JavaScript · updated Feb 2024

A demo app showcasing the use of real JavaScript modules in production—complete with cross-browser fallbacks for legacy browsers.

A demo repo by Philip Walton (Google Chrome team) illustrating the module/nomodule pattern: ship modern ES module bundles to capable browsers, ship a legacy bundle to everything else, all via Rollup. It was the right answer circa 2019 when IE11 was still a real concern. IE11 is gone now.

- The Rollup config is the actual teaching artifact — it shows code splitting, dynamic import, CommonJS interop, asset hashing, and dual-bundle output in one place, which is still useful for understanding what bundlers actually do

- Philip Walton wrote the companion article too, so the repo and the explanation evolve together — it's not orphaned documentation

- The module/nomodule HTML pattern is implemented cleanly, making it easy to see exactly how browsers self-select the right bundle without JavaScript feature detection

- The core problem it solves no longer exists: IE11 market share is effectively zero and all modern browsers have supported native ES modules for years, so the nomodule fallback is dead weight in 2024

- It's a demo, not a starter — no tests, no CI, no linting pipeline worth reusing, and the Glitch demo link is the only deployed artifact

- React + hand-rolled Rollup config is a pattern nobody wants to maintain; Vite handles all of this transparently and is what you'd actually pick for a new project

- The last meaningful change was years before the 2024 bump, which looks like a dependency nudge rather than active maintenance — the technique has been superseded but the repo hasn't acknowledged it

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →