mirror of
https://github.com/Xevion/old.xevion.github.io.git
synced 2025-12-07 07:15:36 -06:00
put sync and watch in serve task
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
const browserSync = require('browser-sync');
|
const browserSync = require('browser-sync').create();
|
||||||
const cp = require('child_process');
|
const cp = require('child_process');
|
||||||
|
|
||||||
const jekyll = process.platform === 'win32' ? 'jekyll.bat' : 'jekyll';
|
const jekyll = process.platform === 'win32' ? 'jekyll.bat' : 'jekyll';
|
||||||
@@ -20,21 +20,16 @@ module.exports = gulp => {
|
|||||||
browserSync.reload();
|
browserSync.reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Wait for jekyll-build task to complete, then launch the Server
|
gulp.task('serve', ['jekyll-build'], () => {
|
||||||
gulp.task('browser-sync', ['sass', 'scripts', 'jekyll-build'], () => {
|
browserSync.init({
|
||||||
browserSync({
|
|
||||||
server: {
|
server: {
|
||||||
baseDir: '_site'
|
baseDir: '_site'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('watch', () => {
|
|
||||||
gulp.watch(scssPath, ['sass', 'jekyll-rebuild']);
|
gulp.watch(scssPath, ['sass', 'jekyll-rebuild']);
|
||||||
gulp.watch(jsPath, ['scripts', 'jekyll-rebuild']);
|
gulp.watch(jsPath, ['scripts', 'jekyll-rebuild']);
|
||||||
gulp.watch(templatePath, ['jekyll-rebuild']);
|
gulp.watch(templatePath, ['jekyll-rebuild']);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('serve', ['browser-sync', 'watch']);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user