Skip to content

Instantly share code, notes, and snippets.

@apsavin
Created December 27, 2014 14:43
Show Gist options
  • Save apsavin/f926c1550b94c1e74765 to your computer and use it in GitHub Desktop.
Save apsavin/f926c1550b94c1e74765 to your computer and use it in GitHub Desktop.
gulp file for bnsf project
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
shell = require('gulp-shell');
gulp.task('build', shell.task([
'bem make'
]));
var nodemonInstance;
gulp.task('run', ['build'], function () {
if (!nodemonInstance) {
nodemonInstance = nodemon({
script: 'desktop.bundles/index/index.node.js',
watch: '__manual__',
ext: '__manual__'
}).on('restart', function () {
console.log('~~~ restart server ~~~');
});
} else {
nodemonInstance.emit('restart');
}
});
gulp.task('watchAndRebuild', ['run'], function () {
gulp.watch('desktop.blocks/**/*', ['run']);
gulp.watch('config/*', ['run'])
});
gulp.task('default', ['watchAndRebuild']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment