We\'re writing an app using webpack and babel-core 5.8.25
.
At one point in time, this happens:
someArray.map(item => {
const update
Object.assign
works in Chrome because Chrome supports it natively. babel-loader
on its own only converts ES6 syntax to ES5 syntax, it does not do anything to make ES6 library functionality available. The easiest way to do that with Webpack is to change your config from something like
entry: 'app.js'
to
entry: ['babel-core/polyfill', 'app.js']
// Or with Babel 6:
entry: ['babel-polyfill', 'app.js']
so that Webpack will also bundle and run the polyfill before executing your application. Babel provides /polyfill
as an easy way to load the polfill, but it is optional because not everyone wants to use it, and because there are many polyfills available and the one Babel uses, core-js is just one of many.