I have an application that requires a bunch of moving parts to run, and I'd like to set things up so WebStorm can launch all of it.
An example of what I need to do:
- Open a SSH tunnel to the database, which can be accomplished using a script.
- Start the API using a NPM script that runs
nodemon
- Attach a debugger set to automatically reconnect to nodemon
- Run the angular development server for the front-end
- Run a HTTP reverse proxy to put all of this into the same URL space - the frontend calls the API using root-relative URLs, and the backend doesn't allow CORS
- Debug the app in Chrome
This presented me with a bunch of problems:
- I can't express the dependencies with "Before launch" that simply won't fire up, because WebStorm waits for the "before" tasks to finish; obviously these process actually need to run continuously.
- Compound configurations can only run all of their component configurations in "Run" mode or in "Debug" mode. You can also only use the mode that all of the components have; so eg if you have a script configuration (which cannot be debugged) and an attached debugger (which cannot be run without debugging) you'll end up with a configuration that can't be run at all.
- If I use a compound configuration without the tunnel that still means the backend will be run in debug mode which I actually don't want, because I'm attaching to it from another configuration. The frontend server will also be run in debug mode which is also pointless.
- nodemon in general seems kind of flaky when run from WebStorm, possibly due to NPM; when I stop the debug it it actually doesn't do anything, and when I kill the process afterwards nodemon says it's "restarting child process" but it does actually end nodemon; except WebStorm doesn't notice this, you have to close the debugger tab yourself.
Has anybody managed to get something like this running without actually having to fire up every step on its own?