Skip to content

Support Async and ESM Plugins #5154

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

Closed
sxzz opened this issue Jan 30, 2025 · 1 comment
Closed

Support Async and ESM Plugins #5154

sxzz opened this issue Jan 30, 2025 · 1 comment

Comments

@sxzz
Copy link
Member

sxzz commented Jan 30, 2025

What problem does this feature solve?

@vue/language-tools now loads plugins using CJS require and enforces that plugins be in CJS format. Although node 22 supports require(ESM), it is still not fully supported in old versions.

Additionally, dynamically loading configurations (e.g., using importx / unconfig) for plugins remains unachievable.

Thus, supporting dynamic import and async plugins is necessary.

I guess we also need support from TypeScript team. Maybe we should have an issue on their repo?

What does the proposed solution look like?

export type VueLanguagePlugin = (ctx: ...) => Awaitable<Arrayable<VueLanguagePluginReturn>>;
@johnsoncodehk
Copy link
Member

Closed since this can be solved on plugin side using jiti.

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.

2 participants