From 7e00c026be499e58b2c4dd1e3c0f424048b8b7a0 Mon Sep 17 00:00:00 2001 From: Mark David Avery Date: Wed, 22 May 2019 17:34:12 -0700 Subject: [PATCH] fix(addon support): setting the '_allPodStyles' on the host application to hopefully avoid issues with multiple copys --- index.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a8c59d9..1cecfa7 100644 --- a/index.js +++ b/index.js @@ -61,7 +61,7 @@ module.exports = { return projectRoot; }, - _getEnvironment: function() { + _getHostApp: function() { if (!this._findHost) { this._findHost = function findHostShim() { let current = this; @@ -73,7 +73,11 @@ module.exports = { }; } - return this._findHost().env; + return this._findHost(); + }, + + _getEnvironment: function() { + return this._getHostApp().env; }, included: function(app) { @@ -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';