insight-ui-zcash/Gruntfile.js

101 lines
2.2 KiB
JavaScript
Raw Normal View History

2014-01-06 12:33:44 -08:00
'use strict';
module.exports = function(grunt) {
2014-01-09 14:49:48 -08:00
//Load NPM tasks
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-env');
2014-01-06 12:54:32 -08:00
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
jade: {
files: ['app/views/**'],
options: {
livereload: true,
2014-01-06 12:33:44 -08:00
},
2014-01-06 12:54:32 -08:00
},
js: {
files: ['Gruntfile.js', 'insight.js', 'app/**/*.js', 'public/js/**'],
2014-01-06 12:54:32 -08:00
tasks: ['jshint'],
options: {
livereload: true,
2014-01-06 12:33:44 -08:00
},
2014-01-06 12:54:32 -08:00
},
html: {
files: ['public/views/**'],
options: {
livereload: true,
2014-01-06 12:33:44 -08:00
},
2014-01-06 12:54:32 -08:00
},
css: {
files: ['public/css/**'],
options: {
livereload: true
}
2014-01-09 14:49:48 -08:00
},
// we monitor only app/models/* because we have test for models only now
2014-01-13 12:21:42 -08:00
// test: {
// files: ['test/**/*.js', 'test/*.js','app/models/*.js'],
// tasks: ['test'],
// }
2014-01-06 12:54:32 -08:00
},
jshint: {
all: {
src: ['Gruntfile.js', 'insight.js', 'app/**/*.js', 'public/js/**','lib/*.js'],
2014-01-06 12:54:32 -08:00
options: {
jshintrc: true
}
}
},
2014-01-07 11:49:42 -08:00
mochaTest: {
options: {
reporter: 'spec',
},
2014-01-09 14:49:48 -08:00
src: ['test/**/*.js'],
2014-01-07 11:49:42 -08:00
},
2014-01-06 12:54:32 -08:00
nodemon: {
dev: {
script: 'insight.js',
2014-01-06 12:54:32 -08:00
options: {
args: [],
ignore: ['public/**', 'test/**','util/**'],
2014-01-09 14:49:48 -08:00
// nodeArgs: ['--debug'],
2014-01-06 12:54:32 -08:00
delayTime: 1,
env: {
PORT: 3000
},
cwd: __dirname
2014-01-06 12:33:44 -08:00
}
2014-01-06 12:54:32 -08:00
}
},
concurrent: {
tasks: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true
}
},
env: {
test: {
NODE_ENV: 'test'
}
}
});
2014-01-06 12:33:44 -08:00
2014-01-06 12:54:32 -08:00
//Making grunt default to force in order not to break the project.
grunt.option('force', true);
2014-01-06 12:33:44 -08:00
2014-01-06 12:54:32 -08:00
//Default task(s).
2014-01-07 11:49:42 -08:00
grunt.registerTask('default', ['jshint','concurrent']);
2014-01-06 13:38:30 -08:00
//Test task.
grunt.registerTask('test', ['env:test', 'mochaTest']);
2014-01-06 12:33:44 -08:00
};