webpack --watch未编译已更改的文件 [英] webpack --watch isn't compiling changed files

查看:611
本文介绍了webpack --watch未编译已更改的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试运行 webpack --watch ,编辑完JS文件后,它不会触发自动重新编译。

I tried running webpack --watch and after editing my JS files, it doesn't trigger an auto-recompilation.

我尝试使用重新安装 webpack npm uninstall 但它仍然无法正常工作。

I've tried reinstalling webpack using npm uninstall but it's still not working.

任何想法?

推荐答案

FYI :似乎OS X可以让文件夹损坏,不再发送 fsevents watchpack / chokidar / Finder使用)用于自身和任何子文件夹。我无法确定这是发生在你身上的事情,但这对我和同事来说非常令人沮丧。

FYI: it seems OS X can have a folder get corrupted and no longer send fsevents (which watchpack/chokidar/Finder uses) for itself and any child folders. I can't be sure this is what happened to you, but it was very frustrating for me and a colleague.

我们能够重命名损坏的父文件夹然后观看事件立即按预期发布。有关详细信息,请参阅此博客文章: http: //feedback.livereload.com/knowledgebase/articles/86239-os-x-fsevents-bug-may-prevent-monitoring-of-certai

We were able to rename the corrupt parent folder and then watch events immediately came through as expected. See this blog post for more info: http://feedback.livereload.com/knowledgebase/articles/86239-os-x-fsevents-bug-may-prevent-monitoring-of-certai

以上链接的推荐修复:


  • 重新启动计算机

  • 检查磁盘并修复通过磁盘工具权限

  • 将文件夹添加到Spotlight隐私列表(未编制索引的文件夹列表),然后从中删除,有效地强制重建索引

  • 重命名文件夹,然后可能重命名

  • 重新创建文件夹并将旧内容移回其中

  • rebooting the computer
  • checking the disk and repairing permissions via Disk Utility
  • adding the folder to Spotlight privacy list (the list of folders to not index), and then removing from it, effectively forcing a reindexing
  • renaming the folder, and then possibly renaming it back
  • re-creating the folder and moving the old contents back into it

前两个对我们没有用,没有尝试Spotlight建议,重新创建并不是必要的。

First two did not work for us, didn't try the Spotlight suggestion, and the re-creation did not prove necessary.

我们可以通过打开找到根问题文件夹在每个连续的父文件夹中查找并创建文件,直到立即出现(因为Finder也会受到此错误的影响)。不更新的最根文件夹是罪魁祸首。我们只需 mv 'd it和 mv '它回到原来的名字,然后观察者工作。

We were able to find the root problem folder by opening Finder and creating files in each successive parent folder until one showed up immediately (since Finder will get hosed by this bug as well). The root-most folder that does not update is the culprit. We just mv'd it and mv'd it back to its original name, and then the watcher worked.

不知道导致腐败的原因,但我很高兴有解决办法。

No idea what causes the corruption, but I'm just glad to have a fix.

这篇关于webpack --watch未编译已更改的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆