operandom / gulp-rollup

gulp plugin for Rollup ES6 module bundler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gulp-rollup npm Dependency Status Build Status

Gulp plugin for the Rollup ES6 module bundler.

Install

npm i --save-dev gulp-rollup

Usage

var gulp       = require('gulp'),
    rollup     = require('gulp-rollup'),
    sourcemaps = require('gulp-sourcemaps');

gulp.task('bundle', function(){
  gulp.src('src/main.js', {read: false})
    .pipe(rollup({
        // any option supported by Rollup can be set here, including sourceMap
        sourceMap: true
    }))
    .pipe(sourcemaps.write(".")) // this only works if the sourceMap option is true
    .pipe(gulp.dest('dist'));
});

In addition to the standard Rollup options, gulp-rollup supports options.rollup, allowing you to use an older, newer, or custom version of Rollup by passing in the module like so:

gulp.src('src/main.js', {read: false})
  .pipe(rollup({
      rollup: require('rollup')
  }))
  //...

About

gulp plugin for Rollup ES6 module bundler

License:MIT License


Languages

Language:JavaScript 100.0%