Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the difference between index.js and ember-cli-build.js in an Addon #85

Closed
mansona opened this issue Jan 15, 2019 · 1 comment · Fixed by #112
Closed

Document the difference between index.js and ember-cli-build.js in an Addon #85

mansona opened this issue Jan 15, 2019 · 1 comment · Fixed by #112
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mansona
Copy link
Member

mansona commented Jan 15, 2019

I recently got a question in the Ember Community Discord:

can someone explain to me what the difference between index.js and ember-cli-build.js in an addon is?

And here was my answer:

the index.js is the "entry point" for your addon and is where you add hooks if you're doing something intermediate or advanced with your addon. the ember-cli-build.js inside your addon is only used to build the dummy app when developing it locally and has no influence on what happens to the consuming app

It seems to me that as we have been training people that the ember-cli-build.js is the "entry point" to an Ember App it is likely that we will confuse people when they look at an addon. I assume we might be able to add a note to https://cli.emberjs.com/release/writing-addons/#addonfilestructure or somewhere that is explicit about the difference?

@mansona mansona added help wanted Extra attention is needed good first issue Good for newcomers labels Jan 15, 2019
@llunn
Copy link
Contributor

llunn commented Apr 19, 2019

@mansona I can do this; but beforehand, the ember-cli-build.js file for an addon contains the comment:

/*
   This build file specifies the options for the dummy test app of this
   addon, located in `/tests/dummy`
   This build file does *not* influence how the addon or the app using it
   behave. You most likely want to be modifying `./index.js` or app's build file
 */

Can you clarify the meaning of app's build file? Is this the ember-cli-build.js file for the consuming application of the addon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants