Skip to content

Instantly share code, notes, and snippets.

@leandrojo
Created January 9, 2014 13:59
Show Gist options
  • Select an option

  • Save leandrojo/8334491 to your computer and use it in GitHub Desktop.

Select an option

Save leandrojo/8334491 to your computer and use it in GitHub Desktop.
"use strict";
module.exports = function(grunt) {
// Configurando as tarefas aqui.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
files: ['**/*.js'],
tasks: ['concat', 'express:dev'],
options: {
spawn: false,
},
},
},
jade: {
compile: {
options: {
data: {
debug: false
}
},
files: {
"www/index.html": "www/index.jade",
"www/templates/*.html": "www/templates/*.jade",
}
}
},
concat: {
options: {
separator: ';'
},
dist: {
src: [
'www/js/config/router.js',
'www/js/controllers/*.js'
],
dest: 'www/js/app.js'
}
},
express: {
options: {
},
dev: {
options: {
script: 'server.js'
}
},
prod: {
options: {
script: 'server.js',
node_env: 'production'
}
}
},
exec: {
build: {
command: "cordova build android",
stdout: true,
stderror: true
},
}
});
// Carregando os plugins aqui.
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-express-server');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-exec');
// Registrando as tarefas customizadas aqui
grunt.registerTask('dev', ['concat', 'express:dev', 'watch']);
grunt.registerTask('prod', ['concat', 'express:prod']);
grunt.registerTask('build', ['concat', 'jade', 'exec:build']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment