Skip to content

Instantly share code, notes, and snippets.

@bcardarella
Created July 18, 2014 19:33
Show Gist options
  • Save bcardarella/cbf4049484159e6082af to your computer and use it in GitHub Desktop.
Save bcardarella/cbf4049484159e6082af to your computer and use it in GitHub Desktop.
addon compilation and project structure
|__addon
|__app

Anything put into app will be compiled into the project's application tree that the addon is being pulled into. These files can be overridden by similarly named files in the actual project. So:

my-addon/app/templates/people/index.hbs will be available to my app normally. But if I provide my own my-project/app/templates/people/index.hbs file compilation will prefer this template instead. The addon's template should be overridden in compilation and not part of the final my-project.js asset.

Anything put into addon will be compiled into the vendor tree namespaced under the addon's name. The AMD path would be: my-addon/views/people.js

This would promote complete isolation of the addon away from the parent project's tree. In the parent project you just import from the addon's namespace:

import PeopleView from 'my-addon/views/people';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment