Skip to content

Instantly share code, notes, and snippets.

@tterb
Created December 20, 2019 08:00
Show Gist options
  • Save tterb/9f4aa17c8b54b7abe1da0fb498537400 to your computer and use it in GitHub Desktop.
Save tterb/9f4aa17c8b54b7abe1da0fb498537400 to your computer and use it in GitHub Desktop.
Gulpfile clean
// Delete CSS
gulp.task('clean:styles', function(callback) {
del([paths.jekyllCssFiles + 'main.css',
paths.siteCssFiles + 'main.css',
'_includes/critical.css'
]);
callback();
});
// Delete processed JS
gulp.task('clean:scripts', function(callback) {
del([paths.jekyllJsFiles + 'main.js', paths.siteJsFiles + 'main.js']);
callback();
});
// Delete processed images
gulp.task('clean:images', function(callback) {
del([paths.jekyllImageFiles, paths.siteImageFiles]);
callback();
});
// Delete processed font files
gulp.task('clean:fonts', function(callback) {
del([paths.jekyllFontFiles, paths.siteFontFiles]);
callback();
});
// Delete the entire _site directory
gulp.task('clean:jekyll', function(callback) {
del(['_site']);
callback();
});
// Deletes _site directory and processed assets
gulp.task('clean', ['clean:jekyll', 'clean:styles', 'clean:scripts', 'clean:images', 'clean:fonts', 'clean:downloads']
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment