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

feat(generator): allow plugins to modify how configs are extracted #1130

Merged
merged 10 commits into from
Jul 11, 2018

Conversation

ascendancyy
Copy link
Contributor

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

* config object, whether to check for an existing config on disk, and the
* current context.
*/
addConfigTransform (key, configTransform) {
Copy link
Member

@yyx990803 yyx990803 Apr 26, 2018

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.

@pksunkara
Copy link
Contributor

This PR looks good. @yyx990803 Any update on this? The author has addressed your review comments.

@Akryum
Copy link
Member

Akryum commented Jul 11, 2018

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.)

@Akryum Akryum merged commit e393be7 into vuejs:dev Jul 11, 2018
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.

None yet

4 participants