Skip to content

Commit

Permalink
Merge pull request #7586 from samccone/sjs/fix_webpack_profiling_race
Browse files Browse the repository at this point in the history
Fix race condition in profiling plugin.
  • Loading branch information
sokra committed Jun 24, 2018
2 parents 3fb49de + 735f99c commit bb38c5d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/debug/ProfilingPlugin.js
Expand Up @@ -130,7 +130,14 @@ function createTrace(outputPath) {
trace,
counter,
profiler,
end: callback => fsStream.end(callback)
end: callback => {
// Wait until the write stream finishes.
fsStream.on("finish", () => {
callback();
});
// Tear down the readable trace stream.
trace.destroy();
}
};
}

Expand Down

0 comments on commit bb38c5d

Please sign in to comment.