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

HMR - makes laravel-mix do the right thing with a complex hot host #2835

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sharkey3
Copy link

makes laravel-mix do the right thing with a complex hot host setup such as

npx mix watch --hot -- --https --host=0.0.0.0 --port=8888 --public=myip.net

(I am developing on an AWS server with a load balancer frontend. The above command works, but laravel mix puts the wrong thing in public/hot. This makes it do the right thing and simplifies the code.)

…tup such as

npx mix watch --hot -- --https --host=0.0.0.0 --port=8888 --public=myip.net
@Verron
Copy link

Verron commented Feb 15, 2021

@sharkey3 Does npx not throw an error when passing --https?

My output:

root@0561290c5aa9:/node# npx mix watch --hot --https
error: unknown option '--https'

I had to pass mix.webpackConfig({devServer: { https: true } }) in order to enable https.

I'm on webpack@5.14.0 and webpack-dev-serve@4.0.0-beta.0

@thecrypticace
Copy link
Collaborator

@Verron The release adding the https option hasn't been tagged yet.

@Verron
Copy link

Verron commented Feb 15, 2021

@thecrypticace Thanks for clarifying.

@sharkey3
Copy link
Author

sharkey3 commented Feb 15, 2021

@Verron
Please notice the "--" before "--https"
That makes it an option for webpack, and not an option for mix.

@buberdds
Copy link
Contributor

Isn't https://github.com/JeffreyWay/laravel-mix/pull/2783/files resolves this issue? You can pass whatever you want via HMR options.

@sharkey3
Copy link
Author

pull 2783 does nothing with --host and --public
It is possible to do this with hmrOptions, if you spend the hours needed to figure out the right recipe, but this makes it do the right thing automatically.

@damms005
Copy link

I'm not sure where to put this, but there is a comment that helps when dealing with non-default host.

Specifically, it suggested updating the relevant doc so users reading the HMR docs can know how to handle it.

However, the doc is still missing it. @JeffreyWay is this missing because you don't want to put too much in that section or do you welcome PR for this?

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

Successfully merging this pull request may close these issues.

None yet

5 participants