Grunt Tutorial 1 — Introduction to Grunt
It’s always good to know why you are learning something before you start learning. So first thing is first. What is Grunt?
What do grunt offer (some usecases of grunt)?
Improve the performance of your site by decreasing the number of Http requests.
- In most of the web applications, we will not have just one html page. We will have many style files, script files, etc. To load each external file to your browser, browser will be creating a new Http request, so the number of Http requests will increase. Higher the number of Http requests, lesser the performance is. But grunt has a solution to fix this. We will discuss more about this in a little while.
- Minimized Files are compressed versions of source files. So it will consume less memory and reduce the load by a considerable amount. Especially when you have a huge js or css file, this will be very useful.
“sass” and “less” compilation.
- For those who don’t know about Sass and Less, they are css tools which will allow you to write css in a different manner. With Sass and Less you can use variables, mixin and much more with css. It will reduce the pain of styling the page with CSS.