Did gulp write the task himself? Talk about its construction process

The core principle of the gulp construction process: input => processing => output, read stream => conversion stream => write stream

Build process:
1. First, install gulp, gulp-CLI;
2, gulpfile.js create file (file entry gulp);
3, in gulpfile by exports.foo = done => {...}creating a build tasks;
4, and gulp also supports asynchronous tasks, You can create tasks with promise and async. In the task, the file stream is read through the src function, and the file stream is processed and converted by introducing the fs module and the pipe() method of the file stream (handed over to the plug-in for processing or output to the specified file);
5. Then after processing Return the execution result to end the execution of a task;
6. Then combine the tasks into a new task process through the series and parallel functions;
7. Finally, export the created task through exports;
8. Now you can run the defined gulp task .

Guess you like

Origin blog.csdn.net/weixin_40599109/article/details/108393417
Recommended