rollup-plugin-polyfill
plugin to prepends bundles with a source file or module
Last updated 4 years ago by jrjurman .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rollup-plugin-polyfill 
SYNC missed versions from official npm registry.

rollup-plugin-polyfill

Rollup Plugin to include a polyfill in your bundle. Literally injects a require or import statement in the beginning of your entry files. This is useful if you only want to include certain logic in some variants of your build.

API

polyfill(packages)

  • packages is a list of modules to be resolved in your bundle.

Usage

Check out the example folder to see more configurations

const polyfill = require('rollup-plugin-polyfill')
const resolve = require('rollup-plugin-node-resolve')
const commonjs = require('rollup-plugin-commonjs')

const plugins = [
  resolve(),
  commonjs(),
  polyfill(['es6-object-assign/auto', './string-reverse.js']),
]

export default {
  input: 'index.js',
  output: {
    file: 'bundle.js',
    format: 'iife',
    name: 'example'
  },
  plugins: plugins
}

Current Tags

  • 4.0.0                                ...           latest (4 years ago)

5 Versions

  • 4.0.0                                ...           4 years ago
  • 3.0.0                                ...           7 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 4
Last Month 1
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |