在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>
通常Grunt
或Gulp
已经build立了任务,在您构build项目时为您运行bower install
命令。
但不要在客户端应用程序的node_modules
文件夹中引用库,只能在服务器端引用。
但是node_modules
也是node_modules
,文件夹应该被git忽略,但是一定要检查你的packages.json
文件,它是npm's
( 节点包pipe理器 ) bower.json
等价的。
- 使用$ routeProvider是否节省networking带宽?
- Angular-cli未能正确安装
- http-proxy-middleware:无法将localhost:9000redirect到本地主机:8888从nodejs到JettY
- 无法使用angular-seed github项目的nodejs命令行运行http-server
- 如何在AngularJS客户端和Node.js服务器之间重新使用代码
- 如何禁用moment.js日光时区转换
- 命令:离子构buildandroid是给错误
- AngularJS + ServiceStack + Node.js作为代理?
- 当我使用AngularJS $ routeProvider的时候,Node.js页面转换不再起作用