Skip to content

Instantly share code, notes, and snippets.

@jh3y
Last active August 15, 2019 14:07
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jh3y/32ec408d74685607b91e to your computer and use it in GitHub Desktop.
Save jh3y/32ec408d74685607b91e to your computer and use it in GitHub Desktop.
gulpfile using gulp 4's series/parallel features
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