-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
buildRelated to the build systemRelated to the build systemcontribution welcomeThe team would welcome a contribution from the community for this issueThe team would welcome a contribution from the community for this issue
Description
Is your feature request related to a problem? Please describe.
I'm trying to create two plugins, which extends markdown feature.
And I'm trying to merge those two and my config, using extends
like { extends: { extends: myPlugin1, ...myPlugin2 }, ...myPlugin3 }
.
But I noticed that this solution does not work well because myPlugin1's markdown.config
is replaced with myPlugin2's markdown.config
.
Describe the solution you'd like
Merge markdown.config
properly.
I'm using this mergeConfigs
helper for now:
function mergeConfigs(
...configs: Omit<UserConfig<DefaultTheme.Config>, "extends">[]
): UserConfig<DefaultTheme.Config> {
return configs.slice(1).reduce((merged, config) => {
return {
...config,
markdown: {
config(md) {
merged.markdown?.config?.(md);
config.markdown?.config?.(md);
},
},
extends: merged,
};
}, configs[0]);
}
Describe alternatives you've considered
None.
Additional context
Also it would be good if there's mergeConfigs
by default.
Validations
- Follow our Code of Conduct
- Read the docs.
- Read the Contributing Guidelines.
- Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
buildRelated to the build systemRelated to the build systemcontribution welcomeThe team would welcome a contribution from the community for this issueThe team would welcome a contribution from the community for this issue