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 and ESM Plugins #5154

Open
sxzz opened this issue Jan 30, 2025 · 0 comments
Open

Support Async and ESM Plugins #5154

sxzz opened this issue Jan 30, 2025 · 0 comments

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>>;
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

No branches or pull requests

1 participant