Description
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 Adds HOST and PORT env variables to react app so websocket facebook/create-react-app#1588 to be merged.