I have a small Javascript app that executes on webpages. It can run in most modern browsers but not old ones like IE (because it uses some features like Promise ). I can use babel/preset-env with useBuiltIns:usage
with browserlist config to add polyfills required to get it run in all target browsers including IE9. However, the file size triples with the polyfills added.
I would like to have a separate file containing only the polyfills required and load that file manually on to the page when necessary (when detected it is IE9, for example).
To achieve this I need to know what polyfills Babel applies when I use useBuiltIns:usage
, so that I can manually include those features in a separate Webpack entry. I will then use useBuiltIns:false
for the app.
Is there a way to list what polyfills babel/preset-env applies?