-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(configuration): add onListening, update after and before in devServer #3317
Conversation
Preview is ready Built with commit 118ea5c https://deploy-preview-3317--webpackjsorg-netlify.netlify.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, although i have to request changes on the example and the wording
//... | ||
devServer: { | ||
onListening: function(server) { | ||
// do fancy stuff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a great example, can we change this to:
// do fancy stuff | |
const port = server.listeningApp.address().port; | |
console.log('Listening on port:', port); |
|
||
`function (server)` | ||
|
||
This option allow to developers run own scripts after run webpack-dev-server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option allow to developers run own scripts after run webpack-dev-server | |
Provides an option to execute a custom function when `webpack-dev-server` starts listening for connections on a port. |
Thank you for the feedback! I've updated the PR as requested. |
Thanks! |
onListening was added in 3.5.0
webpack/webpack-dev-server#1760
compiler arg for after and before functions was added in 3.3.0
https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md#features-4