This is an example demonstrating how to use Grunt.
Grunt is great.
Bower is great.
And how we can use them to set up a small front-end project.
Basic Grunt
is a sample project which uses Grunt and Bower to manage dependencies and tasks.
Prerequisites:
- npm
- bower
- grunt
- sonar (optional)
- mysql (optional) for sonar
Following are some of the highlights of this project:
- Separated configurations for different tasks such as wiredep, grunt connect
- shared constants across configuration
- Angular and Bootstrap are used
- Custom bootstrap theme is used Cerulean
- Wiredep is used to inject project dependencies such as angular and bootstrap
- Wiredep is used to inject project specific javascripts and css files
- The project can be imported into Eclipse
- Split tasks into smaller files instead of defining in Gruntfile.js
- Font Awesome
- grunt-usemin is used to minimise bower dependencies' files such as javascript and css files
A sample AngularJS project is also implemented with the following highlights:
- Top menu with dropdowns
- Controllers
- A set of different UI components such as tables, forms
- Single Page Application
- Angular Route is used
- A configuration file to share data across our web app: constants.js
- Sonar tasks
- Karma tests are executed before building the app
Available Tasks:
grunt serve
grunt dist
grunt karma_sonar
grunt karma:dev