Skip to content

Support --config options in Vitepress cliΒ #5200

@cocoich

Description

@cocoich

Is your feature request related to a problem? Please describe.

I need to deploy different outputs from the same source for multiple environments.
In my project, I maintain about 4 VitePress config files:

  • .vitepress/config.base.mts
  • .vitepress/config.prd.mts (mergeConfig with config.base.mts)
  • .vitepress/config.dev.mts (mergeConfig with config.base.mts)
  • .vitepress/config.prd-c.mts

Currently, in CI, I overwrite config files before running VitePress commands with ~10 lines of script.
This works, but it is fragile and hard to maintain.

Describe the solution you'd like

Please support a CLI option to specify a config file path, for example:

  • vitepress dev --config .vitepress/config.dev.mts
  • vitepress build --config .vitepress/config.prd.mts
  • vitepress build --config .vitepress/config.prd-c.mts

This would remove the need for file overwrite steps in CI and make multi-environment workflows much simpler and safer.

Describe alternatives you've considered

  • Overwriting .vitepress/config.mts in CI before each build process
  • Keeping modified .vitepress/config.mts in another branch (worst)

Additional context

currently using vitepress@2.0.0-alpha.17

Found related:

Im not good at English, Describes translated by AI πŸ™πŸ»

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions