Skip to content

Instantly share code, notes, and snippets.

@conspirator
Created October 13, 2012 07:48
Show Gist options
  • Save conspirator/3883732 to your computer and use it in GitHub Desktop.
Save conspirator/3883732 to your computer and use it in GitHub Desktop.
A sample grunt file.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner: '/* \n' +
' * \tAuthor:\t\t<%= pkg.name %>\n' +
' * \tWebsite:\t<%= pkg.website %>\n' +
' * \tTwitter:\thttp://twitter.com/<%= pkg.twitter %>\n' +
' * \n' +
' * \tTitle:\t\t<%= pkg.title %>\n' +
' * \tBuild:\t\t<%= grunt.template.today("yyyymmddhhmmss") %>\n' +
' * \n' +
' */'
},
coffee: {
app: {
src: ['coffee/*.coffee'],
dest: 'js/source/'
}
},
concat: {
'js/app.js': [
'js/lib/jquery.min.js',
'js/lib/underscore.min.js',
'js/lib/backbone.min.js',
'js/lib/mustache.js',
'js/source/*.js'
],
},
min: {
'js/app.min.js': ['<banner:meta.banner>', 'js/app.js']
},
compass: {
dev: {
src: 'sass/',
dest: 'css',
linecomments: false,
forcecompile: true,
debugsass: false,
images: 'images',
relativeassets: true
}
},
watch: {
files: ['coffee/*.coffee', 'sass/*.sass'],
tasks: 'default'
}
});
grunt.loadNpmTasks('grunt-coffee');
grunt.loadNpmTasks('grunt-compass');
grunt.registerTask('default', 'compass:dev coffee concat min watch');
};
{
"title": "Project name",
"name": "Your name",
"website": "http://foobarbaz.com",
"twitter": "gruber"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment