Browser-sync in mobile while local development

前端 未结 3 2117
广开言路
广开言路 2021-02-09 14:40

How can I view my local dev website in my phone using gulp Browser-sync? I type localhost:3000 in my phones browser but it won\'t load

3条回答
  •  甜味超标
    2021-02-09 14:50

    I know this is old, but the above option didn't work for me, and I'm running windows 10. I eventually found a solution using the tunnel option which is completely hassle-free.

    For instance, setting as an option tunnel: true will generate a random public URL each time you run BrowserSync: e.g. http://randomstring23232.localtunnel.me

    However, you can set a preferred tunnel name by passing it as a string to the tunnel option, i.e. tunnel: 'preferredtunnelname', which will reproduce: https://preferredtunnelname.localtunnel.me

    References here: https://github.com/BrowserSync/browser-sync/issues/390 and https://browsersync.io/docs/options/#option-tunnel

提交回复
热议问题