Skip to content

Instantly share code, notes, and snippets.

@conspirator
Created January 31, 2012 14:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save conspirator/1710689 to your computer and use it in GitHub Desktop.
Save conspirator/1710689 to your computer and use it in GitHub Desktop.
config.init({
meta: {
title: 'Premier Dental Implant Practices',
name: "Christopher Webb",
homepage: 'http://conspirator.co',
twitter: 'conspirator',
banner: '/* \n' +
' * \tAuthor:\t\t{{meta.name}}\n' +
' * \tWebsite:\t{{meta.homepage}}\n' +
' * \tTwitter:\thttp://twitter.com/{{meta.twitter}}\n' +
' * \n' +
' * \tTitle:\t\t{{meta.title}}\n' +
' * \tBuild:\t\t{{today "yyyyddmm"}}\n' +
' * \n' +
' */'
},
watch: {
files: ["assets/js/*.js"],
tasks: 'default'
},
concat: {
'assets/js/min/main.js': ["assets/js/jquery-1.7.1.min.js", "assets/js/underscore.min.js", "assets/js/jquery.cycle.all.js", "assets/js/jquery.validate.js", "assets/js/jquery.lightbox_me.js", "assets/js/main.js"],
},
min: {
'assets/js/min/main.min.js': ['<banner>', 'assets/js/min/main.js']
}
});
// Default task.
task.registerTask('default', 'concat min watch');
@cowboy
Copy link

cowboy commented Jan 31, 2012

FWIW, you can use wildcards in your watch files list to simplify things, like:

config.init({
  watch: {
    files: ["assets/js/*.js"],
    tasks: "default"
  }
});

@ijy
Copy link

ijy commented Aug 13, 2012

Thanks, this provides a useful example as all I wanted was to use it for JS minification too. How do you get the meta banner outputting though? For me it outputs literally like this:

/* 
 *  Author:     {{meta.name}}
 *  Website:    {{meta.homepage}}
 * 
 *  Title:      {{meta.title}}
 *  Build:      {{today "yyyyddmm"}}
 * 
 */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment