Yo 和 Bower 在功能方面是否重叠,如果重叠,使用两者是否有优势?

Do Yo and Bower overlap in terms of functionality, and if they do is there an advantage to using both?

我使用 Gulp 有一段时间了,最​​近开始使用 Bower。我现在正在研究是否也应该使用 Yo 作为脚手架,但我不清楚 Yo 的确切用途。我很困惑,因为当 Yo 创建一个应用程序时,它似乎安装了我通常使用 Bower 安装的东西。

所以我的问题是:

1) Yo 实际上是在使用 Bower 安装这些东西还是它自己安装,如果是这样它是否也处理更新?

2) 如果可以,是否可以构建一个 Gulp 任务来做 Yo 正在做的事情?

首先,什么是Yeoman

What's Yeoman?

Yeoman helps you to kickstart new projects, prescribing best practices and tools to help you stay productive.

To do so, we provide a generator ecosystem. A generator is basically a plugin that can be run with the yo command to scaffold complete projects or useful parts.

关于您的问题:

  1. Yeoman 使用 Bower:

    The Yeoman workflow comprises three types of tools for improving your productivity and satisfaction when building a web app: the scaffolding tool (yo), the build tool (Grunt, Gulp, etc) and the package manager (like Bower and npm).

  2. Yeoman 的目标不同于 Grunt 或 Gulp。它无意替代 gulp 或 grunt,而是为了让它们易于使用。所以我会说 是的,可以 创建一个创建脚手架的 gulp 任务,但我强烈建议你不要这样做。不要重新发明轮子,很多人已经制作了许多 Yeoman 生成器来帮助处理几乎所有与网络相关的事情。

Yeoman 对于开始一个新项目非常有用。如果您不了解该技术并且希望获得有关项目脚手架的帮助,则更多。有很多例子,比如 Chrome Extension generator, an Angular generator, a Firefox Extension generator and many more.