Created
July 4, 2014 10:14
-
-
Save acroix/f58ca6b16d4fa85d5848 to your computer and use it in GitHub Desktop.
gulp file to restart node and browserify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var browserify = require('gulp-browserify'); | |
var concat = require('gulp-concat'); | |
var nodemon = require('gulp-nodemon'); | |
var dirname = 'src/public'; | |
var paths = { | |
apps: ['src/apps/desktop/main.js'], | |
dist: 'src/public/dist' | |
} | |
gulp.task('develop',function() { | |
nodemon({ script: 'server.js', ext: 'html js', ignore: paths.dist + '/**' }) | |
.on('start', ['browserify']) | |
.on('restart', ['browserify'], function () { | |
console.log('restarted!'); | |
}); | |
}); | |
gulp.task('browserify', function() { | |
gulp.src(paths.apps) | |
.pipe(browserify({transform: 'reactify'})) | |
.pipe(concat('main.js')) | |
.pipe(gulp.dest(paths.dist + '/js')); | |
}); | |
gulp.task('default',['develop']); | |
gulp.task('watch', function() { | |
gulp.watch('src/**/*.*', ['default']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment