When I don't write webpack watch option(or write "false" to watch option) on webpack config, webapack file cache is not generated.
After investigate this problem, I found below issue, and this issue says that call compiler.close() when it generates webpack file cache.
https://github.com/webpack/webpack/issues/15411
->you need to call compiler.close() in callback to store cache.
However "karma-webpack/controller.js" doesn't call compiler.close() when watch option is false/nothing.
Therefore, it looks like this causes webpack can't generate file cache.
Expected Behavior
It generates webpack file cache regardless of webpack watch option(true/false) when execute karma test.
Actual Behavior
I want to generate webpack file cache when I execute karma test. https://webpack.js.org/configuration/cache/
When I don't write webpack watch option(or write "false" to watch option) on webpack config, webapack file cache is not generated. After investigate this problem, I found below issue, and this issue says that call compiler.close() when it generates webpack file cache. https://github.com/webpack/webpack/issues/15411 ->you need to call compiler.close() in callback to store cache.
However "karma-webpack/controller.js" doesn't call compiler.close() when watch option is false/nothing. Therefore, it looks like this causes webpack can't generate file cache.
why it doesn't call compiler.close() if watch option is false/nothing?
Code
script
karma.config.js
webpack.config.js
How Do We Reproduce?
Write watch option(false) and cache config to webpack.config.js like above code. Then execute karma(karma start karma.conf.js).