To create a custom server implementation.
This mode uses SockJS-node as a server.
webpack.config.js
module.exports = {
// ...
devServer: {
webSocketServer: "sockjs",
},
};
Usage via CLI:
npx webpack serve --web-socket-server sockjs --open
- The script should open
http://localhost:8080/
in your default browser. - You should see the text on the page itself change to read
Success!
.