Angularjs 在angular 2中禁用BrowserSync

Angularjs 在angular 2中禁用BrowserSync,angularjs,node.js,browser-sync,Angularjs,Node.js,Browser Sync,我使用Node作为服务器。我发现BrowserSync使用了100%的CPU。我想禁用它。我搜索了很多,但什么也没找到。您需要删除gulp配置文件(通常在gulp/server.js中)或您使用的任何任务管理器中所有与browserSync相关的代码: gulp.task('serve', ['watch'], function () { // find and remove this or similar: browserSyncInit([path.join(conf.paths.t

我使用Node作为服务器。我发现BrowserSync使用了100%的CPU。我想禁用它。我搜索了很多,但什么也没找到。

您需要删除gulp配置文件(通常在gulp/server.js中)或您使用的任何任务管理器中所有与browserSync相关的代码:

gulp.task('serve', ['watch'], function () {
  // find and remove this or similar:
  browserSyncInit([path.join(conf.paths.tmp, '/serve'), conf.paths.src]);
});

在项目文件夹中搜索
browserSync.init
或只搜索
browserSync
以查找相应的文件。

我找到了答案。我发现问题出在崇高。每次进行更改时,sublime都会使用大量资源将Typescript转换为JavaScript。所以我改用了“VisualStudio代码”。这解决了我的问题,现在我不需要禁用BrowserSync。

我找不到任何东西。你能给出一个绝对路径吗?@JohnSparrow绝对路径因系统而异。你正在使用什么应用程序构建框架(“angular2种子”,等等)?我正在使用angular2种子文件:\tools\utils\seed\server.ts;注释掉行“codeChangeTool.listen();”和“codeChangeTool.changed(fileName);”@JohnSparrow或:\tools\utils\seed\code\u change\u tools.ts,注释掉行:“browserSync.init(GetPlugInFig('browser-sync'));”和“browserSync.reload(files);”。这并没有回答问题。。。如果有人能在这里找到正确的答案。