In the previous section, we learned how to use a CSS preprocessor and how to compile this SASS/LESS code into pure CSS to be interpreted by the browser. Note that each time you make a change, you will need to recompile the entire file, which means that you will need to type the same command and do the same task one, two, and several times. Yes, it's really boring. Fortunately, we have task automation tools. What does that mean? Some other tool will do the dirty job for us.
Gulp is an open source JavaScript-based task runner, which uses code-over-configuration approach to define its tasks. These could be the following:
- Bundling and minifying libraries and style sheets
- Refreshing your browser when you save a file
- Quickly running unit tests
- Running code analysis
- LESS/SASS to CSS compilation
- Copying modified files to an output directory
This tool uses the stream module of Node.js; first of all, we need to define what a stream is. It can be defined as a tool...