You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building my app into a Docker container. Typically one wants to be able to run a Docker container on any server by simply changing environment variables like HOST. However, this would break the client bundle which has other values hard-coded in by EnvironmentPlugin. There's no way to deploy the app on a different host without rebuilding the js bundles. (One could build the js bundles in the docker container when it's launched, but that goes against docker best practices).
As a solution (I will PR soon) I propose turning off the process polyfill in the webpack config with node { process: false } and injecting our own process polyfill script in the Html SSR that includes desired environment variables from the server side. That way the process.env variables on the client side would always match those the server was run with.
The text was updated successfully, but these errors were encountered:
Issue - Bug
I'm building my app into a Docker container. Typically one wants to be able to run a Docker container on any server by simply changing environment variables like
HOST
. However, this would break the client bundle which has other values hard-coded in byEnvironmentPlugin
. There's no way to deploy the app on a different host without rebuilding the js bundles. (One could build the js bundles in the docker container when it's launched, but that goes against docker best practices).As a solution (I will PR soon) I propose turning off the
process
polyfill in the webpack config withnode { process: false }
and injecting our ownprocess
polyfill script in theHtml
SSR that includes desired environment variables from the server side. That way theprocess.env
variables on the client side would always match those the server was run with.The text was updated successfully, but these errors were encountered: