Intuition
When you have the browser-sync running on http://localhost:3000
in radix sync after running npm run watch
, attempt of shareing the http://localhost:3000
via ngrok http https://localhost:3000
seems to succeed, but does not will not have browser-sync enabled:
Resolution
To resolve this, we will need to add a environmental variable in the .evn.local
file and add a variable pointing to the domain of your ngrok. (First run ngrok as you would usually do to get the URL)
|
|
|
|
Then amend your webpack.mix.js
file:
|
|
And re-run npm run watch
as you normally do, and the browser-sync will now work as expected: (but now the localhost:3000
will now longer have the browser-sync anymore)
Reference
- Laravel Mix, Browersync and ngrok playing happily….. (link)