Catch uglify errors

v1.18.x
Peter Jaszkowiak 8 years ago
parent 7e82570e1f
commit 61b0f0c4c3

@ -230,7 +230,6 @@ function minifyJS(data, callback) {
scripts[ref.filename] = ref.source;
});
try {
var minified = uglifyjs.minify(scripts, {
sourceMap: {
filename: data.filename,
@ -240,13 +239,14 @@ function minifyJS(data, callback) {
compress: false,
});
if (minified.error) {
return callback(minified.error);
}
async.parallel([
async.apply(fs.writeFile, data.destPath, minified.code),
async.apply(fs.writeFile, data.destPath + '.map', minified.map),
], callback);
} catch (e) {
callback(e);
}
});
}
actions.minifyJS = minifyJS;

Loading…
Cancel
Save