Created
February 27, 2022 19:56
-
-
Save zeynebozdem/ad2b84810bb6a0636de1e96feed13a08 to your computer and use it in GitHub Desktop.
Gulp Watch Scss Changes And Minify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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