Is using browser sync with devUrl possible?

I’m often working on 2 or 3 sites at a time and the localhost domain makes things tricky for logins and the port number changes dep on how many are running.

Here is my assets/config.json

  "publicPath": "/wp-content/themes/wonkfest-2018-s9-test",
  "devUrl": "http://wonkfestdev.local",
  "proxyUrl": "http://localhost:3000",

When viewing the localhost browser window you can see borwsersync script links have been added and loaded. When i change a file the new css is pushed to the open localhost window.

But viewing wonkfestdev.local in a browser there is no request for the browsersync scripts.

wonkfestdev.local is the alias i’ve set in Mamp pro.

If i set the proxyUrl to http://wonkfestdev.local yarn start results in an error.

The proxyUrl cannot be the devUrl. If you want to have active Browsersync sessions going for multiple sites, then change the port number for each site. For example:

  • Site 1: localhost:3000
  • Site 2: localhost:4000
  • Site 3: localhost:5000

And as a sidenote, you may want to consider not using .local as your development TLD. Bonjour for Mac uses it. Alternatively, you can use .localhost or .test as they are reserved for this purpose.

1 Like

cool - & thanks for the .local tips too.

1 Like