Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #60 from ginetta/v2/fix-multiple-reload
Browse files Browse the repository at this point in the history
Reloads the browser only once on jade changes
  • Loading branch information
lejoe committed Aug 10, 2015
2 parents 78eb017 + 8193b0d commit 582343b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions gulp/tasks/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var merge = require('merge-stream');
var path = require('path');
var pageshelpers = require('../utils/pagesHelpers');
var handleError = require('../utils/handleError');
var stream = require('../utils/browserSync').stream;

module.exports = function (gulp, $, config) {
var srcFiles = config.appFiles.pages;
Expand Down Expand Up @@ -73,6 +72,6 @@ module.exports = function (gulp, $, config) {
// Generate the pages for each language
var pagesStreams = languages.map(compilePages);

return merge(pagesStreams).pipe(stream());
return merge(pagesStreams);
};
};
5 changes: 3 additions & 2 deletions gulp/tasks/serve.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
var browserSync = require('../utils/browserSync');
var reload = browserSync.reload;
var _ = require('lodash');

module.exports = function (gulp, $, config) {
Expand Down Expand Up @@ -37,10 +38,10 @@ module.exports = function (gulp, $, config) {
gulp.watch(stylesFiles, ['build:styles']);

// Watching Pages
gulp.watch(pagesFiles, ['build:pages']);
gulp.watch(pagesFiles, ['build:pages', reload]);

// Watching Content
gulp.watch(contentSrcFiles, ['build:pages']);
gulp.watch(contentSrcFiles, ['build:pages', reload]);

// Watching Assets
gulp.watch(logosFiles, ['build:assets']);
Expand Down
3 changes: 2 additions & 1 deletion gulp/utils/browserSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ module.exports = {
}
},
notify: browserSync.notify,
stream: browserSync.stream
stream: browserSync.stream,
reload: browserSync.reload
};

0 comments on commit 582343b

Please sign in to comment.