Created
May 28, 2013 15:33
-
-
Save calebbrewer/5663636 to your computer and use it in GitHub Desktop.
Grunt file for:
Preprocessing sass/compass
Watching for changes in the sass/compass file
minifying js and sass files
concatenating js files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
compass: { | |
dist: { | |
options: { | |
sassDir: 'sass', | |
cssDir: 'css', | |
environment: 'production' | |
} | |
} | |
}, | |
watch: { | |
css: { | |
files: '**/*.scss', | |
tasks: ['compass'], | |
options: { | |
livereload: false, | |
}, | |
}, | |
}, | |
cssmin: { | |
minify: { | |
expand: true, | |
cwd: 'css/', | |
src: ['*.css', '!*.min.css'], | |
dest: 'css/min', | |
ext: '.min.css' | |
} | |
}, | |
uglify: { | |
options: { | |
mangle: { | |
except: ['jQuery'] | |
} | |
}, | |
my_target: { | |
files: { | |
'js/min/main.min.js': ['js/script.js', 'js/plugins.js'] | |
} | |
} | |
} | |
}); | |
// Load the plugins | |
//On github: https://github.com/gruntjs/grunt-contrib-compass | |
//Install: npm install grunt-contrib-compass --save-dev | |
grunt.loadNpmTasks('grunt-contrib-compass'); | |
//On github: https://github.com/gruntjs/grunt-contrib-watch | |
//Install: npm install grunt-contrib-watch --save-dev | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
//On github: https://github.com/gruntjs/grunt-contrib-uglify | |
//Install: npm install grunt-contrib-uglify --save-dev | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
//On github: https://github.com/gruntjs/grunt-contrib-cssmin | |
//Install: npm install grunt-contrib-cssmin --save-dev | |
grunt.loadNpmTasks('grunt-contrib-cssmin'); | |
// Default task(s). | |
grunt.registerTask('default', ['compass', 'cssmin', 'uglify']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment