gulpfile.js
function watchifyFile(src, out) {
    var opts = assign({}, watchify.args, {
        entries: src,
        standalone: "NavMesh",
        debug: true
    });
    var b = watchify(browserify(opts));
    function bundle() {
        return b.bundle()
            .on('error', gutil.log.bind(gutil, "Browserify Error"))
            .pipe(source(src.replace(/^src\//, '')))
            .pipe(derequire())
            .pipe(gulp.dest(out));
    }
    b.on('update', bundle);
    b.on('log', gutil.log);
    return bundle();
}
function watchifyFile(src, out) {
    var opts = assign({}, watchify.args, {
        entries: src,
        standalone: "NavMesh",
        debug: true
    });
    var b = watchify(browserify(opts));
    function bundle() {
        return b.bundle()
            .on('error', gutil.log.bind(gutil, "Browserify Error"))
            .pipe(source(src.replace(/^src\//, '')))
            .pipe(derequire())
            .pipe(gulp.dest(out));
    }
    b.on('update', bundle);
    b.on('log', gutil.log);
    return bundle();
}
function watchifyFile ( src , out ) { var opts = assign ( { } , watchify . args , { entries : src , standalone : "NavMesh" , debug : true } ) ; var b = watchify ( browserify ( opts ) ) ; function bundle ( ) { return b . bundle ( ) . on ( 'error' , gutil . log . bind ( gutil , "Browserify Error" ) ) . pipe ( source ( src . replace ( / ^src\/ / , '' ) ) ) . pipe ( derequire ( ) ) . pipe ( gulp . dest ( out ) ) ; } b . on ( 'update' , bundle ) ; b . on ( 'log' , gutil . log ) ; return bundle ( ) ; }
Compile and watchify sourced file.
Compile and watchify sourced file .