-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
Description
Is your feature request related to a problem? Please describe.
With Vite, I can access the --mode
flag with:
import { loadEnv, defineConfig } from 'vite'
export default ({ mode }) => {
return defineConfig({
titleTemplate: mode,
})
}
With Vitepress, however, this does not seem to be possible, since this command always results in mode == "development"
:
vitepress dev docs --mode foo
Describe the solution you'd like
Executing this command:
vitepress dev docs --mode foo
Should make this code pass:
import { loadEnv, defineConfig } from 'vitepress'
export default ({ mode }) => {
if (mode != "foo") {
throw new Error(mode);
}
return defineConfig({
titleTemplate: mode,
})
}
Describe alternatives you've considered
Haven't found a suitable alternative. Are there any?
Additional context
No response
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.