-
-
Save tommcfarlin/3d930006082bedb567bf6f9344204ec7 to your computer and use it in GitHub Desktop.
[WordPress] Getting Started with Gulp Starter Packages
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
$ touch gulpfile.js |
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
gulp.task('sass', function(){ | |
return gulp.src('assets/styles/scss/*.scss') | |
.pipe(sass()) | |
.pipe(gulp.dest('assets/styles/css')) | |
}); |
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
gulp.task('js', function () { | |
return gulp.src('assets/scripts/dev/*.js') | |
.pipe(uglify()) | |
.pipe(gulp.dest('assets/scripts')); | |
}); |
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
gulp.task('images', function () { | |
return gulp.src('assets/images/*') | |
.pipe(imagemin()) | |
.pipe(gulp.dest('assets/images')) | |
}); |
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
$ gulp sass && gulp js |
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
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')); | |
}); |
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
$ gulp watch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment