MikeKovarik / gulp-better-rollup

📦 Better Gulp plugin for Rollup ES6 module bundler
MIT License
49 stars 16 forks source link

Possible to include the newest version of rollup directly? #22

Closed bridgeport closed 6 years ago

bridgeport commented 6 years ago

Thanks for this great package. Would you consider the possibility to optionally allow including or injecting rollup directly into gulp-better-rollup so that the newest or different rollup versions can be used with this plugin?

Something such as:

const actualRollup = require('rollup');
const betterRollup = require('gulp-better-rollup');

gulp.task('lib-build', () => {
  gulp.src('lib/index.js')
    .pipe(betterRollup({
      injectRollup: actualRollup,
      plugins: [babel()]
    }))
    .pipe(gulp.dest('dist'))
})

Thanks.

MikeKovarik commented 6 years ago

Yes, I must've forgot to document it but it is possible to supply your own rollup version with rollup property (a little simpler than your proposed injectRollup)

const betterRollup = require('gulp-better-rollup');
...
    .pipe(betterRollup({
      rollup: require('rollup')
    }))