-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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(generator): allow plugins to modify how configs are extracted #1130
Conversation
* config object, whether to check for an existing config on disk, and the | ||
* current context. | ||
*/ | ||
addConfigTransform (key, configTransform) { |
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 think the current API would be a bit difficult to use as the plugin author would have to reimplement makeXXXTransform
or require vue-cli internals (risks breaking).
The second argument could also accept an object in the form of
{
file: '.baberc.js',
type: 'js|json|multi'
}
In this case we can create a transform function based on this information.
Allow plugin author to set config 'descriptions' instead of implementing their own transform functions.
This PR looks good. @yyx990803 Any update on this? The author has addressed your review comments. |
I have merged dev and refactored config transforms to a more flexible system similar to the one used by the ui. (Will eventually merge the two systems.) |
This would help plugin developers that are working on plugins for libraries/framerworks/etc that can be configured in multiple places (a field in package.json, multiple files). Or users that want to create a personal plugin that they can add to a preset to quickly setup a project in the case that they would prefer a different configuration file type over the defaults (eg.
.babelrc.js
over.babelrc
).Related: #994
Closes: #1076