mansona / ember-get-config

Get `config/environment` from anywhere, even addons!!!
MIT License
65 stars 20 forks source link

Use `require` to retrieve the app's config #45

Closed Windvis closed 2 years ago

Windvis commented 2 years ago

This uses loader.js's require function to retrieve the app's environment config. This bypasses the importSync dependency checking that happens in Embroider builds which causes the build to fail since the dependency doesn't exist in the addon.

I included the commits of #42, #43 and #44 so that I could test it still works under all those new tests. I'll rebase after those are merged.

jrjohnson commented 2 years ago

I'm seeing a build warning:

WARNING: The 'package.json' file for the addon at APP/node_modules/@fortawesome/ember-fontawesome/node_modules/ember-get-config specifies an invalid, malformed or missing addon at relative path 'lib/baz'

Which looks to be caused by this change.

bertdeblock commented 2 years ago

Made https://github.com/mansona/ember-get-config/pull/49 to resolve the warning.