Any recommended way to generate files inside in repo addons and engines?


#1

Any recommended way to generate (ember g) files inside in repo addons and engines?


#2

As of ember-cli@3.7 and higher the generate command includes an --in flag that allows you to specify the directory to generate into.

For example, given an in-repo addon at lib/my-foo/:

ember generate component awesome-sauce --in ./lib/foo

Will generate something like this list of files (can’t verify ATM since I’m on mobile):

lib/foo/addon/components/awesome-sauce.js
lib/foo/addon/templates/components/awesome-sauce.js
lib/foo/app/components/awesome-sauce.js
tests/integration/components/awesome-sauce-test.js

#3

That’s great. I just tested in my app and it works perfectly. Thanks for the fast response @rwjblue