From cc491d10c38830c32d5c85f98a55fe9df9856cd6 Mon Sep 17 00:00:00 2001 From: Jiangyue Zhu Date: Fri, 21 Apr 2017 16:20:07 -0700 Subject: [PATCH] Fix 'this.app' undefined when consumer app is an addon --- index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.js b/index.js index 9049ee2..7a776dd 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,19 @@ var MergeTrees = require('broccoli-merge-trees'); module.exports = { name: 'ember-cli-svgstore', + included: function(app, parentAddon) { + // Ensures that imports work for nested addons and engines + // @see: https://github.com/ember-cli/ember-cli/issues/3718 + + let target = parentAddon || app; + + if (target.app) { + target = target.app; + } + + this.app = target; + }, + options: function() { return this._options = this._options || merge(true, {}, { files: []