Last active
November 12, 2019 19:12
-
-
Save sidsbrmnn/1786a1c43c5fbcaee2fb8f7bbeb7fea9 to your computer and use it in GitHub Desktop.
Gulp init
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
/////////////// | |
// gulpfile.js | |
/////////////// | |
import gulp from 'gulp'; | |
import sass from 'gulp-sass'; | |
const path = { | |
src: './src/scss/**/*.scss', | |
dest: './src/css' | |
}; | |
// Tasks | |
gulp.task('sass', () => | |
gulp | |
.src(path.src) | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(gulp.dest(path.dest)) | |
); | |
// Watch | |
gulp.task('watch:sass', () => { | |
gulp.watch(path.src, gulp.series('sass')); | |
}); | |
gulp.task('watch', () => { | |
gulp.series('sass', gulp.parallel('watch:sass')); | |
}); | |
// Default | |
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