Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mc-zone/webpack2-polyfill-plugin
Insert polyfills (such as Promise) for Webpack 2
https://github.com/mc-zone/webpack2-polyfill-plugin
polyfill promise webpack
Last synced: 2 months ago
JSON representation
Insert polyfills (such as Promise) for Webpack 2
- Host: GitHub
- URL: https://github.com/mc-zone/webpack2-polyfill-plugin
- Owner: mc-zone
- License: mit
- Created: 2016-09-12T03:25:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-10T02:45:02.000Z (almost 8 years ago)
- Last Synced: 2024-11-10T12:52:21.830Z (2 months ago)
- Topics: polyfill, promise, webpack
- Language: JavaScript
- Homepage:
- Size: 23.4 KB
- Stars: 18
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Webpack2 Polyfill Plugin [![Build Status](https://travis-ci.org/mc-zone/webpack2-polyfill-plugin.svg?branch=master)](https://travis-ci.org/mc-zone/webpack2-polyfill-plugin) [![npm version](https://badge.fury.io/js/webpack2-polyfill-plugin.svg)](http://badge.fury.io/js/webpack2-polyfill-plugin)
Insert polyfills for Webpack2
## Includes:
* Promise
* Function.prototype.bind
* Object.keys
* Object.defineProperty (__defineGetter__/__defineSetter__)See:[What's new in webpack 2](https://gist.github.com/sokra/27b24881210b56bbaff7?utm_source=javascriptweekly&utm_medium=email#minor-breaking-changes)
## How to use:
step 1. Install
`npm install webpack2-polyfill-plugin --save`
step 2. Use plugin at your webpack config
```javascript
var Webpack2Polyfill = require("webpack2-polyfill-plugin");module.exports = {
//...
plugins: [
new Webpack2Polyfill()
]
};
```## Compatible:
IE.9 and above (Currently)
## Why not IE8 ?
IE8 can't use Object.defineProperty with non-DOM Object. So can't do polyfill with some [Webpack2 Usage](https://gist.github.com/sokra/27b24881210b56bbaff7?utm_source=javascriptweekly&utm_medium=email#other-polyfills) (Ex: Using defineProperty at `exports` for Harmony Export).
## License
MIT