Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,20 @@ var compile = function(fileName, assets, S3, options, method, type, timestamp, c
case 'uglify':
if (results instanceof Array)
results = results.join("\n");
var final_code = uglify.minify(results, {
fromString: true,
output: {
comments: /license/
}
}).code;
pushFileToS3(S3, final_code, fileName, headers, callback);
try {
var final_code = uglify.minify(results, {
fromString: true,
output: {
comments: /license/
}
}).code;
pushFileToS3(S3, final_code, fileName, headers, callback);
} catch(err) {
logger({
task: 'express-cdn',
message: 'Failed to minify ' + fileName + ' due to uglify-js error.'})
throw err
}
break;
case 'minify':
if (!(results instanceof Array)) {
Expand Down