[英]Configuring watchman in ember-cli
在我的ember-cli應用程序.watchman配置文件中,我提到了觀看時要忽略的目錄,例如"ignore_dirs": ["tmp"]
。 現在,我想查看應用程序目錄之外的目錄中的文件。 有什么辦法嗎?
如果您有一個名為my-ember-app
的燼項目,其中的目錄結構通常如下所示:
my-ember-app
.watchmanconfig
-- app
-- bower_components
-- config
-- dist
-- node_modules
-- public
-- tests
-- tmp
-- vendor
如果您想讓守望者不僅忽略tmp
更改,而且也忽略同級文件夾public
中的更改,則您的.watchmanconfig
文件必須如下所示:
{
"ignore_dirs": ["tmp","public"]
}
您可以在文檔中找到有關.watchmanconfig
文件的ignore_dirs
選項值的更多信息。
如果您的設置尚無法使用,請確保
Ember CLI並沒有附帶watchman,因此您將不得不額外安裝它。 如果您注意到使用ember serve
旋轉了ember應用程序后,該消息就會在終端中顯示:
Could not find watchman, falling back to NodeWatcher for file system events Livereload server on http://localhost:49152 Serving on http://localhost:4200/
watchman尚未安裝。 在OSX上,您可以使用Homebrew安裝Watchman: brew install watchman
和其他OS的安裝說明可以在Watchman文檔中找到。
.watchmanconfig
之后,將刪除並讀取項目的手表。 如文檔中所述 , .watchmanconfig
自動.watchmanconfig
文件中的更改。 為了使新配置生效,請移至ember項目的根目錄
cd my-ember-app
首先取下手表
watchman watch-del .
然后重新添加手表
watchman watch .
您可以使用watchman get-config .
命令來檢查watchman是否正確識別了更改watchman get-config .
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.