Problem/Motivation
I recently switched to ddev and I can't find a proper way to enabled BrowserSync with a radix subtheme.
Laravel Mix compiles successfully but I always need to manually refresh the browser...
Note: as I'm using ddev, I don't have nvm globally installed on the computer.
- Is the ddev BrowserSync addon required (https://github.com/ddev/ddev-browsersync), even if Radix states it comes with BrowserSync?
- Do any changed be done in the .ev.local or webpack.mix.js files ((like changing
process.env.DRUPAL_BASE_URLtoprocess.env.DDEV_HOSTNAMEas stated in https://github.com/ddev/ddev-browsersync#laravel-mix-configuration). - Did I (sure I did ;-) miss a step?
Comments
Comment #2
boinkster commentedThese were helpful to me:
https://kentrichards.net/blog/drupal-radix-sub-theme-browsersync-ddev
You might have to install lts/iron, check https://stackoverflow.com/questions/61918002/install-a-specific-node-ver...
I did a:
ddev nvm install v20Changing the directory to run the commands was confusing, so I created a custom DDEV command in .ddev/commands/web:
Comment #3
doxigo commentedThanks for sharing the solution and the great blog post, I myself haven't gotten around the ddev approach yet, I'll try to add this to the documentation as well
Comment #4
philyThanks @boinkster for sharing kentrichards.net blog post, 4 easy steps and it now works!
Comment #5
christopher.mcandrew commentedThanks guys, I've been having the same issue and appreciate the help!
Comment #6
doxigo commentedI personally couldn't get localhost:3000 to load with the approach above, but for now I created this page:
https://radix.trydrupal.com/radix/installation/setup-with-ddev
Please do a read and suggest any improvements you have in mind
Comment #7
doxigo commentedComment #8
danchadwick commentedClosing for lack of feedback / improvement suggestions to the documentation.