Open
Description
What problem does this feature solve?
Enabling custom cli plugins to extend pluginOptions with defaults or prompt answers.
Extending pluginPluginOptions with the generator api.extendPackage
will currently just replace instead off merge pluginOptions.
Current Config vue.config.js
{
lintOnSave: true,
pluginOptions: {
someOption: "Some option that was present"
}
}
Extending pluginOptions generator.js
api.extendPackage({
vue: {
pluginOptions: {
extraOption: "An extra option to be added"
}
}
})
In the resulting config vue.config.js
someOption was removed.
{
lintOnSave: true,
pluginOptions: {
extraOption: "An extra option to be added"
}
}
What does the proposed API look like?
generator.js
api.extendPluginOptions( (options) => {
options.extraOption = "An extra option to be added "
return options
})
Resulting config vue.config.js
{
lintOnSave: true,
pluginOptions: {
someOption: "Some option that was present"
extraOption: "An extra option to be added"
}
}