Using two yeoman generators?

2019-06-15 07:28发布

问题:

Is it possible to use two generators on one project with yeoman?

For example: I want to use the angular-generator but also want to use another generator, whether it be custom or one of the bootstrap generators.

I know you can add dependencies through bower, but that doesn't add anything to my workflow(e.g. compiling less), does it?

回答1:

Yes, it is not only possible, but common. Example: When you use JS-MV* generator in the project (generator-angular for instance) you will probably use generators responsible for other stuff, such as generator-travis-ci, generator-heroku.

Using two generators dedicated to two different JS-MV* frameworks ? NO. It makes no sense.
Yo can do it physically, for instance running generator-ember and generator-angular consequently in the same dir will result in angular's one trying to overwrite files generated previously by generator-ember.

As for the second question changing the workflow is basically changing the Gruntfile. It can be done by generators or by you, manually.