Allow Addons to Add Icons to the Build #91
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of relying on the app to discover and include needed icons, this
allows each addon to register their needs in
config/icons.js
and they will bepicked up by the app and added to the final build.
Hoping for feedback on the file location and the format before I write any docs. Addons would supply icons as a module:
I've elected to wrap it in a function in case we want to provide arguments in the future. Other addons like ember-intl consolidate configuration like this and I think it is a good pattern here.
Another option I considered would be to read any icon configuration in the addon
config/environment.js
and bundle it into the app, butember-cli
currently does a shallow merge of those options into the app which wouldn't include combining theicons
options together. I feel like having our own configuration file is actually a bit less surprising than having a single option in the addonsenvironment.js
file which is magically merged into the app configuration.Steps after this is complete would include:
icons
option in theenvironment.js
of apps and addonsicons.js
file (or maybe both!)