Created
July 9, 2020 12:39
-
-
Save Akhigbe-E/f53e1cce3d4b65c5cb45fe54db3a6223 to your computer and use it in GitHub Desktop.
Watch sass folder
This file contains 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
const gulp = require('gulp') | |
const sass = require('gulp-sass') | |
const transpileSassToCss = (cb) => { | |
return gulp.src(`src/sass/main.scss`) | |
.pipe(sass()) | |
.pipe(gulp.dest(`src/css`)) | |
} | |
const watchSassFile = () => { | |
// If you want to run the transpileSassToCss function when | |
// multiple files are changed, put the file paths in the array | |
return gulp.watch(['src/sass/**/*.scss'], transpileSassToCss) | |
// This glob tells gulp to watch all the files suffixed with .scss | |
// in the sass folder & in folders in the sass folder | |
} | |
exports.default = watchSassFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment