我正在尝试学习 bower/grunt/requirejs 等工具,以加快我网站的开发过程并使我的代码更加模块化/高效。我目前正在关注 this tutorial .如何让 Bower 只为我的依赖项安装 dist 文件夹(在我的 component.json 文件中设置)而不是整个 Git 存储库?
最佳答案
您正在寻找的是bower.json
中的ignore 属性:https://github.com/bower/bower.json-spec
当通过 Bower 下载和安装模块时,模块的开发者可以使用 ignore 属性来排除文件。
如果您是上述模块的开发者,您可以使用ignore 属性排除除dist 文件夹之外的所有内容。
如果您不是模块的开发人员,那么您无能为力,您将获得模块开发人员认为重要的任何内容。在大多数情况下,这不是问题。
这是 ignore 属性的典型配置:
{
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"package.json",
"src"
]
}
关于javascript - 配置 Bower 以仅安装 dist 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28619210/