Merge pull request #10 from robincsamuel/feature/gulp-v4-upgrade

Migrated to gulp 4
This commit is contained in:
Brittany Chiang
2020-05-07 19:25:07 -04:00
committed by GitHub
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'], () => {
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,
})
)

View File

@@ -8,4 +8,4 @@ const sync = require('./build/browsersync');
task(gulp);
});
gulp.task('build', ['sass', 'scripts', 'images', 'jekyll-build']);
gulp.task('build', gulp.series(['sass', 'scripts', 'images', 'jekyll-build']));

2348
package-lock.json generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@
"homepage": "https://github.com/bchiang7/bchiang7.github.io",
"main": "gulpfile.js",
"scripts": {
"start": "gulp serve",
"start": "gulp serve --watch",
"build": "gulp build"
},
"author": "Brittany Chiang",
@@ -17,12 +17,12 @@
"devDependencies": {
"@nuscout/eslint-config": "^0.2.1",
"browser-sync": "^2.26.7",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^6.1.0",
"gulp-clean-css": "^3.10.0",
"gulp": "^4.0.0",
"gulp-autoprefixer": "^7.0.0",
"gulp-clean-css": "^4.3.0",
"gulp-eslint": "^6.0.0",
"gulp-imagemin": "6.0.0",
"gulp-sass": "^4.0.2",
"gulp-sass": "^4.1.0",
"gulp-uglify": "3.0.2"
}
}