0.2.0 • Published 7 years ago
gulp-rollup-stream v0.2.0
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 intopath.resolve( options.root, 'my/module' );
Rollup options supported
Rollup Options - options.cache - options.external - options.plugins
Generate Options - options.format - options.exports - options.moduleId - options.moduleName - options.globals