Gulp-101 Flashcards
What is a gulpfile ?
it is the doorway to execute the task from till serving.
How can you execute the gulp file?
gulp [task-name]
Which function defines the task?
gulp.task(“task-name”, function(){});
How do you define task dependencies?
gulp.task(“task-name”, [“task1”], …)
Does dependency order is predictable?
Nope, the dependency can execute on their own
Can we have a task without impl function?
Yes just to group the order
What is the relevance of streams?
Since gulp is used to transformt the state of the src and dest files. Streams are just do that using pipe function
Show an e.g. of streams
gulp. task(“transform”, function(){
gulp. src(“src/”).pipe(gulp.dest(“/dest))
})
What are gulp plugins?
For each complex work there a plugin that gulp makes use of with the help of pipe function
gulp.task(“task”, function(){
gulp.src(“/src”).pipe(uglify())).pipe(gulp.dest(“/dest”))
)