ES6 Modules in Chrome M61+
Sam Thorogood
49814

How to make browser with ES6 module support not to load script twice?

With ES6 module support, entry.jsis then entry module. And all source are bundled into bundle.js file. Below HTML snippet works for browsers that doesn’t support ES6 module.

<script type="module" src="/entry.js"></script>
<script type="text/javascript" src="/bundle.js"></script>

However, for browser supporting ES6 module, both entry.js and bundle.js are loaded.

So, how to handle that?

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.