Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 2.11 KB

README.md

File metadata and controls

62 lines (45 loc) · 2.11 KB

gulp-rollup-stream

Usage

Basic usage

	const gulp   = require( 'gulp' );
	const rollup = require( 'gulp-rollup-stream' );
	
	gulp.task( 'rollup', function() {
		return gulp.src( 'src/main.js' )
			.pipe(rollup({
				format: 'cjs'
			})
			.pipe( gulp.dest( 'build' ) )
		;	
	});

Documentation

rollup( options[, bundleCb] )

Create a rollup-stream. Check Rollup documenation for more options

  • bundleCb: Everytime a new bundle this callback is called using: bundleCb( bundle ) Useful for cache:
var cache;
function bundleCb( bundle ) { cache = bundle; }
  • options.root: The path where to look at modules at first when using import mod from 'my/module'. It will look into path.resolve( options.root, 'my/module' );

Rollup options supported