在AngularJS应用程序中,可以引用bower和node文件夹中的文件吗?

我目前正在做我的第一个AngularJS应用程序,我的目录是这样设置的

app/ assets/ <css, js, images etc...> bower_components/ <various bower things> components/ <controllers, directives etc. in sub folder components> partials/ app-controller.js app.css index-async.html index.html node_modules/ <various node things> test/ <karma> bower.json package.json 

我很困惑,如何凉亭/节点包适合这个等式。 我使用angular-seed git repo开始了这个项目,并且修改了结构以匹配谷歌的最佳实践结构。

Angular种子项目通过使用“bower_components / component”引用html中的文件,但是在.gitignore文件中忽略了bower_components文件夹。 如果bower_components和node组件文件夹被忽略,那么如果它们不应该与最终产品一起使用,那么在html中引用这些文件夹会不好呢?

这是因为命令bower install将根据bower.json文件中列出的内容将项目的所有依赖项安装到该目录中。

没有必要检查你的git bower.json中的依赖关系,只需要检查bower.json

使用bower安装新包时,可以将-s标志添加到命令中,以将新包保存到bower.json文件中。 bower install -S <package>

通常GruntGulp已经build立了任务,在您构build项目时为您运行bower install命令。

不要在客户端应用程序的node_modules文件夹中引用库,只能在服务器端引用。

但是node_modules也是node_modules ,文件夹应该被git忽略,但是一定要检查你的packages.json文件,它是npm's节点包pipe理器bower.json等价的。