Skip to content

Instantly share code, notes, and snippets.

@sidsbrmnn
Last active November 12, 2019 19:12
Show Gist options
  • Save sidsbrmnn/1786a1c43c5fbcaee2fb8f7bbeb7fea9 to your computer and use it in GitHub Desktop.
Save sidsbrmnn/1786a1c43c5fbcaee2fb8f7bbeb7fea9 to your computer and use it in GitHub Desktop.
Gulp init
///////////////
// 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