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

Async API / Support loading config from ESM #6

Closed
coreyfarrell opened this issue Sep 28, 2019 · 0 comments · Fixed by #7
Closed

Async API / Support loading config from ESM #6

coreyfarrell opened this issue Sep 28, 2019 · 0 comments · Fixed by #7

Comments

@coreyfarrell
Copy link
Member

The loadConfig function needs to become async. This will not be an issue for nyc since the main process will run this before anything else happens and we never load config during exit handlers. The reason for this is that we will need to support loading ESM from nyc.config.js, and that is async.

This will initially be difficult to support from babel-plugin-istanbul. For now when the babel plugin needs to load config from disk we'll need to execSync a script that loads and dumps the config. Eventually we'll be able to create an async pre in the plugin but that will depend on babel/babel#10507 and I'm sure at least one follow-up. It's likely off-nominal for our babel plugin to load config from disk, normally it's run under nyc where process.env.NYC_CONFIG is set and used by the babel plugin.

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