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.

Comments

phily created an issue. See original summary.

boinkster’s picture

These 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 v20

Changing the directory to run the commands was confusing, so I created a custom DDEV command in .ddev/commands/web:

#!/bin/bash

## Description: NK Custom for Radix 6: Installs nvm version and frontier_radix stuff
## Usage: h2m_rdx_rw
## Example: ddev h2m_rdx_rw

GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m\n' # set no color and line end

printf "${GREEN}Launching npm install inside ddev${NC}"

cd web/themes/custom/your-radix-subtheme

nvm alias default `cat .nvmrc`

#nvm alias default lts/iron

npm run watch
doxigo’s picture

Thanks 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

phily’s picture

Thanks @boinkster for sharing kentrichards.net blog post, 4 easy steps and it now works!

christopher.mcandrew’s picture

Thanks guys, I've been having the same issue and appreciate the help!

doxigo’s picture

I 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

doxigo’s picture

Status: Active » Needs work
danchadwick’s picture

Status: Needs work » Fixed

Closing for lack of feedback / improvement suggestions to the documentation.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.