Bower应该自动包含库js和css文件吗;不需要在index.html中列出

Should Bower automatically include library js and css files so they don't need to be listed in the index.html

本文关键字:不需要 index html 文件 包含库 css js Bower      更新时间:2023-09-26

我可能误解了Bower的用法。我有一个离子项目,在www/lib文件夹中添加了一些Bower添加的库。我必须在我的index.html.中明确地包含js文件

我以为拥有bower文件应该自动为你做到这一点。事实并非如此吗?

不,bower是一个依赖库。

该库只读取您的依赖项,查找最佳版本(给定您在bower.json中的semver配置和依赖项配置),并在您各自的根文件夹或bower_components中下载(默认情况下)。

您正在寻找的方法可以通过像Wiredep这样的库来完成,它读取您的依赖关系树,并将所有库插入您所说的文件中。并且可以与咕哝或吞咽构建过程一起使用。