How do I get gulp + browsersync to work an apache vhost?

南笙酒味 提交于 2019-12-04 05:39:05

If you have installed apache (sample with mamp) you must configure the port at 8080

My config:

 browserSync.init({
      open: 'external',
      host: 'local.dev',
      proxy: 'local.dev',
      port: 8080 // for work mamp
});

BrowserSync "proxy" options should be pointing to where your apache host is serving your app, not where you want to access it.

For example, if I'm running a ruby server on localhost:9000 I would point that in proxy option and access via browser through the url that browsersync will output to me via the commandline

use this instead, add vhost e.g. mysite.local

then

gulp.task('server', function() {
     browserSync.init({
        proxy: "mysite.local"
    });
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!