Ao efetuar a mudanças nos arquivos o reload do browserSync não esta funcionando já tentei soluções de outros tópicos com o mesmo problema mas não funcionou. fica nesse Reloading Browsers...e não atualiza a pagina.
gulpfile.js
var gulp = require('gulp')
,imagemin = require('gulp-imagemin')
,clean = require('gulp-clean')
,concat = require('gulp-concat')
,htmlReplace = require('gulp-html-replace')
,uglify = require('gulp-uglify')
,usemin = require('gulp-usemin')
,cssmin = require('gulp-cssmin')
,browserSync = require('browser-sync');
gulp.task('default', ['copy'], function() {
gulp.start('build-img', 'usemin');
});
gulp.task('copy', ['clean'], function() {
return gulp.src('src/**/*')
.pipe(gulp.dest('dist'));
});
gulp.task('clean', function() {
return gulp.src('dist')
.pipe(clean());
});
gulp.task('build-img', function() {
return gulp.src('dist/img/**/*')
.pipe(imagemin())
.pipe(gulp.dest('dist/img'));
});
gulp.task('usemin', function() {
return gulp.src('dist/**/*.html')
.pipe(usemin({
js: [uglify],
css: [cssmin]
}))
.pipe(gulp.dest('dist'));
});
gulp.task('server', function() {
browserSync.init({
server: {
baseDir: 'src'
}
});
gulp.watch('src/**/*').on('change', browserSync.reload);
});
package.json
{
"name": "projeto",
"version": "1.0.0",
"description": "",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"gulp": "gulp"
},
"author": "",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.9.8",
"gulp": "^3.9.0",
"gulp-clean": "^0.3.1",
"gulp-concat": "^2.6.1",
"gulp-cssmin": "^0.1.7",
"gulp-html-replace": "^1.6.2",
"gulp-imagemin": "^2.3.0",
"gulp-uglify": "^1.5.4",
"gulp-usemin": "^0.3.29",
"gulp-watch": "^5.0.1"
}
}
terminal
[Browsersync] Access URLs:
-----------------------------------
Local: http://localhost:3000
External: http://10.0.0.100:3000
-----------------------------------
UI: http://localhost:3001
# UI External: http://localhost:3001
-----------------------------------
[Browsersync]
Serving files from: src
[Browsersync]
Reloading Browsers...