Skip to content

Commit

Permalink
fix(addon support): setting the '_allPodStyles' on the host applicati…
Browse files Browse the repository at this point in the history
…on to hopefully avoid issues with multiple copys
  • Loading branch information
webark committed May 23, 2019
1 parent 26542a8 commit 7e00c02
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = {
return projectRoot;
},

_getEnvironment: function() {
_getHostApp: function() {
if (!this._findHost) {
this._findHost = function findHostShim() {
let current = this;
Expand All @@ -73,7 +73,11 @@ module.exports = {
};
}

return this._findHost().env;
return this._findHost();
},

_getEnvironment: function() {
return this._getHostApp().env;
},

included: function(app) {
Expand All @@ -86,6 +90,11 @@ module.exports = {
this.parent.treeForParentAddonStyles = this.treeForParentAddonStyles.bind(this);
}

var hostapp = this._getHostApp();
if (!hostapp._allPodStyles) {
hostapp._allPodStyles = [];
}
this._allPodStyles = hostapp._allPodStyles;
this.appConfig = app.project.config(this._getEnvironment());
this.addonConfig = this.appConfig['ember-component-css'] || {};
this.classicStyleDir = this.addonConfig.classicStyleDir || 'component-styles';
Expand Down

0 comments on commit 7e00c02

Please sign in to comment.