rollup / stream

🍣 Stream Rollup build results
MIT License
22 stars 12 forks source link

Gulp example misses output #15

Closed domoritz closed 1 year ago

domoritz commented 2 years ago

The example in the readme

import rollupStream from '@rollup/stream';
import gulp from 'gulp';
import terser from 'gulp-terser';
import source from 'vinyl-source-stream';

gulp.task('rollup', () => {
  const options = { input: 'src/index.js' };
  return rollupStream(options)
    .pipe(source('bundle.js'))
    .pipe(terser({ keep_fnames: true, mangle: false }))
    .pipe(gulp.dest('dist'));
});

Causes an error Error: You must supply an options object.

I fixed it by setting the output

import rollupStream from '@rollup/stream';
import gulp from 'gulp';
import terser from 'gulp-terser';
import source from 'vinyl-source-stream';

gulp.task('rollup', () => {
  const options = { input: 'src/index.js', output: { format: 'cjs' } };
  return rollupStream(options)
    .pipe(source('bundle.js'))
    .pipe(terser({ keep_fnames: true, mangle: false }))
    .pipe(gulp.dest('dist'));
});
shellscape commented 1 year ago

This isn't a very frequently maintained package. We'd be happy to review a PR from the community to resolve the issue.