在開始撰寫 gulpfile.js 之前,你必須先將專案的結構規劃出來,
利用管線(pipe) 串流(streaming)
- 在 Unix 下,資料被視為位元串流(streaming)
gulp.task(name, fn)
It registers the function with name.
You can optionally specify some dependencies if other tasks need to run first.
gulp.task(tasks...)
Run all tasks with maximum concurrency
gulp.watch(glob, fn)
Runs a function when a file that matches the glob changes
Included in core for simplicity
gulp.src(glob)
This returns a readable stream.
Takes a file system glob (like grunt) and starts emitting files that match.
This is piped to other streams
gulp.dest(folder)
This returns a writable stream
File objects piped to this are saved to the file system