I am trying to use Object.assign() in an ES6 web application compiled by Babel with webpack, but I get an error:
Uncaught TypeError: Object.assign is not a function
I already use babel-loader to upgrade ES6 to ES5, so all my other ES6 codes work. However, Object.assign() only works after I also import "babel-core/polyfill" in my code base. I see that I can also fix this by importing babel-runtime , but I would like to understand why Object.assign() requires more than babel-loader does - shouldn 't babel-loader preprocess everything, including Object.assign() ?
javascript ecmascript-6 webpack babeljs
Collin Allen Aug 21 '15 at 19:46 2015-08-21 19:46
source share