@@ -54,7 +54,7 @@ dotenvFiles.forEach(dotenvFile => {
5454// It works similar to `NODE_PATH` in Node itself:
5555// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
5656// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
57- // Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
57+ // Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
5858// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
5959// We also resolve them to make sure all tools using them work consistently.
6060const appDirectory = fs . realpathSync ( process . cwd ( ) ) ;
@@ -65,7 +65,7 @@ process.env.NODE_PATH = (process.env.NODE_PATH || '')
6565 . join ( path . delimiter ) ;
6666
6767// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
68- // injected into the application via DefinePlugin in Webpack configuration.
68+ // injected into the application via DefinePlugin in webpack configuration.
6969const REACT_APP = / ^ R E A C T _ A P P _ / i;
7070
7171function getClientEnvironment ( publicUrl ) {
@@ -85,9 +85,17 @@ function getClientEnvironment(publicUrl) {
8585 // This should only be used as an escape hatch. Normally you would put
8686 // images into the `src` and `import` them in code to get their paths.
8787 PUBLIC_URL : publicUrl ,
88+ // We support configuring the sockjs pathname during development.
89+ // These settings let a developer run multiple simultaneous projects.
90+ // They are used as the connection `hostname`, `pathname` and `port`
91+ // in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
92+ // and `sockPort` options in webpack-dev-server.
93+ WDS_SOCKET_HOST : process . env . WDS_SOCKET_HOST ,
94+ WDS_SOCKET_PATH : process . env . WDS_SOCKET_PATH ,
95+ WDS_SOCKET_PORT : process . env . WDS_SOCKET_PORT ,
8896 }
8997 ) ;
90- // Stringify all values so we can feed into Webpack DefinePlugin
98+ // Stringify all values so we can feed into webpack DefinePlugin
9199 const stringified = {
92100 'process.env' : Object . keys ( raw ) . reduce ( ( env , key ) => {
93101 env [ key ] = JSON . stringify ( raw [ key ] ) ;
0 commit comments