We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 702390a commit 2560fceCopy full SHA for 2560fce
src/content/configuration/dev-server.mdx
@@ -829,6 +829,26 @@ module.exports = {
829
};
830
```
831
832
+## devserver.onListening
833
+
834
+`function (server)`
835
836
+Provides the ability to execute a custom function when webpack-dev-server starts listening for connections on a port.
837
838
+**webpack.config.js**
839
840
+```javascript
841
+module.exports = {
842
+ //...
843
+ devServer: {
844
+ onListening: function (server) {
845
+ const port = server.address().port;
846
+ console.log('Listening on port:', port);
847
+ },
848
849
+};
850
+```
851
852
## devServer.open
853
854
`boolean` `string` `[string]` `object` `[object]`
0 commit comments