Skip to content

Commit

Permalink
feat(sass): automatically reload browser when a sass file is modified
Browse files Browse the repository at this point in the history
  • Loading branch information
aubm committed Oct 22, 2015
1 parent e8c4d96 commit fa36ac3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions build/tasks/serve.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

import gulp from 'gulp';
import util from 'gulp-util';
import browserSync from 'browser-sync';
import runSequence from 'run-sequence';
import modRewrite from 'connect-modrewrite';
import paths from '../paths';

function browerSync(directoryBase, files, browser) {
function startBrowserSync(directoryBase, files, browser) {
browser = browser === undefined ? 'default' : browser;
files = files === undefined ? 'default' : files;

Expand All @@ -25,5 +25,8 @@ function browerSync(directoryBase, files, browser) {
}

gulp.task('serve', () => {
return browerSync(['public', './' ]);
});
startBrowserSync([paths.srcDir, './' ]);
gulp.watch(`${paths.srcDir}/**/*.scss`, ['sass', () => {
browserSync.reload();
}]);
});

0 comments on commit fa36ac3

Please sign in to comment.