0

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
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336

0 Answers0