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

Support for HMR on different hosts and ports #1246

Merged
merged 5 commits into from Jan 16, 2018

Conversation

sifex
Copy link
Contributor

@sifex sifex commented Oct 5, 2017

Fixes #1000

Addition of host and port options in Laravel Mix and passing them into Webpack Dev Server. This allows both external viewing of hot reloading (which works amazing) and also allows the changing of port in case 8080 is taken on the host machine (which it was for me)

One thing to note is the hijacking of the public/hot file to be able to communicate with the Laravel mix helper. Instead of writing "hot reloading", I've changed it to be simply "http/s" plus the new host and port.

Tested without port and host variables, and as expected they default back to localhost:8000.


Important to note, the Laravel Mix Helper in the Laravel Framework needs to change, should be adding a related PR fairly shortly.

Edit: laravel/framework#21545 PR Added

@kylekatarnls
Copy link
Contributor

@kylekatarnls kylekatarnls commented Dec 20, 2017

Hi, there is 1 space in excess (let http... is currently shifted) if you want to fix it in the same time with this PR that I would really enjoy to see merged. :)

@sifex
Copy link
Contributor Author

@sifex sifex commented Dec 24, 2017

Good catch @kylekatarnls

});
```

Important: Currently, support for the `{{ mix('js/bundle.js') }}` blade helper is pending PR.
Copy link

@nmfzone nmfzone Jan 9, 2018

Choose a reason for hiding this comment

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

I think this is not relevant right now.

Copy link
Contributor Author

@sifex sifex Jan 9, 2018

Choose a reason for hiding this comment

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

The PR request?

Copy link

@nmfzone nmfzone Jan 9, 2018

Choose a reason for hiding this comment

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

Yes, mix() already get merged, right?

Copy link

@nmfzone nmfzone Jan 9, 2018

Choose a reason for hiding this comment

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

Ah sorry, I don't get it. I just realize it's your own PR.

@JeffreyWay JeffreyWay merged commit 2aa181b into laravel-mix:master Jan 16, 2018
@sifex sifex deleted the hmr-external branch Jan 16, 2018
@sifex
Copy link
Contributor Author

@sifex sifex commented Jan 16, 2018

Thanks @JeffreyWay :)

theninja pushed a commit to theninja/framework that referenced this issue Feb 21, 2018
This PR changes the 'mix' helper function to take URLs coming from the hot file. This feature is fully backwards compatible.

Supporting Laravel-Mix Pull Request laravel#1246, allowing Hot Module Reloading with custom hosts and ports

Do not merge straight away, awaiting reply of laravel-mix/laravel-mix#1246

Let me know if you require tests
@dmason30
Copy link

@dmason30 dmason30 commented Apr 3, 2018

@sifex It appears the docs you added were removed, I think because laravel hadn't released the mix helper change yet, but they released it in 5.5 so the docs should be re-added?

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