Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created July 27, 2012 12:33
Show Gist options
  • Save cowboy/3187711 to your computer and use it in GitHub Desktop.
Save cowboy/3187711 to your computer and use it in GitHub Desktop.
grunt v0.4.0a: jquery init template generated gruntfile
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: '<json:super-awesome.jquery.json>',
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
// Task configuration.
concat: {
options: {
banner: '<config:banner>'
},
dist: {
src: ['<file_strip_banner:src/<%= pkg.name %>.js>'],
dest: 'dist/<%= pkg.name %>.js'
}
},
min: {
options: {
banner: '<config:banner>'
},
dist: {
src: '<config:concat.dist.dest>',
dest: 'dist/<%= pkg.name %>.min.js'
}
},
qunit: {
files: ['test/**/*.html']
},
lint: {
gruntfile: {
options: {
jshintrc: '.jshintrc'
},
src: 'Gruntfile.js'
},
src: {
options: {
jshintrc: 'src/.jshintrc'
},
src: ['src/**/*.js']
},
test: {
options: {
jshintrc: 'test/.jshintrc'
},
src: ['test/**/*.js']
},
},
watch: {
gruntfile: {
files: '<config:lint.gruntfile.src>',
tasks: ['lint:gruntfile']
},
src: {
files: '<config:lint.src.src>',
tasks: ['lint:src', 'qunit']
},
test: {
files: '<config:lint.test.src>',
tasks: ['lint:test', 'qunit']
},
}
});
// Default task.
grunt.registerTask('default', ['lint', 'qunit', 'concat', 'min']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment