Gulp plugin for the Rollup ES6 module bundler.
npm i --save-dev gulp-rollup
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')
}))
//...