本文介绍了BrowserSync 非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很想使用 BrowserSync 进行开发.但是,页面加载(不仅是在更改后重新加载)非常慢.

I would love to use BrowserSync for development. However, page loading (not only reloading after changes) is extremely slow.

我使用 proxy 模式.在没有 BrowserSync 的情况下浏览页面应该很快.

I use the proxy mode. Browsing the page without BrowserSync is fast as it should be.

一个原因可能是我安装 BrowserSync 时出现以下错误:

One reason may be the following error when I install BrowserSync:

> [email protected] install /usr/local/lib/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
SOLINK_MODULE(target) Release/bufferutil.node: Finished
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
SOLINK_MODULE(target) Release/validation.node: Finished

我从头开始安装节点(使用 brew 和包安装程序),但无法摆脱错误.

I installed node from scratch (using brew and the package installer), but couldn't get rid of the error.

此外,BrowserSync 是使用 Gulp 运行还是通过命令行运行也没有什么区别.

Furthermore, it doesn't make a difference if BrowserSync is run using Gulp or over the command line.

有什么想法吗?

推荐答案

解决方案很简单 - 但恕我直言不合逻辑.我的本地实例在 http://project.local 下运行.将其更改为 http://project.dev 解决了这个问题.我正在运行 OS X.

The solution is quite simple - but illogical imho. I had my local instance running under http://project.local. Changing it to http://project.dev solved the issue. I'm running OS X.

这篇关于BrowserSync 非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-15 12:14