Skip to content

Commit 8e7d8b7

Browse files
committed
throw error before trying to read minified code length
1 parent 9ec815b commit 8e7d8b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ UglifyWriter.prototype.processFile = function(inFile, outFile, relativePath, out
116116
var result = UglifyJS.minify(src, options);
117117
var end = new Date();
118118
var total = end - start;
119-
debug('[finished]: %s %dKB in %dms', relativePath, (result.code.length / 1000), total);
120-
121119
if (total > 20000 && !silent) {
122120
console.warn('[WARN] (broccoli-uglify-sourcemap) Minifying: `' + relativePath + '` took: ' + total + 'ms (more than 20,000ms)');
123121
}
@@ -127,6 +125,8 @@ UglifyWriter.prototype.processFile = function(inFile, outFile, relativePath, out
127125
throw result.error;
128126
}
129127

128+
debug('[finished]: %s %dKB in %dms', relativePath, (result.code.length / 1000), total);
129+
130130
if (options.sourceMap) {
131131
var newSourceMap = JSON.parse(result.map);
132132

0 commit comments

Comments
 (0)