Created
June 21, 2013 15:21
-
-
Save raddevon/5831927 to your computer and use it in GitHub Desktop.
Gruntfile for my personal site
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
var scripts = ['js/jquery-1.9.1.js', 'js/jquery.animate-enhanced.min.js','jquery.easing.min.js', 'js/**/*.js', '!js/scripts.js']; | |
module.exports = function (grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
jshint: { | |
options: { | |
force: true | |
}, | |
all: scripts + ['!js/jquery-1.9.1.js', '!js/jquery.animate-enhanced.min.js', '!jquery.easing.min.js'] | |
}, | |
concat: { | |
dist: { | |
src: scripts, | |
dest: 'js/scripts.js' | |
} | |
}, | |
uglify: { | |
min: { | |
files: { | |
'js/scripts.js': ['js/scripts.js'] | |
} | |
} | |
}, | |
compass: { | |
dev: { | |
options: { | |
sassDir: 'sass', | |
cssDir: 'css' | |
} | |
}, | |
production: { | |
options: { | |
sassDir: 'sass', | |
cssDir: 'css', | |
environment: 'production', | |
outputStyle: 'compressed', | |
force: true | |
} | |
} | |
}, | |
smushit: { | |
images: { | |
src: ['img/**/*.{png,jpg,jpeg}'] | |
} | |
}, | |
watch: { | |
options: { | |
livereload: true | |
}, | |
scripts: { | |
files: scripts, | |
tasks: ['jshint', 'concat'] | |
}, | |
styles: { | |
files: ['sass/**/*.{sass,scss}'], | |
tasks: ['compass:dev'] | |
} | |
}, | |
connect: { | |
server: { | |
options: { | |
port: 8888, | |
hostname: '*' | |
} | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-compass'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-connect'); | |
grunt.loadNpmTasks('grunt-smushit'); | |
// Development task checks and concatenates JS, compiles SASS preserving comments and nesting, runs dev server, and starts watch | |
grunt.registerTask('default', ['jshint','concat', 'compass:dev', 'connect:server', 'watch']); | |
// Build task builds minified versions of static files | |
grunt.registerTask('build', ['jshint', 'compass:production', 'concat', 'uglify', 'smushit']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment