finds.dev← search

// the find

philipwalton/webpack-esnext-boilerplate

★ 513 · JavaScript · updated Jan 2023

A webpack boilerplate implementing the module/nomodule pattern — ship ES2015+ to modern browsers via <script type="module"> while serving transpiled fallback bundles to IE via <script nomodule>. It's the canonical implementation of Philip Walton's 2017 technique, with code splitting and asset fingerprinting wired up correctly. Primarily useful as a reference, not a starter template you'd fork today.

The webpack config correctly handles two separate compilation targets (modern and legacy) in a single build pipeline, which is genuinely tricky to get right. Code splitting and dynamic imports work across both output targets, meaning chunk hashes align between the module and nomodule bundles. Asset fingerprinting is included so cache-busting works properly. The task structure in /tasks/ is readable — each concern (compile, bundle, templates, watch) is its own file rather than one monolithic webpack.config.js.

IE11 is dead — Microsoft pulled support in June 2022 — so the entire nomodule fallback is now dead weight for almost every project. The last meaningful work here predates 2023 significantly; the repo is essentially archived. Vite handles the modern/legacy split natively with @vitejs/plugin-legacy in a fraction of the configuration, making this approach obsolete. It's also a copy-and-modify boilerplate, not a package, so there's no upgrade path — you're on your own the moment you fork it.

View on GitHub →

// 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 →