gulp-polyfiller

v0.0.1
A polyfill combinator
gulp gulpplugin polyfill es5 es6 es7 ecmascript harmony strawman and 1 more...

gulp-polyfiller

npm version badge Build Status License

Gulp task for Polyfiller

Getting Started

If you haven't used [Gulp](ht tp://gulpjs.com/) before, be sure to check out the Getting Started guide, as it explains how to create a gulpfile as well as install and use Gulp plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install --save-dev gulp-polyfiller

Usage Example

var gulp = require('gulp');
var polyfiller = require('gulp-polyfiller');

gulp.task('default', function () {
    polyfiller
        .bundle(['Promise', 'Fetch'])
        .pipe(gulp.dest('polyfills.js'));
});

Or:

var gulp = require('gulp');
var polyfiller = require('gulp-polyfiller');

gulp.task('default', function () {
    gulp.src("*.js")
        // push polyfills file after all scripts
        .pipe(polyfiller(['Promise', 'Fetch']))
        // run then any tasks on your scripts
        .pipe(concat())
        .pipe(gulp.dest('bundle.js'));
});

API

polyfiller(features, [options]);

features

Type: Array

List of features you want to bundle.

options

Type: Object.

Options for bundle process. All of options are the options for the Polyfiller itself, except these ones:

path

Type: string

Changes the stream's output File.path property

process

Type: Function(Object:feature, String:name, Array:features)

This option as an advanced way to control the file contents that are created.

....
{
    process: function (feature, name, features) {
        return feature.source;
    }
}
....

For more details see the Polyfiller documentation

Tests

npm install && npm test

License

MIT

Plugin submitted by Sergey Kamardin

npm i gulp-polyfiller

Metadata

  • Unknown
  • >=0.10.28
  • Sergey Kamardin
  • released 5/12/2015

Downloads

Maintainers