Catch uglify errors

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

@ -230,23 +230,23 @@ function minifyJS(data, callback) {
scripts[ref.filename] = ref.source;
});
try {
var minified = uglifyjs.minify(scripts, {
sourceMap: {
filename: data.filename,
url: data.filename + '.map',
includeSources: true,
},
compress: false,
});
var minified = uglifyjs.minify(scripts, {
sourceMap: {
filename: data.filename,
url: data.filename + '.map',
includeSources: true,
},
compress: false,
});
async.parallel([
async.apply(fs.writeFile, data.destPath, minified.code),
async.apply(fs.writeFile, data.destPath + '.map', minified.map),
], callback);
} catch (e) {
callback(e);
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);
});
}
actions.minifyJS = minifyJS;

Loading…
Cancel
Save