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

support async configResolved hook in plugins #2949

Closed
dominikg opened this issue Apr 11, 2021 · 0 comments · Fixed by #2951
Closed

support async configResolved hook in plugins #2949

dominikg opened this issue Apr 11, 2021 · 0 comments · Fixed by #2951
Labels
enhancement: pending triage p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@dominikg
Copy link
Contributor

dominikg commented Apr 11, 2021

Clear and concise description of the problem

Plugins may want to do asynchronous setup based on information available from the configResolved hook.

usecase for me: reading svelte config with dynamic import sveltejs/vite-plugin-svelte#29

I'm willing to provide a PR with the needed changes.

Suggested solution

Make configResolved async and await the on the calls.

Alternative

Plugins could try to work around this by adding special handling to the first call of transform but that feels wrong.

Additional context

config hook has been made async recently: #2798 but it has less information available.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement: pending triage p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants