Skip to content

Instantly share code, notes, and snippets.

@anthonyshort
Created September 28, 2012 07:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonyshort/3798360 to your computer and use it in GitHub Desktop.
Save anthonyshort/3798360 to your computer and use it in GitHub Desktop.
My Gruntfile
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
meta: {
version: '0.1.0',
banner: '/*! Cake Marketing - v<%= meta.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* http://cakemarketing.com/\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
'Newism; */'
},
lint: {
files: ['grunt.js', 'app/**/*.js', 'test/**/*.js']
},
concat: {
vendor: {
src: [
'components/handlebars/handlebars.runtime-1.0.0-rc.1.js',
'components/underscore/underscore.js',
'components/backbone/backbone.js'
],
dest: 'build/vendor.js'
}
},
min: {
vendor: {
src: ['<banner:meta.banner>', '<config:concat.vendor.dest>'],
dest: 'build/vendor.min.js'
},
build: {
src: ['<banner:meta.banner>', 'build/app.js'],
dest: 'build/app.min.js'
}
},
watch: {
files: '<config:lint.files>',
tasks: 'lint browserify handlebars'
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true
},
globals: {
jQuery: true,
require: false,
module: false
}
},
uglify: {},
handlebars: {
compile: {
options: {
namespace: "templates"
},
files: {
"build/templates.js": "templates/*.hbs"
}
}
},
browserify: {
"build/app.js": {
entries: ['app/**/*.js'],
prepend: ['build/templates.js']
}
}
});
grunt.loadNpmTasks('grunt-contrib');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-growl');
grunt.registerTask('default', 'lint handlebars browserify concat min');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment