Skip to content

Instantly share code, notes, and snippets.

@dancasttro
Created June 6, 2014 17:15
Show Gist options
  • Save dancasttro/475674380d0bfa13286e to your computer and use it in GitHub Desktop.
Save dancasttro/475674380d0bfa13286e to your computer and use it in GitHub Desktop.
Config Grunt
{
"watch": {
"options": {
"livereload": true
},
"css": {
"files": "app/styles/**/*.styl",
"tasks": ["stylus"]
},
"js": {
"files": "<%= jshint.all %>",
"tasks": ["jshint", "uglify"]
},
"html": {
"files": [ "/*.{html,htm,shtml,shtm,xhtml,php,jsp,asp,aspx,erb,ctp}" ]
}
},
"browserSync": {
"dev": {
"bsFiles": {
"src" : "public/css/*.css"
},
"options": {
"watchTask": true,
"server": {
"baseDir": "./",
"index": "index.html"
}
}
}
},
"jshint": {
"options": {
"jshintrc": ".jshintrc"
},
"all": [ "Gruntfile.js", "public/js/main.js" ]
},
"uglify": {
"options": {
"mangle": false
},
"build": {
"files": {
"js/main.min.js": [
"js/main.js"
]
}
}
},
"stylus": {
"options": {
"compress": false
},
"files": {
"src": "app/styles/style.styl",
"dest": "public/styles/style.css"
}
}
}
module.exports = function(grunt) {
'use strict';
// Carrega os plugins relacionados no package.json
//require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt);
// Utilizamos o método grunt.file para fazer o parse do grunt-config.json
var gruntConfig = grunt.file.readJSON('./grunt-config.json');
grunt.initConfig(gruntConfig);
//Build Projetc
grunt.registerTask('build', ['stylus']);
// Registra a tarefa padrão
grunt.registerTask('default', ['stylus', 'browserSync', 'watch']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment