Getting started with Gulp.js
What is Gulp?
Why use Gulp?
There are other packages that are similar to Gulp, such as Grunt, Webpack, Slush, and Yeoman. You’ll have to do your own research to decide what is best for your project, but if you have never used a Task runner before, you should, and Gulp is a great place to start.
This was taking ages every time I made one small change. After setting up Gulp I never had to do this again.
This is just a small use case which I think is easy to understand and applicable to many people that might want to start using Gulp but there are a great many other uses, we can cover those in another article.
Navigate to a your projects root folder in the terminal then run the following commands:
- Install the Gulp client globally
- Install Gulp to the devDependencies for this project
- Create a gulpfile.js (Used for configuring gulp.).
Then add the following to your
Now you have everything setup! If you run
gulp in the terminal in will run the default task, i.e the task we just created in the
gulpfile. But nothing will happen because we haven’t actually told gulp what to do…
Gulp has a fantastic list of recipes. You may find exactly what you are already looking for in there!
I am going to use one of the recipes called ‘Output both a minified and non-minified version’