Bud development server and ddev

I am running Ddev for my local development environment and since I want to keep my host machine as clean as possible, I run all commands from within the Ddev container after having SSH:d in to it.

Now I would like to set up Bud on my project and get Buds development server, more specifically “hot reloading”, to work,

I am the first one to admit that Docker, servers, ports et al are not my forte so I have tried everything that Google and ChatGPT could come up with. Also tried some solutions for Browsersync since I figured it may be related. But I still can not get the browser to reload or access the site at the URLs that Bud gives me based on my, probably erroneous, settings (which I wont be listing here since I have tried so many).

If I run yarn bud dev and load the standard URL (like https://site.dev) in the browser, everything is fine. If I change something in a css-file and manually reload the browser, the changes are applied.

If anyone have gotten automatic reloading to work I would be grateful for any examples or pointers. I have a feeling that is its “only” a matter of setting the correct values in these settings and possibly having Ddev exposing port 3000.

I can list what I have tried so far or provide more details if needed.

Thanks in advance.

This guide from @aksld might be helpful:

Yes! Thank you @ben and @aksld!

That was the push that I needed to test using “http” instead of “https” in setPublicUrl() which worked. After that, I ultimately ended up with

.serve(3000)
.proxy(app.env.get('WP_HOME')) // or 'https://project.ddev.site'
.setPublicUrl(app.env.get('WP_HOME') + '3001') // or 'https://project.ddev.site:3001'

which differs from the example in that I am using https and port 3001 in setPublicUrl() so I can access the site over https. Thought it might be a good idea to leave it here in case someone else with my lack of knowledge about stuff like this comes around.

1 Like