Add dev server and watcher for development

This commit is contained in:
Stanislav Ivanov 2017-07-19 20:48:56 +03:00 committed by Vadim Makeev
parent 67149189ef
commit 67a5dae448
2 changed files with 17 additions and 1 deletions

View File

@ -8,6 +8,7 @@ const rsync = require('gulp-rsync');
const sequence = require('run-sequence'); const sequence = require('run-sequence');
const zip = require('gulp-zip'); const zip = require('gulp-zip');
const pages = require('gulp-gh-pages'); const pages = require('gulp-gh-pages');
const browserSync = require('browser-sync').create();
gulp.task('prepare', () => { gulp.task('prepare', () => {
@ -100,4 +101,18 @@ gulp.task('clean', () => {
return del('prepared/**'); return del('prepared/**');
}); });
gulp.task('default', ['prepare']); gulp.task('serve', () => {
browserSync.init({
ui: false,
notify: false,
port: 3000,
server: {
baseDir: '.'
}
});
gulp.watch('index.html').on('change', () => {
browserSync.reload();
});
});
gulp.task('default', ['serve']);

View File

@ -32,6 +32,7 @@
"shower-ribbon": "^2.0.10" "shower-ribbon": "^2.0.10"
}, },
"devDependencies": { "devDependencies": {
"browser-sync": "^2.18.12",
"del": "^2.2.1", "del": "^2.2.1",
"fs": "0.0.2", "fs": "0.0.2",
"gulp": "^3.9.1", "gulp": "^3.9.1",