gulp-watchify-factor-bundle
A sugar wrapper for browserify, watchify and factor-bundle to work with gulp.
The main ideas are borrowed from reduce-js.
Usage
gulpfile.js:
var reduce = var gulp = var path = var buffer = var uglify = var del = gulp gulp gulp
Exports
create()
Same with the browserify constructor.
bundle(b, bundleOptions)
A gulp plugin to use browserify with factor-bundle, and produces a vinyl stream.
b
The browserify instance.
bundleOptions
Options for factor-bundle.
bundleOptions.common
specifies the path to the common bundle.
All other options are exactly the same with those consumed by factor-bundle.
NOTE
bundleOptions.outputs
must be an array of file paths.
However, if not specified, a new bundle is created for each entry,
with the same path with the entry.
watch(b, bundleOptions, watchifyOptions)
A gulp plugin to use browserify with factor-bundle and watchify.
b
The browserify instance.
bundleOptions
Options for factor-bundle.
watchOptions
Options for watchify.
NOTE
This method creates a transform to process the entry stream,
and emit a bundle
event whenever b.bundle()
called.
reduce.watch().on('bundle', vinylStream => {})