Skip to content

Commit 8f81bc7

Browse files
author
Morten N.O. Henriksen
committed
Update webpack-dev-server to beta.3
1 parent d72116e commit 8f81bc7

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

docusaurus/docs/advanced-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can adjust various development and production settings by setting environmen
1515
| PORT | ✅ Used | 🚫 Ignored | By default, the development web server will attempt to listen on port 3000 or prompt you to attempt the next available port. You may use this variable to specify a different port. |
1616
| HTTPS | ✅ Used | 🚫 Ignored | When set to `true`, Create React App will run the development server in `https` mode. |
1717
| WDS_SOCKET_HOST | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket hostname for hot module reloading. Normally, `webpack-dev-server` defaults to `window.location.hostname` for the SockJS hostname. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockhost) for more details. |
18-
| WDS_SOCKET_PATH | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket path for hot module reloading. Normally, `webpack-dev-server` defaults to `/sockjs-node` for the SockJS pathname. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockpath) for more details. |
18+
| WDS_SOCKET_PATH | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket path for hot module reloading. Normally, `webpack-dev-server` defaults to `/ws` for the SockJS pathname. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockpath) for more details. |
1919
| WDS_SOCKET_PORT | ✅ Used | 🚫 Ignored | When set, Create React App will run the development server with a custom websocket port for hot module reloading. Normally, `webpack-dev-server` defaults to `window.location.port` for the SockJS port. You may use this variable to start local development on more than one Create React App project at a time. See [webpack-dev-server documentation](https://webpack.js.org/configuration/dev-server/#devserversockport) for more details. |
2020
| PUBLIC_URL | ✅ Used | ✅ Used | Create React App assumes your application is hosted at the serving web server's root or a subpath as specified in [`package.json` (`homepage`)](deployment#building-for-relative-paths). Normally, Create React App ignores the hostname. You may use this variable to force assets to be referenced verbatim to the url you provide (hostname included). This may be particularly useful when using a CDN to host your application. |
2121
| BUILD_PATH | 🚫 Ignored | ✅ Used | By default, Create React App will output compiled assets to a `/build` directory adjacent to your `/src`. You may use this variable to specify a new path for Create React App to output assets. BUILD_PATH should be specified as a path relative to the root of your project. |

packages/react-dev-utils/webpackHotDevClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var connection = new WebSocket(
6363
hostname: process.env.WDS_SOCKET_HOST || window.location.hostname,
6464
port: process.env.WDS_SOCKET_PORT || window.location.port,
6565
// Hardcoded in WebpackDevServer
66-
pathname: process.env.WDS_SOCKET_PATH || '/sockjs-node',
66+
pathname: process.env.WDS_SOCKET_PATH || '/ws',
6767
slashes: true,
6868
})
6969
);

packages/react-scripts/config/webpackDevServer.config.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const getHttpsConfig = require('./getHttpsConfig');
1919

2020
const host = process.env.HOST || '0.0.0.0';
2121
const sockHost = process.env.WDS_SOCKET_HOST;
22-
const sockPath = process.env.WDS_SOCKET_PATH; // default: '/sockjs-node'
22+
const sockPath = process.env.WDS_SOCKET_PATH; // default: '/ws'
2323
const sockPort = process.env.WDS_SOCKET_PORT;
2424

2525
module.exports = function (proxy, allowedHost) {
@@ -73,18 +73,20 @@ module.exports = function (proxy, allowedHost) {
7373
ignored: ignoredFiles(paths.appSrc),
7474
},
7575
},
76-
// Prevent a WS client from getting injected as we're already including
77-
// `webpackHotDevClient`.
78-
injectClient: false,
7976
client: {
8077
// Enable custom sockjs pathname for websocket connection to hot reloading server.
8178
// Enable custom sockjs hostname, pathname and port for websocket connection
8279
// to hot reloading server.
8380
host: sockHost,
8481
path: sockPath,
8582
port: sockPort,
83+
overlay: false,
84+
needClientEntry: false,
85+
// Prevent a WS client from getting injected as we're already including
86+
// `webpackHotDevClient`.
87+
needHotEntry: false
8688
},
87-
dev: {
89+
devMiddleware: {
8890
// It is important to tell WebpackDevServer to use the same "publicPath" path as
8991
// we specified in the webpack config. When homepage is '.', default to serving
9092
// from the root.
@@ -94,7 +96,6 @@ module.exports = function (proxy, allowedHost) {
9496

9597
https: getHttpsConfig(),
9698
host,
97-
overlay: false,
9899
historyApiFallback: {
99100
// Paths with dots should still use the history fallback.
100101
// See https://github.com/facebook/create-react-app/issues/387.

packages/react-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"style-loader": "2.0.0",
8282
"ts-pnp": "1.2.0",
8383
"webpack": "5.37.0",
84-
"webpack-dev-server": "4.0.0-beta.0",
84+
"webpack-dev-server": "4.0.0-beta.3",
8585
"webpack-manifest-plugin": "3.1.1",
8686
"workbox-webpack-plugin": "6.1.5"
8787
},

0 commit comments

Comments
 (0)