Biology for Computer Engineers Course Handout.pptx
Grunt JavaScript TaskRunner
1. Grunt - The JavaScript Task Runner
Premnath Thimma
2. What are we addressing?
• Following best practice for web application
• Improve performance of the web application
– Reduce number of files
• Saves number of request made to the server
– Reduce the size of the files
• Saves bandwidth
• Improves performance
• Limit the exposure of the code (may be?)
• Improve efficiency by automating mundane tasks
• You fill anything that anything you can think of
3. Why use TaskRunner?
• In one word: automation.
• The less work you have to do when
performing repetitive tasks like minification,
compilation, unit testing etc, the easier your
job becomes.
• After you've configured it through a Gruntfile,
a task runner can do most of that mundane
work for you—and your team—with basically
zero effort.
4. Why use Grunt?
• The Grunt ecosystem is huge and it's growing
every day.
• With literally hundreds of plugins to choose
from, you can use Grunt to automate just
about anything with a minimum of effort.
• If someone hasn't already built what you
need, authoring is a breeze (extensibility)
5. Get Started
• Install Node
• Install Grunt-Cli (Command Line Interface)
> npm install –g grunt-cli
• Define package.json (with plug-ins)
• Install plug-ins
> npm install <plug-in name>
6. Gruntfile & Plug-ins
• Define Gruntfile with Tasks
• Grunt Tasks (standard mundane tasks)
– grunt-contrib-uglify
– grunt-contrib-mincss
– grunt-contrib-concat
– grunt-contrib-minhtml
– grunt-contrib-processhtml
– And many more…
9. References & Thoughts
• www.gruntjs.com
• Shows evidence that people has been
integrating with TFS (Pre and PostBuild Tasks)
• Visual Studio has ‘Grunt Launcher’ extension
• There are other tasks runners too –
– Bower
– Gulp