Using two yeoman generators?
Asked Answered
D

1

14

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?

Destructor answered 4/12, 2013 at 1:58 Comment(0)
H
15

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.

Hoplite answered 4/12, 2013 at 5:33 Comment(4)
And is there no chance that generator-angular might get some kind of conflicting task with something like generator-bootstrap?Destructor
There is always a chance that generators might clash, it's worth noting that generally Yeoman tells you if it's over writing or updating files, and of course, you should have your code in git or some such so if there is a problem, you can roll back or compare what has changed.Oratorian
@Oratorian I've been playing around with it and feels like using generators together could be a little more elegant.Destructor
Sorry for reviving the old thread, but what happens in case package.json or gulpfile.js or bower.json conflicts? Yeoman asks to override or not but it won't do any merging whatsoever. What you do in this situation?Deannadeanne

© 2022 - 2024 — McMap. All rights reserved.