rollup-plugin-shims
Shim only used ES2015+ features in ES5 environment
Last updated 3 months ago by m7r .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rollup-plugin-shims 
SYNC missed versions from official npm registry.

Rollup Plugin Shims

Add shims to use some ES2015+ methods in a ES5 environment

Installation

npm install --save-dev rollup-plugin-shims

Usage

// rollup.config.js
import shims from 'rollup-plugin-shims';

export default {
  input: 'main.js',
  output: {
    file: 'bundle.js',
    format: 'iife',
    name: 'MyModule'
  },
  plugins: [
    shims(
      // optional array shims to skip
      // for example to exclude a not required instance method
      ['array.includes']
    )
  ]
}

Not included shims

Some funtions could only shimed partial. This ones are not included in this plugin. Please consider to use a more profound soltution like core-js.

ES2015

  • Promise
  • Symbol
  • Reflect
  • Proxy
  • Map / WeakMap
  • Set / WeakSet
  • Array.prototype.keys()
  • Array.prototype.values()
  • Array.prototype.entries()
  • String.prototype.anchor() and other HTML generators

ES2017

  • Object.getOwnPropertyDescriptors()

License

MIT

Current Tags

  • 1.1.2                                ...           latest (3 months ago)

7 Versions

  • 1.1.2                                ...           3 months ago
  • 1.1.1                                ...           3 months ago
  • 1.1.0                                ...           3 months ago
  • 1.0.4                                ...           6 months ago
  • 1.0.3                                ...           8 months ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 2
Dependencies (2)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |