Last active
August 15, 2019 14:07
-
-
Save jh3y/32ec408d74685607b91e to your computer and use it in GitHub Desktop.
gulpfile using gulp 4's series/parallel features
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
import gulp from 'gulp' | |
const compileMarkup = () => { // COMPILE MARKUP } | |
const compileScript = () => { // COMPILE SCRIPT } | |
const compileStyle = () => { // COMPILE STYLE } | |
const watchMarkup = () => { // WATCH MARKUP } | |
const watchScript = () => { // WATCH SCRIPT } | |
const watchStyle = () => { // WATCH STYLE } | |
const compile = gulp.parallel(compileMarkup, compileScript, compileStyle) | |
compile.description = 'compile all sources' | |
// Not exposed to CLI | |
const startServer = () => { // START SERVER } | |
const serve = gulp.series(compile, startServer) | |
serve.description = 'serve compiled source on local server at port 3000' | |
const watch = gulp.parallel(watchMarkup, watchScript, watchStyle) | |
watch.description = 'watch for changes to all source' | |
const defaultTasks = gulp.parallel(serve, watch) | |
export { | |
compile, | |
compileMarkup, | |
compileScript, | |
compileStyle, | |
serve, | |
watch, | |
watchMarkup, | |
watchScript, | |
watchStyle, | |
} | |
export default defaultTasks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment