Open jackrobertscott opened 8 years ago
Example plugin:
module.exports = function cssPlugin(streamHandler) {
return streamHandler.get('**/*.js')
.pipe(autoprefixer())
.pipe(csso())
.pipe(concat('styles.css'));
}
In this example, stream handler would return the filtered segment of the main stream through the get()
function. Then, when the altered files are returned, the stream handler restores the rest of the stream so the next plugin can filter from it.
In response to a tweet by one of gulps main contributors, I had the idea of creating a system that maintained single stream on which plugins could be added to manipulated given file types. The transformed files, after transformation, would then be added back to the main stream.
This would achieve the following:
The system's process cycle:
To do: