Insert polyfills for Webpack2
- Promise
- Function.prototype.bind
- Object.keys
- Object.defineProperty (defineGetter/defineSetter)
step 1. Install
npm install webpack2-polyfill-plugin --save
step 2. Use plugin at your webpack config
var Webpack2Polyfill = require("webpack2-polyfill-plugin");
module.exports = {
//...
plugins: [
new Webpack2Polyfill()
]
};
IE.9 and above (Currently)
IE8 can't use Object.defineProperty with non-DOM Object. So can't do polyfill with some Webpack2 Usage (Ex: Using defineProperty at exports
for Harmony Export).
MIT