Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Gulp to version 4.0.2, altered gulpfile.js to use gulpseries #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,10 @@ gulp.task('jekyll-build', function (done) {
});

// Rebuild Jekyll and page reload
gulp.task('jekyll-rebuild', ['jekyll-build'], function () {
gulp.task('jekyll-rebuild', function () {
browserSync.reload();
});

// Wait for jekyll-build, then launch the Server
gulp.task('browser-sync', ['sass', 'img', 'jekyll-build'], function() {
browserSync({
server: {
baseDir: '_site'
},
notify: false
});
});

// Compile files
gulp.task('sass', function () {
return gulp.src('assets/css/scss/main.scss')
Expand All @@ -56,13 +46,23 @@ gulp.task('img', function() {
.pipe(browserSync.reload({stream:true}));
});

// Wait for jekyll-build, then launch the Server
gulp.task('browser-sync', gulp.series('sass', 'img', 'jekyll-build'), function() {
browserSync({
server: {
baseDir: '_site'
},
notify: false
});
});

// Watch scss, html, img files
gulp.task('watch', function () {
gulp.watch('assets/css/scss/**/*.scss', ['sass']);
gulp.watch('assets/js/**/*.js', ['jekyll-rebuild']);
gulp.watch('assets/img/**/*', ['img']);
gulp.watch(['*.html', '_layouts/*.html', '_includes/*.html', '_pages/*.html', '_posts/*'], ['jekyll-rebuild']);
gulp.watch('assets/css/scss/**/*.scss', gulp.series('sass'));
gulp.watch('assets/js/**/*.js', gulp.series('jekyll-rebuild'));
gulp.watch('assets/img/**/*', gulp.series('img'));
gulp.watch(['*.html', '_layouts/*.html', '_includes/*.html', '_pages/*.html', '_posts/*'], gulp.series('jekyll-rebuild'));
});

// Default task
gulp.task('default', ['browser-sync', 'watch']);
gulp.task('default', gulp.series('browser-sync', 'watch'));
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"dependencies": {
"browser-sync": "^2.18.13",
"child_process": "^1.0.2",
"gulp": "^3.9.1",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^4.0.0",
"gulp-cache": "^0.4.6",
"gulp-imagemin": "^3.2.0",
"gulp-imagemin": "^7.1.0",
"gulp-sass": "^3.1.0",
"imagemin-pngquant": "^5.0.0"
"imagemin-pngquant": "^9.0.2"
}
}