We currently use the standard webpack dev client because the custom client in CRA infers the protocol/host/port of the dev server from window.location. However, since we host our React apps inside a back-end up, window.location will point at our backend server, not the webpack dev server.
We currently use the standard webpack dev client because the custom client in CRA infers the protocol/host/port of the dev server from
window.location
. However, since we host our React apps inside a back-end up,window.location
will point at our backend server, not the webpack dev server.There are a few possible solutions to this:
Configure the backend app to proxy dev server requests to the actual dev server. See https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#proxying-api-requests-in-development.
Fork the react-dev-utils sub-project to make
webpackHotDevClient.js
configurable in some way (maybe using environment variables?).Wait for https://github.com/facebookincubator/create-react-app/pull/1588 to be merged.