If you’re not familiar enough with browserify options and features, check out my previous post explaining browserify in-depth.
I love streaming
Gulp is a stream-based project builder. Basically: a bunch of modules that take one input and output something, which is taken by another module etc. until the whole process is done.
First thing to do, create our gulpfile.js
at the root of our project and require()
what we need: gulp and browserify.
Once, there was a gulp-browserify plugin. It’s still downloadable but it is not maintained anymore so don’t use it. You have to use browserify itself, that’s it.
var browserify = require('browserify'); var gulp = require('gulp'); gulp.task('default', function() { console.log('todo'); });
> gulp [14:16:44] Starting 'default'... todo [14:16:44] Finished 'default' after 85 µs
Before throwing lines of code and browserify, let’s explain a bit more how this stream management work with some examples.