Skip to content

Instantly share code, notes, and snippets.

@zeynebozdem
Created February 27, 2022 19:56
Show Gist options
  • Save zeynebozdem/ad2b84810bb6a0636de1e96feed13a08 to your computer and use it in GitHub Desktop.
Save zeynebozdem/ad2b84810bb6a0636de1e96feed13a08 to your computer and use it in GitHub Desktop.
Gulp Watch Scss Changes And Minify
/* You should install with npm below packages to your project
"gulp": "^4.0.2",
"gulp-sass": "^4.1.0",
"gulp-scss": "^1.4.0"
*/
var gulp = require('gulp');
var sass = require('gulp-sass');
gulp.task('listen',function () {
return gulp.src('./scss/main.scss')
.pipe(sass({outputStyle: 'compressed'}))
.pipe(gulp.dest('./'))
});
gulp.task('watch',function () {
gulp.watch('./scss/**/*.scss',gulp.series('listen'))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment