-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
LaravelMix example: process.env.DDEV_HOSTNAME only works without additional project hostnames #27
Comments
A basic idea to make sure to use a single hostname would be |
Thanks @mandrasch . Any interest in a PR? |
Hey @tyler36, sure thing, currently occupied with other things. Hope I'll get to it in the next days! Cheers. |
Hey, I prepared a demo repo with Randys suggestion: https://github.com/mandrasch/ddev-laravelmix-browsersync For me it works fine using let url = `${process.env.DDEV_PROJECT}.${process.env.DDEV_TLD}`; But as far as I understand this is only for command line output. And "http" is displayed instead of "https". Maybe we should just leave it out to avoid confusion? Without mix.browserSync({
proxy: "localhost",
open: false,
ui: false
}); |
Side note: additional_hostnames support (and additional_fqdns) added to ddev-varnish in ddev/ddev-varnish#9, not sure if this is a related situation. |
Thanks for info! Haven't used varnish yet, can't say if this is related. Regarding LaravelMix: Added additional hostnames to my demo, works fine as well because it justs responds to LaravelMix has no support for subdomains / additional hostnames as far as I know, it's just compiles files based on one config and outputs them to the output folder. My educated guess would be that we could just strip out the |
Docs:
|
I was able to replicate the issue you describe. It occures with the laravel-mix and the vanilla javascript included. I did a PR which explicity sets the URL (as suggested by @rfay ) and includes a docs update on additional hostnames. I prefer to see a project-based URL instead of an IP-based URL, which would be the case if we dropped the How common are additional hostname projects? I think the PR works but it breaks auto-updates so perhaps a better solution is required. |
There are quite a lot of uses for additional_hostnames and additional_fqdns. |
Change the PR to support addition hostnames out of the box. @mandrasch does that work for you? |
Hey sorry for the delay, can I install your updated PR as well with (Test repo https://github.com/mandrasch/ddev-laravelmix-browsersync) |
Just tried, doesn't work anymore: |
I think the tarball for #21 is: |
Thanks very much, I pulled latest version into https://github.com/mandrasch/ddev-laravelmix-browsersync, did not change much in my repo. Still worked. For my personal use cases I'll go without setting the host since I see no benefit in setting this (and also think it is confusing to read 'http://my-ddev-site.ddev.site:3000' instead of 'https://...:3000'). mix.browserSync({
proxy: "localhost",
open: false,
ui: false
}); Thanks very much for the discussion here! Much appreciated! 🙏 🙏 |
Hey, just as information, thanks for providing this:
Laravel Mix example (https://github.com/drud/ddev-browsersync#laravel-mix-configuration) suggests using
When there are Additional Hostnames configured in DDEV,
DDEV_HOSTNAME
returns a comma separated list.For example
main-site.ddev.site,subsite-1.ddev.site,subsite-2.ddev.site
We also noticed that
host
can be disabled all together and integration of browsersync still works? (I guess because proxy is used anyway and host is only for cli terminal output). So maybe we could leave it out of the example to avoid confusion? Not quite sure yet. 🤔https://browsersync.io/docs/options#option-host
Best regards,
Matthias
PS: I could provide a sample repo if needed for reproduction.
The text was updated successfully, but these errors were encountered: