Skip to content

Instantly share code, notes, and snippets.

@ebinnion
Forked from fleeting/gruntfile.js
Created January 25, 2014 03:11
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 ebinnion/8611270 to your computer and use it in GitHub Desktop.
Save ebinnion/8611270 to your computer and use it in GitHub Desktop.
(function() {
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
notify: {
watch: {
options: {
title: 'Who watches the watchmen?',
message: 'grunt tasks: jshint, concat, uglify, sass'
}
}
},
concat: {
options: {
separator: ';',
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %> */'
},
dist: {
files: {
'js/app.js': ['js/jquery-2.0.3.min.js', 'js/foundation.min.js', 'js/main.js']
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n',
sourceMap: 'js/source-map.js.map'
},
dist: {
files: {
'js/app.min.js': ['js/app.js']
}
}
},
jshint: {
files: ['gruntfile.js', 'js/app.js'],
// configure JSHint (documented at http://www.jshint.com/docs/)
options: {
globals: {
jQuery: true,
console: true,
module: true
}
}
},
sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'css/style.min.css': 'css/style.scss'
}
},
dev: {
options: {
style: 'expanded'
},
files: {
'css/style.css': 'css/style.scss'
}
}
},
watch: {
files: ['<%= jshint.files %>', 'css/style.scss', 'js/main.js', 'css/foundation/*.scss'],
tasks: ['jshint', 'concat', 'uglify', 'sass', 'notify']
},
compress: {
main: {
options: {
archive: 'ProductDemo.zip'
},
files: [
{src: ['_site/**'], dest: '/'}, // includes files in path and its subdirs
]
}
},
shell: {
build: {
command: 'grunt && jekyll build && grunt compress && mv ProductDemo.zip _site/'
}
}
});
// Load libs
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-devtools');
grunt.loadNpmTasks('grunt-notify');
// Register the default tasks
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'sass', 'notify']);
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment