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
feat(kit): addBuildPlugin
for builder-agnostic implementation
#20587
Conversation
Β Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
if (pluginFactory.webpack) { | ||
addWebpackPlugin(pluginFactory.webpack, options) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea: This function would also check if current builder is supported or not and make a warning a build plugin is added without vite/webpack support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the idea. Also maybe provide verbose warning and suggestion in module building mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For module building (i guess testing is only possible) we could do if partial in either case too :)
π Linked issue
β Type of change
π Description
this adds a provider agnostic utility that can pass an object with keys (vite/webpack/rspack), each of which is a factory function for a plugin. This could be used to directly pass an
unplugin
, for example, and means that we can also 'upgrade' a module or integration if we + unplugin later support more builders (rspack
being a case-in-point). All we would do is call the (new) factory function, if it exists.π Checklist