Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin
Created Dec 1, 2017
Embed
What would you like to do?
[WordPress] Getting Started with Gulp Starter Packages
$ touch gulpfile.js
gulp.task('sass', function(){
return gulp.src('assets/styles/scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('assets/styles/css'))
});
gulp.task('js', function () {
return gulp.src('assets/scripts/dev/*.js')
.pipe(uglify())
.pipe(gulp.dest('assets/scripts'));
});
gulp.task('images', function () {
return gulp.src('assets/images/*')
.pipe(imagemin())
.pipe(gulp.dest('assets/images'))
});
$ gulp sass && gulp js
gulp.task('watch', function() {
gulp.watch('assets/styles/scss/*.scss', gulp.series('sass'));
gulp.watch('assets/scripts/dev/*.js', gulp.series('js'));
gulp.watch('assets/images/*', gulp.series('images'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment