2014-03-20 02:17:49 +04:00
|
|
|
module.exports = function (grunt) {
|
|
|
|
|
|
|
|
grunt.initConfig({
|
|
|
|
less: {
|
|
|
|
development: {
|
|
|
|
files: {
|
|
|
|
'public/compiled/style.min.css': 'public/less/style.less'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
less: {
|
|
|
|
files: ['public/less/**/*.less'],
|
|
|
|
tasks: ['less:development']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
shell: {
|
|
|
|
runServer: {
|
|
|
|
options: {
|
|
|
|
async: true
|
|
|
|
},
|
2014-04-26 07:11:01 +04:00
|
|
|
command: 'node app.js'
|
2014-03-20 02:17:49 +04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
jshint: {
|
|
|
|
all: ['Gruntfile.js', 'public/js/**/*.js'],
|
|
|
|
options: {
|
|
|
|
jshintrc: '.jshintrc'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
jsbeautifier: {
|
|
|
|
modify: {
|
|
|
|
src: ['Gruntfile.js', 'public/js/**/*.js'],
|
|
|
|
options: {
|
|
|
|
config: '.jsbeautifyrc'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
validate: {
|
|
|
|
src: ['Gruntfile.js', 'public/js/**/*.js'],
|
|
|
|
options: {
|
|
|
|
mode: 'VERIFY_ONLY',
|
|
|
|
config: '.jsbeautifyrc'
|
|
|
|
}
|
|
|
|
}
|
2014-04-07 23:22:18 +04:00
|
|
|
},
|
|
|
|
gettext_finder: {
|
|
|
|
files: ["views/*.html", "views/**/*.html"],
|
|
|
|
options: {
|
|
|
|
pathToJSON: ["locale/en_US/*.json"],
|
|
|
|
ignoreKeys: grunt.file.readJSON("gtf-ignored-keys.json")
|
|
|
|
},
|
2014-03-20 02:17:49 +04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-less');
|
|
|
|
grunt.loadNpmTasks('grunt-shell-spawn');
|
|
|
|
grunt.loadNpmTasks('grunt-jsbeautifier');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
|
|
|
|
grunt.registerTask('default', ['less', 'shell:runServer', 'watch']);
|
|
|
|
|
|
|
|
// Clean code before a commit
|
|
|
|
grunt.registerTask('clean', ['jsbeautifier:modify', 'jshint']);
|
|
|
|
|
|
|
|
// Validate code (read only)
|
|
|
|
grunt.registerTask('validate', ['jsbeautifier:validate', 'jshint']);
|
|
|
|
|
|
|
|
// Heroku
|
|
|
|
grunt.registerTask('heroku', ['less']);
|
|
|
|
|
|
|
|
};
|