Consider switching from `babel-preset-es2015` to `babel-preset-env`
See: https://github.com/babel/babel-preset-env
The babel environment preset is a smarter preset that will add or remove babel transformation plugins based on your target environment. In our case we can plug in our officially supported browsers and babel will configure itself to only transform what is necessary for those browsers to work. It should save on compile-time as well as code size. For instance if all of the browsers we support work with let/const
or trailing-commas babel won't have to go through the trouble of converting these things for us and will just pass them through.
Note: this is not about polyfills, this is specifically for babel transpiling configuration. Though if we wanted to adopt some sort of automatic polyfill we can use this same target-environment configuration to do so.
Example config:
presets: [
["env", {targets: ['> 4%', 'ie 11', 'safari 8']}]
]
This would target all browsers which have > 4% market share, plus IE 11 and Safari 8.