Last active
January 9, 2017 08:05
-
-
Save jaskiratr/88addaae43a37322d6c30e6a47c6f913 to your computer and use it in GitHub Desktop.
Revisions
-
jaskiratr revised this gist
Jan 9, 2017 . 1 changed file with 19 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -31,9 +31,25 @@ gulp.task('browser-sync', ['nodemon'], function() { }); gulp.task('nodemon', function (cb) { var called = false; return nodemon({ script: 'app.js', ignore: [ 'gulpfile.js', 'node_modules/' ] }) .on('start', function () { if (!called) { called = true; cb(); } }) .on('restart', function () { setTimeout(function () { reload({ stream: false }); }, 1000); }); }); -
jaskiratr created this gist
Jan 9, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ var gulp = require('gulp'); var exec = require('child_process').exec; var sass = require('gulp-sass'); var nodemon = require('gulp-nodemon'); var browserSync = require('browser-sync').create(); var reload = browserSync.reload; gulp.task('default', ['sass', 'browser-sync'], function() { gulp.watch("public/scss/*.scss", ['sass'], reload); gulp.watch(["views/**/*.pug", "./*.js"], reload); }); // SASS Compiler gulp.task('sass', function() { gulp.src('./public/scss/*.scss') .pipe(sass().on('error', sass.logError)) .pipe(gulp.dest('./public/css/')) .pipe(reload({ stream: true })); }); //BrowserSync gulp.task('browser-sync', ['nodemon'], function() { browserSync.init(null, { proxy: "http://localhost:8080", port: 3000, reloadDelay: 1000 }); }); gulp.task('nodemon', function(cb) { var called = false; return nodemon({ script: 'app.js' }).once('start', cb); });