Skip to content

Instantly share code, notes, and snippets.

@genoma
Created February 27, 2014 12:11
Show Gist options
  • Save genoma/9248932 to your computer and use it in GitHub Desktop.
Save genoma/9248932 to your computer and use it in GitHub Desktop.
Grunt configuration for Foundation 5 with coffeescript and grunt-newer
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
coffee: {
compileJoined: {
options: {
join: true
},
files: {
'js/app.js': ['coffeescripts/app.coffee', 'coffeescripts/*.coffee']
}
},
glob_to_multiple: {
expand: true,
flatten: true,
cwd: 'p_coffeescripts',
src: ['*.coffee'],
dest: 'js/plugins/',
ext: '.js'
}
},
sass: {
options: {
includePaths: ['bower_components/foundation/scss']
},
dist: {
options: {
outputStyle: 'compressed'
},
files: {
'css/app.css': 'scss/app.scss'
}
}
},
watch: {
grunt: { files: ['Gruntfile.js'] },
sass: {
files: 'scss/**/*.scss',
tasks: ['sass']
},
coffee: {
options: {
livereload: true
},
files: ['coffeescripts/*.*', 'p_coffeescripts/*.*'],
tasks: ['coffee']
},
html: {
options: {
livereload: true
},
files: ['*.html']
}
}
});
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-newer');
grunt.registerTask('build', ['newer:sass', 'newer:coffee']);
grunt.registerTask('default', ['build','watch']);
}
{
"name": "foundation-libsass-template",
"version": "0.0.1",
"devDependencies": {
"node-sass": "~0.7.0",
"grunt": "~0.4.1",
"grunt-contrib-watch": "^0.5.3",
"grunt-sass": "~0.8.0",
"grunt-contrib-coffee": "^0.10.1",
"grunt-newer": "^0.6.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment