Skip to content

Instantly share code, notes, and snippets.

@thetrickster
Created January 31, 2014 21:17
Show Gist options
  • Save thetrickster/8743340 to your computer and use it in GitHub Desktop.
Save thetrickster/8743340 to your computer and use it in GitHub Desktop.
Foundation 5 Gruntfile.js to compile sass with libsass and copy bower components to /js/ in your project. Run `npm install && bower install` and then `grunt` to watch
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
includePaths: ['bower_components/foundation/scss']
},
dist: {
options: {
outputStyle: 'compressed'
},
files: {
'css/app.css': 'scss/app.scss'
}
}
},
copy: {
main: {
expand: true,
cwd: 'bower_components',
src: '**',
dest: 'js'
},
},
watch: {
options: {
livereload: true
},
grunt: { files: ['Gruntfile.js'] },
sass: {
files: 'scss/**/*.scss',
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('build', ['sass']);
grunt.registerTask('default', ['copy', '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-copy": "~0.4.1",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment