diff --git a/gulpfile.js b/gulpfile.js index 2b3f1a7..c72230f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,6 +4,7 @@ var gulp = require('gulp'), cleanCss = require('gulp-clean-css'), rename = require('gulp-rename'), postcss = require('gulp-postcss'), + browserSync = require('browser-sync').create(), autoprefixer = require('autoprefixer'); gulp.task('build-theme', function() { @@ -31,7 +32,16 @@ gulp.task('watch', ['build-theme'], function() { gulp.watch(['scss/*.scss'], ['build-theme']); }); -gulp.task('default', ['build-theme'], function() { +gulp.task('browserSync', function() { + browserSync.init({ + server: { + baseDir: "./" + } + }); + gulp.watch("./css/*.css").on('change', browserSync.reload); +}); + +gulp.task('default', ['browserSync', 'watch'], function() { }); diff --git a/package.json b/package.json index 4e42025..f208522 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ }, "devDependencies": { "autoprefixer": "^8.2.0", + "browser-sync": "^2.24.4", "gulp": "^3.9.1", "gulp-clean-css": "^3.9.3", "gulp-postcss": "^7.0.1",