Grunt
is a JavaScript task runner that will help you to mini-fy the various
JS files. It will make your work really less while performing
repetitive tasks like minification, compilation, unit testing,
linting, etc with just few lines of code you need to write in command
prompt.
![]() |
Grunt is a task-based command line build tool for JavaScript projects. |
If
you have a Javascript and html based project that used MVVM model and
you have millions of lines of code to minimize then grunt is the key
for you.
Some of the plugins Grunt can enjoy.
Some of the big IT companies that uses grunt..
and Below is the starter guide provided by grunt official
website to keep you jump started.
have fun in grunting.
Getting started:
Grunt
0.4.x requires Node.js version
>=
0.8.0
.Installing the CLI
In
order to get started, you'll want to install Grunt's command line
interface (CLI) globally. You may need to use sudo (for OSX, *nix,
BSD etc) or run your command shell as Administrator (for Windows) to
do this.
npm install -g grunt-cli
This
will put the
grunt
command
in your system path, allowing it to be run from any directory.
Note
that installing
grunt-cli
does
not install the Grunt task runner! The job of the Grunt CLI is
simple: run the version of Grunt which has been installed next to
a Gruntfile
.
This allows multiple versions of Grunt to be installed on the same
machine simultaneously.How the CLI works
Each time
grunt
is
run, it looks for a locally installed Grunt using
node's require()
system.
Because of this, you can run grunt
from
any subfolder in your project.
If
a locally installed Grunt is found, the CLI loads the local
installation of the Grunt library, applies the configuration from
your
Gruntfile
,
and executes any tasks you've requested for it to run.
To
really understand what is happening, read
the code.
It's very short.
Comments
Post a Comment
Important - Make sure to click the Notify Me check-box below the comment to be notified of follow up comments and replies.