Skip to content

Commit 624eff1

Browse files
committed
bugfix: error reporting minimize
1 parent 3454954 commit 624eff1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/webpack.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ function webpack(context, moduleName, options, callback) {
308308
}
309309

310310
// for each chunk
311-
chunkIds.forEach(function(chunkId) {
311+
for(var i = 0; i < chunkIds.length; i++) {
312+
var chunkId = chunkIds[i];
312313
var chunk = depTree.chunks[chunkId];
313314

314315
// check is chunk is empty or a duplicate
@@ -372,13 +373,12 @@ function webpack(context, moduleName, options, callback) {
372373
try {
373374
if(options.minimize) buffer = uglify(buffer, path.join(options.outputDirectory, filename));
374375
} catch(e) {
375-
callback(e);
376-
return;
376+
return callback(e);
377377
}
378378

379379
// push it as "file write"
380380
options.emitFile(filename, buffer, true);
381-
});
381+
}
382382
options.events.emit("task-end", "prepare chunks");
383383

384384
if(options.noWrite) return writingFinished();

0 commit comments

Comments
 (0)