If I’m reading config/webpack.config.js correctly, you should be able to set WEBPACK_OPTS environment variable to --host=192.168.X.Y. This should be then honored by webpack devserver.
Another piece of the puzzle is configuring rails to actually reach out there when retrieving a webpack manifest. The only way I found is to add config.webpack.dev_server.manifest_host = '192.168.X.Y' into config/environments/development.rb
Oh, this almost did it. I my webpack instance was replying with “Invalid Host header” so I googled it and added --pubic FQDN and now it works! Thanks.
cd foreman
bundle install
npm install
bundle exec foreman start
But I didn’t see anything in browser
In console i have errors:
GET https://192.168.246.50:3808/webpack/bundle.css net::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY
GET https://192.168.246.50:3808/webpack/foreman_remote_execution:global.css net::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY
GET https://192.168.246.50:3808/webpack/katello:fills.css net::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY
GET https://192.168.246.50:3808/webpack/foreman-vendor.bundle-v8.9.0-development-bbbb22a12f604c1ed0ff.css net::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY
GET https://192.168.246.50:3808/webpack/foreman-vendor.bundle-v8.9.0-development-bbbb22a12f604c1ed0ff.js net::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY
GET https://192.168.246.50:3808/webpack/vendor.js net::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY
GET https://192.168.246.50:3808/webpack/bundle.js net::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY
GET https://192.168.246.50:3808/webpack-dev-server.js net::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY
application-a5772921c7b1e7c112fa509bff3e184cda146f2f7cd03b737ab38fa51a9a7c1e.js:8 Uncaught Error: Bootstrap's JavaScript requires jQuery
at application-a5772921c7b1e7c112fa509bff3e184cda146f2f7cd03b737ab38fa51a9a7c1e.js:8
(anonymous) @ application-a5772921c7b1e7c112fa509bff3e184cda146f2f7cd03b737ab38fa51a9a7c1e.js:8
GET https://192.168.246.50:3808/webpack/foreman_remote_execution:global.js net::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY
GET https://192.168.246.50:3808/webpack/katello:fills.js net::ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY