Skip to content
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

Merged
merged 3 commits into from
Oct 28, 2019
Merged

docs(configuration): add onListening, update after and before in devServer #3317

merged 3 commits into from
Oct 28, 2019

Conversation

billy-le
Copy link
Contributor

@billy-le billy-le commented Oct 13, 2019

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

  • Read and sign the [CLA][1]. PRs that haven't signed it won't be accepted.
  • Make sure your PR complies with the [writer's guide][2].
  • Review the diff carefully as sometimes this can reveal issues.

@jsf-clabot
Copy link

jsf-clabot commented Oct 13, 2019

CLA assistant check
All committers have signed the CLA.

@netlify
Copy link

netlify bot commented Oct 13, 2019

Preview is ready

Built with commit 118ea5c

https://deploy-preview-3317--webpackjsorg-netlify.netlify.com

Copy link
Member

@EugeneHlushko EugeneHlushko left a 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
Copy link
Member

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:

Suggested change
// 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@billy-le
Copy link
Contributor Author

Thank you for the feedback! I've updated the PR as requested.

@EugeneHlushko EugeneHlushko merged commit b14bd1d into webpack:master Oct 28, 2019
@EugeneHlushko
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants