Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwriting addon macro config not working #885

Closed
mydea opened this issue Jul 2, 2021 · 0 comments · Fixed by #888
Closed

Overwriting addon macro config not working #885

mydea opened this issue Jul 2, 2021 · 0 comments · Fixed by #888

Comments

@mydea
Copy link
Contributor

mydea commented Jul 2, 2021

I have an addon with a macro config like this:

module.exports = {
  name: require('./package').name,

    '@embroider/macros': {
      setOwnConfig: {
        mockUsername: 'jane@example.com',
      },
    },
  },
};

And an app using this addon with a config like this:

 '@embroider/macros': {
      setConfig: {
        'ember-cognito-identity': {
          mockUsername: 'john@fabscale.com',
          other: 'test here',
        },
      },
    },

Now if I do this in my addon:

console.log(getOwnConfig().mockUsername, getOwnConfig().other);

it will print out: "jane@example.com test here"

So it seems that any configuration from the addon itself takes precedence over configuration in the app, which I guess is not how this is supposed to work (at least that was my understanding)? If that is not how this is supposed to work (e.g. addon config should not be overwriteable), how would you go ahead providing default values for an addon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant