Skip to content

feat(language-core): place plugin configs under ctx.config and support type annotation via generics#5944

Merged
KazariEX merged 2 commits intovuejs:masterfrom
KazariEX:feat/typed-plugin-config
Jan 25, 2026
Merged

feat(language-core): place plugin configs under ctx.config and support type annotation via generics#5944
KazariEX merged 2 commits intovuejs:masterfrom
KazariEX:feat/typed-plugin-config

Conversation

@KazariEX
Copy link
Copy Markdown
Member

try {
const moduleConfig = (plugin as any).__moduleConfig ?? {};
const instance = plugin({ ...pluginContext, ...moduleConfig });
const instance = plugin({ ...pluginContext, config: moduleConfig });
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you wanted a second argument. Not that it changes much in the end

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this because the TS plugin follows the same approach (putting the config under info.config).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!

@KazariEX KazariEX merged commit b2d5e31 into vuejs:master Jan 25, 2026
4 checks passed
@KazariEX KazariEX deleted the feat/typed-plugin-config branch January 25, 2026 04:44
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 this pull request may close these issues.

2 participants