Migrated to gulp 4

This commit is contained in:
Robin C Samuel
2020-05-07 23:44:48 +05:30
parent b5901863c2
commit 5b44fcdd2b
5 changed files with 1416 additions and 979 deletions

View File

@@ -14,6 +14,10 @@ const templatePath = [
];
module.exports = gulp => {
const reloadBrowser = done => {
browserSync.reload();
done();
};
// run `jekyll build`
gulp.task('jekyll-build', done => {
return cp.spawn(jekyll, ['build'], { stdio: 'inherit' }).on('close', done);
@@ -29,19 +33,20 @@ module.exports = gulp => {
});
// Rebuild Jekyll then reload the page
gulp.task('jekyll-rebuild', ['jekyll-dev'], () => {
browserSync.reload();
});
gulp.task('jekyll-rebuild', gulp.series(['jekyll-dev', reloadBrowser]));
gulp.task('serve', ['jekyll-dev'], () => {
browserSync.init({
server: {
baseDir: '_site',
},
});
gulp.task(
'serve',
gulp.series('jekyll-dev', () => {
browserSync.init({
server: {
baseDir: '_site',
},
});
gulp.watch(scssPath, ['sass', browserSync.reload]);
gulp.watch(jsPath, ['scripts', browserSync.reload]);
gulp.watch(templatePath, ['jekyll-rebuild']);
});
gulp.watch(scssPath, gulp.series(['sass', reloadBrowser]));
gulp.watch(jsPath, gulp.series(['scripts', reloadBrowser]));
gulp.watch(templatePath, gulp.task('jekyll-rebuild'));
})
);
};

View File

@@ -17,7 +17,7 @@ module.exports = gulp => {
)
.pipe(
prefix({
browsers: ['last 2 versions'],
overrideBrowserslist: ['last 2 versions'],
cascade: false,
})
)