I was investigating this and app2 doesn’t try to connect to webpack, it only checks if webpack-dev-server is running and if it isn’t running the packs are compiled, if webpack-dev-server is running they aren’t.
compile if compiling?, if
compiling? returns true, it means webpack-dev-server isn’t running and it needs to compile the assets, but the
compiling? method has this condition
config.compile? && !dev_server.running? which means that the config
compile needs to be true and the webpack-dev-server shouldn’t be running, but since the method
running? from the dev server just checks if he is able to make a tcp connection and when there is another a webpack-dev-server running in another app with the same port as is configured in app2, the connection will be successfull and the assets won’t be compiled.
I don’t know if there is a way to check if the running webpack-dev-server is from another app, well, at least not the way it is currently implemented.
@zzak As I understand Rails doesn’t connects to webpacker, the flow is handled 100% by webpacker when you call any of those helper methods that webpacker exposes.