Add compat adapter for ember-get-config
#770
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been struggling to get
ember-get-config
to work with the Vite packager due to the fact that it's desired behavior is to re-export a module from the host app.At @ef4's suggestion I totally replaced the original way of doing this with a new approach that is Embroider-compatible. We can look up the host app's config at build-time and serialize it into the module's
index.js
; this maintains the add-on's API without having the export from the host app.One drawback is that the
config/environment
contents are now serialized twice in the payload, but I don't think that's necessarily a huge deal.One other approach I had tried was using the
setOwnConfig
/getOwnConfig
API from themacros
package butoptions
getter and added the@embroider/macros
property butgetOwnConfig
introduced into the module'sindex.js
would returnundefined