Skip to content

Commit e6e5c40

Browse files
committed
Merge pull request #911 from GitAngel/fix/909
Fix for bugs #909 and #660
2 parents 2236df2 + 161d31a commit e6e5c40

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

docs/recipes/environment-specific-build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = function(options) {
5454
return gulp.src(options.src + '/app/**/*.js')
5555
.pipe($.eslint())
5656
.pipe($.eslint.format())
57-
.pipe(browserSync.reload({ stream: true }))
57+
.pipe(browserSync.stream())
5858
.pipe($.size());
5959
});
6060
};

generators/app/templates/gulp/_inject.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ var $ = require('gulp-load-plugins')();
99
var wiredep = require('wiredep').stream;
1010
var _ = require('lodash');
1111

12+
var browserSync = require('browser-sync');
13+
1214
gulp.task('inject-reload', ['inject'], function() {
1315
browserSync.reload();
1416
});

generators/app/templates/gulp/_markups.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ gulp.task('markups', function() {
2323
<% } -%>
2424
.pipe($.rename(renameToHtml))
2525
.pipe(gulp.dest(path.join(conf.paths.tmp, '/serve/app/')))
26-
.pipe(browserSync.reload({ stream: true }));
26+
.pipe(browserSync.stream());
2727
});

generators/app/templates/gulp/_scripts.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ var webpack = require('webpack-stream');
1111

1212
var $ = require('gulp-load-plugins')();
1313

14-
gulp.task('scripts-reload', ['scripts'], function() {
15-
browserSync.reload();
16-
});
1714

1815
<% if (props.jsPreprocessor.srcExtension !== 'es6' && props.jsPreprocessor.key !== 'typescript') { -%>
19-
gulp.task('scripts', function () {
16+
gulp.task('scripts-reload', function() {
17+
return buildScripts()
18+
.pipe(browserSync.stream());
19+
});
20+
21+
gulp.task('scripts', function() {
22+
return buildScripts();
23+
});
24+
25+
function buildScripts() {
2026
return gulp.src(path.join(conf.paths.src, '/app/**/*.<%- props.jsPreprocessor.extension %>'))
2127
<% if (props.jsPreprocessor.extension === 'js') { -%>
2228
.pipe($.eslint())
@@ -32,7 +38,7 @@ gulp.task('scripts', function () {
3238
.pipe(gulp.dest(path.join(conf.paths.tmp, '/serve/app')))
3339
<% } -%>
3440
.pipe($.size())
35-
});
41+
};
3642
<% } else { -%>
3743
function webpackWrapper(watch, test, callback) {
3844
var webpackOptions = {

generators/app/templates/gulp/_styles.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ var wiredep = require('wiredep').stream;
1212
var _ = require('lodash');
1313

1414
gulp.task('styles-reload', ['styles'], function() {
15-
browserSync.reload();
15+
return buildStyles()
16+
.pipe(browserSync.stream());
1617
});
1718

18-
gulp.task('styles', function () {
19+
gulp.task('styles', function() {
20+
return buildStyles();
21+
});
22+
23+
var buildStyles = function() {
1924
<% if (props.cssPreprocessor.key === 'less') { -%>
2025
var lessOptions = {
2126
options: [
@@ -72,4 +77,4 @@ gulp.task('styles', function () {
7277
.pipe(cssFilter.restore)
7378
<% } -%>
7479
.pipe(gulp.dest(path.join(conf.paths.tmp, '/serve/app/')));
75-
});
80+
};

0 commit comments

Comments
 (0)