8000 fix(core): close webpack compiler when build complete (#6608) · nrwl/nx@ad62a27 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad62a27

Browse files
kazamovFrozenPandaz
authored andcommitted
fix(core): close webpack compiler when build complete (#6608)
* fix(core): close webpack compiler when build complete Call webpack `close` method when build complete according to https://webpack.js.org/api/node/#run. Fallback webpack 4 `close` method
1 parent c86eec7 commit ad62a27

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/workspace/src/utilities/run-webpack.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ export function runWebpack(config: any, webpack: any): Observable<any> {
2626
} else {
2727
webpackCompiler.run((err, stats) => {
2828
callback(err, stats);
29-
subscriber.complete();
29+
30+
// TODO: Delete for Nx 13 and leave only the call to close method
31+
if (typeof webpackCompiler.close === 'function') {
32+
webpackCompiler.close(() => {
33+
subscriber.complete();
34+
});
35+
} else {
36+
subscriber.complete();
37+
}
3038
});
3139
}
3240
});

0 commit comments

Comments
 (0)
0