The included hook only runs once per instance of the addon in the dependency graph. The babel transforms we are adding, however, are meant to be added to each addon that includes this addon as a dependency, as well as the root app. Because each addon has it's own version of ember-cli-babel, we have to make sure it happens for each of them.
To do this, we use the init hook instead of the included hook, since it runs each time the addon is created. Unfortunately, the init hook does not have any way to access the root app - that is only provided in the included hook. So, we still need to use included for the case where this addon is being used in an actual app.
The included hook only runs once per instance of the addon in the dependency graph. The babel transforms we are adding, however, are meant to be added to each addon that includes this addon as a dependency, as well as the root app. Because each addon has it's own version of
ember-cli-babel
, we have to make sure it happens for each of them.To do this, we use the
init
hook instead of theincluded
hook, since it runs each time the addon is created. Unfortunately, theinit
hook does not have any way to access the root app - that is only provided in theincluded
hook. So, we still need to useincluded
for the case where this addon is being used in an actual app.