Description
When using the webpack
plugin, output is piped to a log server (usually at http://localhost:9000
).
However, if an error occurs during complication that causes the process to end, the log server can't be accessed, as it's closed immediately.
A common example of where this can happen is with using TypeScript: If ts-loader
can't compile the main process, it won't emit any files, causing electron to error out like so:
Webpack Output Available: http://localhost:9000
App threw an error during load
Error: Module build failed (from ./node_modules/ts-loader/index.js):
Error: TypeScript emitted no output for C:\Users\G-Rath\workspace\projects-personal\my-project\src\main\index.ts.
<stacktrace>
webpack built cd6a8a749879c7e98dc2 in 8086ms
(This error in particular does cause a dialog box from electron to open, which means the log server doesn't close until you hit ok, giving you a bit of a workaround, but it's still annoying and possible for other errors to just straight terminate the process)
It'd be nice for the webpack-plugin to somehow provide more information in these cases.
One possible solution could be to write the logs to disk (possibly via configuration, so that we could switch it on when if we're having such an error)
This is based off #579