Browser-sync in mobile while local development

前端 未结 3 2127
广开言路
广开言路 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:53

    Thanks to @Kwesi for sharing above. In my case, setting tunnel:true alone didn't work until I also added online:true. Here's my sample code - worked fine on both computer and mobile device.

    browserSync.init({
        server: {
          baseDir: "app"
        },
        online: true,
        tunnel: true,
        logLevel: "debug"
      });
    

提交回复
热议问题