I've recently made the transition over from Grunt to Gulp. I'm still fairly new however, could anyone tell me what the difference is between using Gulp-Browserify and just using Browserify?
I know Gulp-Browserify has now been blacklisted and I seen a few discussions about it. I was wondering what the Gulp version did that Browserify doesn't?
The difference is that browserify doesn't natively read and emit the vinyl files that the gulp pipeline deals with. gulp-browserify was an adapter for that, and I believe it did some extra things related to error handling. If possible I recommend that for the time being you avoid using gulp-browserify. In gulp 4 there may be a better way to integrate browserify with gulp. For now, see if this works for you:
var vss = require('vinyl-source-stream');
gulp.task('whatever', function () {
var b = browserify(entry, b_opts)
.transform(some_xform);
return b.bundle()
.pipe(vss('bundle.js'))
// ... gulp stuff
.pipe(gulp.dest(dest));
});
This will generally require you to do per-file manipulations with browserify transforms and then only do bundle-level manipulation in the gulp pipeline.
Further reading: gulpjs/gulp#369
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments