Skip to content

Instantly share code, notes, and snippets.

@monolithed
Created January 6, 2015 22:27
Show Gist options
  • Save monolithed/129490160cb57e380291 to your computer and use it in GitHub Desktop.
Save monolithed/129490160cb57e380291 to your computer and use it in GitHub Desktop.
grunt-fest
/*!
* tasks/fest
*/
'use strict';
var utils = require('util');
module.exports = function (grunt, options) {
return {
index: {
options: {
template: function (data) {
var content = utils.format('return %s(%j);', data.contents, {
version: options.build.version,
banner : '<%= figlet.banner %>'
});
return new Function(content)();
}
},
files: {
'build/index.html': 'cache/trunk/index.xml'
}
},
client: {
options: {
template: function (data) {
return 'module.exports = ' + data.contents;
}
},
files: {
'cache/trunk/templates/index.js':
'cache/trunk/templates/content/index.xml'
}
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment