Skip to content

Commit

Permalink
switched to writing out a manifest json file to track assets and thei…
Browse files Browse the repository at this point in the history
…r md5 digested filenames
  • Loading branch information
Ryan Fitzgerald committed Jul 16, 2012
1 parent 829a88b commit 7d55638
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/assembly/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,19 @@ Manager.prototype.writeConfig = function(cb) {
if(err) return cb(err);

var paths = Object.keys(self.config.get('assets')).reduce(function(memo, asset){
if(mime.lookup(asset) != mime.types.js) return memo;
// if(mime.lookup(asset) != mime.types.js) return memo;

var md5sum = self.config.get('assets')[asset];
var buildPath = self.core.buildPath(asset, {extension : false});
var buildPath = self.core.buildPath(asset, {extension : true});

memo[buildPath] = self.core.buildPath(asset, {extension : false, version: md5sum});
memo[buildPath] = self.core.buildPath(asset, {extension : true, version: md5sum});

return memo;
}, {});

var template = "(function() {require.config({paths: %j }); }).call(this);";
var out = self.core.prettyPrint(utile.format(template, paths));
var out = JSON.stringify(paths, null, 4);

fs.writeFile(path.join(self.core.dest, "asset-manifest.js"), out, cb);
fs.writeFile(path.join(self.core.dest, "manifest.json"), out, cb);
});

};
Expand Down

0 comments on commit 7d55638

Please sign in to comment.