Created
May 1, 2013 13:55
-
-
Save 321zeno/5495395 to your computer and use it in GitHub Desktop.
Basic gruntfile to use for Foundation projects
This file contains 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) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
files: { | |
grunt: ['Gruntfile.js'], | |
js: ['javascripts/foundation/jquery.js', | |
'javascripts/**/*.js', | |
'javascripts/*.js', | |
'!modernizr.custom.63281.js', | |
'javascripts/app.js'], | |
css: ['stylesheets/*.css'], | |
img: ['images'] | |
}, | |
smushit: { | |
path: { src: '<%= files.img %>' } // recursively replace minified images | |
}, | |
concat: { | |
css: { | |
src: ['<%= files.css %>'], | |
dest: 'css/z.styles.concat.css' | |
}, | |
cssmin: { | |
src: ['css/z.styles.concat.css'], | |
dest: 'css/styles.min.css' | |
}, | |
js: { | |
src: ['<%= files.js %>'], | |
dest: 'js/z.scripts.concat.js' | |
} | |
}, | |
uglify: { | |
dist: { | |
src: ['js/z.scripts.concat.js'], | |
dest: 'js/scripts.min.js' | |
} | |
}, | |
cssmin: { | |
dist: { | |
src: ['css/libs/z.styles.concat.css'], | |
dest: 'css/styles.min.css' | |
} | |
}, | |
watch: { | |
files: ['<%= files.grunt %>', '<%= files.js %>', '<%= files.css %>'], | |
tasks: ['default'] | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-cssmin'); | |
grunt.loadNpmTasks('grunt-smushit'); | |
grunt.registerTask('default', [ | |
'concat:js', | |
'uglify', | |
'concat:css', | |
'cssmin', | |
'concat:cssmin' | |
'smushit' | |
]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment