Gulp is a JavaScript build system, node.js-based task runner like Grunt. It allows you to automate common tasks during your development process. Gulp uses the streams-concept and code-over-configuration for a simpler and more intuitive build process. The code-over-configuration concept allows to create more readable and simple tasks, whereas grunt tasks are highly over-configured.
Continue Reading - Creating a default task and setting up browser-sync
References
Step-By-Step Guide to Gulp Workflow Automation for absolute beginners that I documented iny my blog
Cool. So we are all done with our workflow automation.
We now have a gulp file , that
First argument to imagemin
constructor is plugin array. By default, following plugins are used: [imagemin.gifsicle(), imagemin.jpegtran(), imagemin.optipng(), imagemin.svgo()]
Second argument are options. In the above example following options are used:
{
progressive: true,
interlaced: true,
svgoPlugins: [{removeUnknownsAndDefaults: false}, {cleanupIDs: false}]
}
Those are completely optional.
progressive
is used by imagemin-jpegtran
.
interlaced
is used by imagemin-gifsicle
.
removeUnknownsAndDefaults
and cleanupIDs
are used by imagemin-svgo
.
Note on using the globbing pattern (**
):
The globbing pattern matches all children
and the parent
. In order to avoid that we add '!public'
to our del task so that the public
directory itself doesn't get deleted