Skip to content

Allow 3rd party plugins to extend configTransforms #1076

@ascendancyy

Description

@ascendancyy

What problem does this feature solve?

Currently only official plugins can respect the useConfigFiles option when creating a project when defined in a preset (or manual mode). Right now 3rd party plugins have the option of making use of extendPackage or using render to write out the file manually. This would mostly be for 3rd party plugins to use extendPackage and not worry about where the config ends up.

What does the proposed API look like?

Adding a method like addConfigTransform(key, transform) to GeneratorAPI that adds transforms to an object on the Generator instance of the GeneratorAPI. Then when extractConfigFiles is eventually called the transforms can be resolved to Object.assign({}, configTransforms, this.configTransforms). It'd be simple enough to prevent adding transforms for something like the vue config (or maybe all of the defaults).

Would this be viable?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions