-
Notifications
You must be signed in to change notification settings - Fork 43
Allow webpack dev server to be externally accessed #124
Comments
Hi @chrischen, can you please test out the following branch and let me know if that contains the changes you'll need? If that works, I can see about integrating this via some sort of host option: https://github.com/TrueCar/gluestick/tree/cybrass/hostname-changes |
I tried to run this branch but I get ERROR: During auto upgrade: Error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/gluestick/new/src/config/.Dockerfile' Also, re: proxying, it turns out that proxying the hmr connection doesn't seem to work for me either. The original issue is that despite wherever the javascript file is served from (in this case [hostname]:8888), the hmr updates are using a relative path, when they should also use the hostname that is specified. Is that also addressed in this update? Thanks!
|
Ok I managed to get my install to run a custom gluestick and gluestick-shared. Your changes work. But it turns out proxying the hmr endpoint isn't a good solution after all. My main-bundle.js is set to use the endpoint localhost: http://localhost:8888/assets/main-bundle.js However, HMR updates do not use the specified host. They use a relative path, but should also use the specified host and port: http://localhost:8888/__webpack_hmr Instead it actually uses http://local.test.domain/__webpack_hmr Thanks!
|
The relevant change would be in // Include hot middleware in development mode only Should allow customizing the hmr client options like here: This would remove the need to proxy for me.
|
Address #124 and migrate server setting to the config file
Bind webpack-dev-server to 0.0.0.0 instead of localhost so that it can be accessed by machine IP.
I'm using another server (a VM in virtual network) as a frontend to React/node. Requests to to webpack-dev-server, including the request to /__webpack_hmr can't be proxied since it's bound to localhost and the VM is on a virtual network.
Specifically, I'm using nginx+php running in a VM as a front end that proxies server render requests to node, instead of accessing via localhost:8880.
See relevant issue here: webpack/webpack-dev-server#147
The text was updated successfully, but these errors were encountered: