When bundling an ES module with webpack:
https://webpack.js.org/guides/ecma-script-modules/
Does the <script type="module" src="main.js"></script>
tag gets automatically added to the index.html
file? Is there a plugin for it?
Also, how can I make sure that:
- Modern browsers will download and use only the module version
- Legacy browsers will download and use only the cjs webpack bundled version