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

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

This comment has been minimized.

Copy link
Contributor

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 added some commits Dec 23, 2017

@sifex

This comment has been minimized.

Copy link
Contributor Author

commented Dec 24, 2017

Good catch @kylekatarnls

});
```

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

This comment has been minimized.

Copy link
@nmfzone

nmfzone Jan 9, 2018

I think this is not relevant right now.

This comment has been minimized.

Copy link
@sifex

sifex Jan 9, 2018

Author Contributor

The PR request?

This comment has been minimized.

Copy link
@nmfzone

nmfzone Jan 9, 2018

Yes, mix() already get merged, right?

This comment has been minimized.

Copy link
@nmfzone

nmfzone Jan 9, 2018

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

@JeffreyWay JeffreyWay merged commit 2aa181b into JeffreyWay:master Jan 16, 2018

@sifex sifex deleted the sifex:hmr-external branch Jan 16, 2018

@sifex

This comment has been minimized.

Copy link
Contributor Author

commented Jan 16, 2018

Thanks @JeffreyWay :)

theninja added a commit to theninja/framework that referenced this pull request Feb 21, 2018

Supporting Laravel-Mix PR laravel#1246, HMR w/ different Hosts and Ports
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 JeffreyWay/laravel-mix#1246

Let me know if you require tests
@dmason30

This comment has been minimized.

Copy link

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
Projects
None yet
5 participants
You can’t perform that action at this time.