Skip to content

Instantly share code, notes, and snippets.

@obihann
Created February 13, 2014 16:58
Show Gist options
  • Save obihann/8979102 to your computer and use it in GitHub Desktop.
Save obihann/8979102 to your computer and use it in GitHub Desktop.
Default Grunt config file for CoffeeScript, Jade, and SASS
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
watch: {
coffee: {
files: ['src/**/*.coffee'],
tasks: ['coffee', 'sync']
},
assets: {
files: ['src/assets/*'],
tasks: ['sync'],
options: {
livereload: true
}
},
sass: {
files: ['src/sass/*.scss'],
tasks: ['sass'],
options: {
livereload: true
}
},
jade: {
files: ['src/views/*.jade'],
tasks: ['jade'],
options: {
livereload: true
}
}
},
coffee: {
options: {
bare: true
},
compile: {
expand: true,
cwd: 'src',
src: '**/*.coffee',
dest: 'app',
ext: '.js'
}
},
jade: {
options: {
pretty: true
},
compile: {
expand: true,
cwd: 'src',
src: 'src/views/*.jade',
dest: 'app/views',
ext: '.html'
}
},
sync: {
main: {
files: [{
cwd: 'src/assets',
src: '*',
dest: 'app/assets',
}]
}
},
sass: {
options: {
style: 'expanded'
},
dev: {
files: [{
expand: true,
cwd: 'src/sass',
src: '*.scss',
dest: 'app/public/css',
ext: '.css'
}]
}
}
});
// NPM Tasks
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-sync');
grunt.registerTask('default', ['coffee', 'sync', 'sass', 'jade']);
};
{
"name": "A cool project",
"version": "0.0.1",
"description": "",
"main": "app/index.js",
"dependencies": {
"coffee-script": "~1.6.3",
"jade": "~0.34.1",
"sass": "~0.5.0",
"grunt": "~0.4.1",
"grunt-contrib-jade": "~0.8.0",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-sass": "~0.4.1",
"grunt-contrib-watch": "~0.5.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Jeffrey Hann",
"license": "GPL V2"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment