gulp Using Browserify with Vanilla Javascript


Example

First install gulp and browserify via npm i gulp gulp-browserify. This will install browserify into your node_modules folder.

gulpfile.js

var gulp = require('gulp');
var browserify = require('gulp-browserify');

gulp.task('script', function() {
    gulp.src('./src/script.js')
        .pipe(browserify({
            insertGlobals: true
        })
        .pipe(gulp.dest('./build/'));
}