add monitoring to Gruntfile. updates README

This commit is contained in:
Matias Alejo Garcia 2014-03-20 12:34:35 -03:00
parent fcf6d72fa4
commit ec3f05cb75
3 changed files with 36 additions and 13 deletions

View File

@ -3,23 +3,16 @@
module.exports = function(grunt) {
//Load NPM tasks
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-css');
grunt.loadNpmTasks('grunt-markdown');
grunt.loadNpmTasks('grunt-macreload');
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: {
src: ['Gruntfile.js', 'public/src/js/**/*.js'],
options: {
jshintrc: true
}
}
},
concat: {
options: {
process: function(src, filepath) {
@ -83,15 +76,33 @@ module.exports = function(grunt) {
}
]
}
}
},
macreload: {
chrome: {
browser: 'chrome',
editor: 'macvim'
}
},
watch: {
main: {
files: ['public/src/js/**/*.js'],
tasks: ['concat:main', 'uglify:main', 'macreload'],
},
css: {
files: ['public/src/css/**/*.css'],
tasks: ['concat:css', 'cssmin', 'macreload'],
},
},
});
//Making grunt default to force in order not to break the project.
grunt.option('force', true);
//Default task(s).
grunt.registerTask('default', ['jshint']);
grunt.registerTask('default', ['watch']);
//Compile task (concat + minify)
grunt.registerTask('compile', ['concat', 'uglify', 'cssmin']);
grunt.registerTask('compile', ['concat', 'uglify', 'cssmin', 'macreload']);
};

View File

@ -59,10 +59,20 @@ To compile and minify the web application's assets:
```$ grunt compile```
There is a convinent Gruntfile.js for automation during editing the code
```$ grunt```
and if you are develping the API also, run:
```INSIGHT_PUBLIC_PATH=../insight/public grunt```
**also** in the insight-api path. (So you will have to grunt process running, one for insight and one for insight-api).
## Note
For more details about the *insight API* configs and end-poinst, just go to [insight API github repository](https://github.com/bitpay/insight-api) or read the [documentation](https://github.com/bitpay/insight-api/blob/master/README.md)
For more details about the *insight API* configs and end-point, just go to [insight API github repository](https://github.com/bitpay/insight-api) or read the [documentation](https://github.com/bitpay/insight-api/blob/master/README.md)
## Contribute

View File

@ -56,6 +56,8 @@
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.3.2",
"grunt-contrib-watch": "*",
"grunt-macreload": "*",
"grunt-css": "~0.5.4",
"grunt-markdown": "~0.5.0"
}