Skip to content

Allow configuring the webpackHotDevClient with a url #965

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

Closed
wants to merge 1 commit into from
Closed

Allow configuring the webpackHotDevClient with a url #965

wants to merge 1 commit into from

Conversation

rzane
Copy link

@rzane rzane commented Oct 25, 2016

This allows configuring the webpackHotClient with a URL. Currently, the hot client assumes that your frontend code is served from the same window.location, but this is often not true for server-rendered applications using the webpack-dev-server.

This can be configured like so:

entry: [
  `${require.resolve('react-dev-utils/webpackHotDevClient')}?http://0.0.0.0:4001`,
  'your-entry.js'
]

See:
https://github.com/webpack/webpack-dev-server/blob/544d97bf4bee3853c84abb8690923bf93fda4fab/client/index.js#L22

parameter. This is how the normal webpack-dev-server/client.js works.
This can be configured like so:

  entry: [
    `require.resolve('react-dev-utils/webpackHotDevClient')?http://0.0.0.0:4001`,
    'your-entry.js'
  ]

See:
https://github.com/webpack/webpack-dev-server/blob/544d97bf4bee3853c84abb8690923bf93fda4fab/client/index.js#L22
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact [email protected] if you have any questions.

@gaearon
Copy link
Contributor

gaearon commented Oct 28, 2016

Thanks for the PR but I don't think we'll merge this. Mostly because this toolkit is not meant for server-rendered apps in the first place, and even if we fix this, we might make incompatible changes later on. It will be also easier for us to break by accident.

I think your best bet might be to fork this code. Sorry!

@gaearon gaearon closed this Oct 28, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants