-
Notifications
You must be signed in to change notification settings - Fork 12
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
synchronous loadConfig #146
Comments
Thanks for the feedback! I believe that this would be something solved by https://v8.dev/features/top-level-await This is available in Node 14+, when using a Unfortunately, this isn't possible to do with a |
Further - our v1 actually had |
@DetachHead does this solve your use case? |
i tried updating our project to esmodules, but wasn't able to get it working with jest. seems their support for esmodules is experimental and it wouldn't work no matter what i tried. |
Hm, yeah the Node ecosystem will still take a while to get there 100%. Is https://app-config.dev/guide/testing/jest.html enough? It might require duplication unfortunately, but it's the best way I know of at the moment. |
Yeah mocking it worked for our use case, though as mentioned in #100 that's not really ideal |
Okay, thanks for the feedback! I agree with the conclusion there, wanted to make sure there wasn't an issue I could help with more quickly. Moved this feature request to #152 |
it would be great if you could load the config without requiring an IIFE and a call to the
loadConfig
function at runtime.something like
node -r app-config/register
for example.The text was updated successfully, but these errors were encountered: