Skip to content

Instantly share code, notes, and snippets.

@jameskraai
Created July 23, 2014 04:36
Show Gist options
  • Save jameskraai/6661450fe73727e1aa72 to your computer and use it in GitHub Desktop.
Save jameskraai/6661450fe73727e1aa72 to your computer and use it in GitHub Desktop.
gruntfile compressing javascript, building sass and compressing output css.
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.initConfig({
uglify: {
my_target: {
files: {
'_/js/scripts.js' : ['_/components/js/scripts.js']
} //files
} // my_target
}, // uglify
compass: {
dev: {
options: {
cssDir: '_/css',
sassDir: '_/components/sass',
outputStyle: 'nested',
importPath: ['bower_components/normalize.scss'],
load: ['bower_components/susy', 'bower_components/breakpoint-sass']
} // options
} //dev
}, // compass
watch: {
scripts: {
files: ['_/components/js/*.js'],
tasks: ['uglify']
}, //scripts
sass: {
files: ['_/components/sass/*.scss'],
tasks: ['compass:dev']
}, //sass
}
}) //initConfig
grunt.registerTask('default', 'watch');
} // exports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment