Skip to content

Instantly share code, notes, and snippets.

@almamunx
Last active March 26, 2023 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almamunx/974b1fd963d9ad8949652fb7abba287b to your computer and use it in GitHub Desktop.
Save almamunx/974b1fd963d9ad8949652fb7abba287b to your computer and use it in GitHub Desktop.
Here's an example Gulpfile that compiles Sass files and minifies CSS
//Compiles Sass files and minifies CSS
const gulp = require('gulp');
const sass = require('gulp-sass');
const cleanCSS = require('gulp-clean-css');
gulp.task('sass', function () {
return gulp.src('src/scss/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(cleanCSS())
.pipe(gulp.dest('dist/css'));
});
gulp.task('watch', function () {
gulp.watch('src/scss/**/*.scss', gulp.series('sass'));
});
gulp.task('default', gulp.series('sass', 'watch'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment