Skip to content

Support --config options in Vitepress cli #5200

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions