mirror of https://github.com/webpack/webpack.git
Merge pull request #7586 from samccone/sjs/fix_webpack_profiling_race
Fix race condition in profiling plugin.
This commit is contained in:
commit
bb38c5d039
|
|
@ -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();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue