Skip to content

Instantly share code, notes, and snippets.

@prabirshrestha
Created June 13, 2012 23:11
Show Gist options
  • Save prabirshrestha/2927082 to your computer and use it in GitHub Desktop.
Save prabirshrestha/2927082 to your computer and use it in GitHub Desktop.
connect-assetmanager & snockets
var Snockets = require('snockets'),
snockets = new Snockets(),
assets = {};
exports.snockets = function(file, path, index, isLast, callback) {
return snockets.getConcatenation(path, {
// minify: true
}, function(err, js) {
if (js) {
return callback(js);
} else {
return callback(err);
}
});
};
assets.js = {
'route': /\/javascripts\/app.[a-z0-9]+.*\.js/,
'path': './public/javascripts/',
'dataType': 'javascript',
'files': [
'main.js'
],
preManipulate:{
'^': [exports.snockets]
}
};
exports.assets = assets;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment