Closed NilsG-S closed 7 years ago
@NilsG-S How difficult will it be to bundle the tests? And what other side effects from that might be there be? i.e. test output, etc..
The test output shouldn't be affected. I'm going to go ahead and try to bundle the tests tonight, so we'll see about difficulty.
@asclines
What do you mean by "different"? I ended up replacing my original observer idea with a Webpack plugin: webpack/webpack-watch-plugin.js
. It uses Webpack hooks to detect when a bundle is about to be emitted and kills the server. Then once the new bundle is emitted, it restarts the server.
@NilsG-S we can continue this conversation in Slack after the current one
One thing this PR does is change the logger to
loglevel
, which can be used easily by both the front end and the back end.But importantly, it also adds Webpack bundling to the back end. This allows for absolute paths in imports and hot module replacement. The command for development on the API is now
npm run start-api
, which bundles everything and automatically starts the server. When files change the old instance of the server is killed and a new one is started. The command for deployment isnpm run start
, which bundles the front end and the back end, before starting the server (this time without hot module replacement).EDIT
Note: Using absolute paths in a file will break the tests corresponding to it. Tests will have to be bundled from now on. I didn't implement this functionality in order to get this PR out more quickly, but I can do so.