Skip to content

Instantly share code, notes, and snippets.

@gaving
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaving/c1dce867b8e4fa86e5c9 to your computer and use it in GitHub Desktop.
Save gaving/c1dce867b8e4fa86e5c9 to your computer and use it in GitHub Desktop.
mbp:~/Sandbox/test% npm version
{ npm: '2.6.0',
http_parser: '2.3',
modules: '14',
node: '0.12.0',
openssl: '1.0.1l',
uv: '1.0.2',
v8: '3.28.73',
zlib: '1.2.8' }
mbp:~/Sandbox/test% gulp watchify
[14:15:07] Using gulpfile ~/Sandbox/test/gulpfile.js
[14:15:07] Starting 'watchify'...
^C
gulp watchify 38.60s user 5.12s system 103% cpu 42.088 total
'use strict';
var gulp = require('gulp');
var browserify = require('browserify');
var watchify = require('watchify');
var source = require('vinyl-source-stream');
var babelify = require('babelify');
module.exports = gulp.task('watchify', function () {
var bundler = browserify({
cache: {},
packageCache: {},
fullPaths: true,
entries: [config.paths.src.js],
debug: true,
extensions: ['.js']
});
bundler = watchify(bundler);
bundler.transform(babelify);
function rebundle() {
return bundler.bundle()
.pipe(source(config.filenames.build.scripts))
.pipe(gulp.dest(config.paths.dest.build.scripts));
}
bundler.on('update', rebundle);
return rebundle();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment