webpack - how to load a chunked polyfill file as necessary
Clash Royale CLAN TAG #URR8PPP webpack - how to load a chunked polyfill file as necessary So the recommended way to prevent loading polyfills if it's unnecessary is to put some logic in the <head> (original: https://webpack.js.org/guides/shimming/) <head> <script> var modernBrowser = ( 'fetch' in window && 'assign' in Object ); if ( !modernBrowser ) { var scriptElement = document.createElement('script'); scriptElement.async = false; scriptElement.src = './polyfills.bundle.js'; document.head.appendChild(scriptElement); } </script> However, as my files are chunked, it will not be consistent e.g. polyfills.b0d50a4c4d9ca24a9f43.js . polyfills.b0d50a4c4d9ca24a9f43.js So what's the best way to implement this logic (in webpack or just in the index.html ) index.html Note I work with Vue, so maybe I could just import it in the App component? App E.g. var m...