Add dev server and watcher for development
This commit is contained in:
parent
67149189ef
commit
67a5dae448
17
gulpfile.js
17
gulpfile.js
|
@ -8,6 +8,7 @@ const rsync = require('gulp-rsync');
|
|||
const sequence = require('run-sequence');
|
||||
const zip = require('gulp-zip');
|
||||
const pages = require('gulp-gh-pages');
|
||||
const browserSync = require('browser-sync').create();
|
||||
|
||||
gulp.task('prepare', () => {
|
||||
|
||||
|
@ -100,4 +101,18 @@ gulp.task('clean', () => {
|
|||
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']);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
"shower-ribbon": "^2.0.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browser-sync": "^2.18.12",
|
||||
"del": "^2.2.1",
|
||||
"fs": "0.0.2",
|
||||
"gulp": "^3.9.1",
|
||||
|
|
Loading…
Reference in New Issue