Javascript 在ember cli中配置watchman
在我的ember cli应用程序.watchman配置文件中,我提到了观看时要忽略哪些目录,如Javascript 在ember cli中配置watchman,javascript,ember-cli,watchman,Javascript,Ember Cli,Watchman,在我的ember cli应用程序.watchman配置文件中,我提到了观看时要忽略哪些目录,如“ignore\u dirs”:[“tmp”]。现在我想在我的应用程序目录之外的目录中查看文件。有什么办法吗?如果您有一个名为my ember app的ember项目,其中的目录结构通常如下所示: my-ember-app .watchmanconfig -- app -- bower_components -- config -- dist -- node_modules -- publ
“ignore\u dirs”:[“tmp”]
。现在我想在我的应用程序目录之外的目录中查看文件。有什么办法吗?如果您有一个名为my ember app
的ember项目,其中的目录结构通常如下所示:
my-ember-app
.watchmanconfig
-- app
-- bower_components
-- config
-- dist
-- node_modules
-- public
-- tests
-- tmp
-- vendor
{
"ignore_dirs": ["tmp","public"]
}
如果您希望watchman不仅忽略tmp
中的更改,而且忽略兄弟文件夹public
中的更改,则您的.watchmanconfig
文件必须如下所示:
my-ember-app
.watchmanconfig
-- app
-- bower_components
-- config
-- dist
-- node_modules
-- public
-- tests
-- tmp
-- vendor
{
"ignore_dirs": ["tmp","public"]
}
您可以在中找到有关.watchmanconfig
文件的ignore\u dirs
选项值的更多信息
如果在您的设置中还没有工作,请确保 实际上安装了Watchman。 Ember CLI不附带现成的watchman,因此您必须另外安装它。如果在使用
ember-serve
启动您的余烬应用程序后,您的终端上显示此消息:
找不到watchman,正在返回NodeWatcher查找文件系统事件
上的Livereload服务器http://localhost:49152
服务于http://localhost:4200/
看守人还没有安装。
在OSX上,您可以使用自制软件安装Watchman:brew安装Watchman
,其他操作系统的安装说明可在中找到
编辑.watchmanconfig
,watchman不会自动获取.watchmanconfig
文件中的更改。要使新配置生效,请移动到ember项目的根目录
cd我的余烬应用程序
先把手表取下来
watchman watch del。
然后重新添加手表
守夜人守夜。
通过使用命令,您可以检查watchman是否正确识别了更改
watchman获取配置。
你有没有想过这个问题?你能澄清一下吗?据我所知,您希望在您的emberapp
文件夹之外观察更改,这意味着在项目的根级别上。例如,您的tmp
文件夹在.watchmanconfig
文件中已被忽略,该文件夹也位于项目的根级别。我是否正确理解,您想查看tmp
的其他同级文件夹中的更改,例如public
或tests
?@jessica是的,我想查看tmp的同级文件夹中的更改。