Skip to content

Instantly share code, notes, and snippets.

@ryanburnette
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanburnette/8885736 to your computer and use it in GitHub Desktop.
Save ryanburnette/8885736 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json')
, coffeelint: {
app: ['./assets/javascripts/**/*.coffee']
}
, coffee: {
compile: {
options: {
sourceMap: true
}
, files: {
'./assets/javascripts/main.js': ['./assets/javascripts/_*.coffee']
}
}
}
, jshint: {
dist: {
src: [
'./Gruntfile.js'
]
, options: {
'strict': true
, 'node': true
, 'browser': true
, 'jquery': true
, 'onevar': true
, 'laxcomma': true
, 'laxbreak': true
, 'eqeqeq': true
, 'immed': true
, 'undef': true
, 'unused': true
, 'latedef': true
}
}
}
, uglify: {
dist: {
files: {
'./assets/javascripts/modernizr.min.js': ['./assets/javascripts/modernizr.js']
}
, options: {
sourceMap: true
}
}
, lib: {
files: {
'./assets/javascripts/lib.min.js': [
'./bower_components/jquery-hoverIntent/jquery.hoverIntent.js'
, './bower_components/imagesloaded/imagesloaded.pkgd.js'
, './bower_components/jquery-throttle-debounce/jquery.ba-throttle-debounce.js'
, './bower_components/decently-smart-target/jquery.dst.js'
]
}
, options: {
sourceMap: true
, mangle: false
}
}
}
, sass: {
dist: {
files: {
'./assets/stylesheets/main.css': './assets/stylesheets/main.sass'
}
, options: {
style: 'compressed'
}
}
}
, watch: {
coffee: {
files: [
'./assets/javascripts/*.coffee'
]
, tasks: ['coffeelint', 'coffee']
}
, js: {
files: [
'./Gruntfile.js'
, './assets/javascripts/*.js'
]
, tasks: ['jshint', 'uglify']
}
, sass: {
files: [
'./assets/stylesheets/**.sass'
, './assets/stylesheets/**.scss'
]
, tasks: [
'sass'
]
}
}
, connect: {
server: {
options: {
port: 9001
, base: '.'
, livereload: true
}
}
}
});
[ 'grunt-coffeelint'
, 'grunt-contrib-coffee'
, 'grunt-contrib-jshint'
, 'grunt-contrib-uglify'
, 'grunt-contrib-sass'
, 'grunt-contrib-watch'
, 'grunt-contrib-connect'
].forEach(function (task) {
grunt.loadNpmTasks(task);
});
grunt.registerTask('default', ['coffeelint', 'coffee', 'jshint', 'uglify', 'sass']);
grunt.registerTask('dev', ['connect', 'watch']);
};
{
"private": true,
"name": "Gruntfile.js",
"main": "Gruntfile.js",
"repository": {
"type": "git",
"url": "git@gist.github.com:/8885736.git"
},
"author": "Ryan Burnette",
"license": "Apache2",
"devDependencies": {
"coffeelint": "^1.8.1",
"grunt": "^0.4.5",
"grunt-coffeelint": "0.0.13",
"grunt-contrib-coffee": "^0.12.0",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-sass": "^0.9.2",
"grunt-contrib-uglify": "^0.7.0",
"grunt-contrib-watch": "^0.6.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment