Skip to content

Commit

Permalink
Include resolverConfig on nested addons
Browse files Browse the repository at this point in the history
  • Loading branch information
ppcano committed Mar 8, 2019
1 parent 532ef05 commit 3762945
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ var VersionChecker = require('ember-cli-version-checker');
var path = require('path');
var isModuleUnification;

function mergeRecursivelyAddonResolverConfig(config, addon) {

if (!config.hasOwnProperty(addon.name)) {

if (addon.resolverConfig) {
config[addon.name] = addon.resolverConfig() || {};
}

addon.addons.forEach(nestedAddon => {
mergeRecursivelyAddonResolverConfig(config, nestedAddon);
});
}

}

module.exports = {
name: 'ember-resolver',

Expand Down Expand Up @@ -104,10 +119,9 @@ module.exports = {
_moduleUnificationTrees: function() {

let addonConfigs = {};

this.project.addons.forEach(addon => {
if (addon.resolverConfig) {
addonConfigs[addon.name] = addon.resolverConfig() || {};
}
mergeRecursivelyAddonResolverConfig(addonConfigs, addon);
});
this.validateAddonsConfig(addonConfigs);

Expand Down

0 comments on commit 3762945

Please sign in to comment.