As describe on the Gulp website, this tool allows you to automate and enhance your workflow and is
Easy to Learn, Easy to use, Efficient and High Quality… I totally agree with this.
But I’ve been stuck by a small problem in the past few days : how to get an environment variable to build conditional tasks ?
Gulp util install
First of all you need to add a new node dependency called gulp-util in your packages.json file:
Install it with your favorite command:
Use gulp util in your Gulpfile.js
Require:
Tasks:
DRY
It’s possible that you have many gulp tasks that need this behavior:
Give gulp configuration through the command line
you could change the --env option with anything else: