diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index b680ece5..1e33b596 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,3 +1,5 @@ +import type { UserConfig } from 'vitepress' + export default { lang: 'en-US', title: 'VitePress', @@ -41,7 +43,7 @@ export default { '/': getGuideSidebar() } } -} +} as UserConfig function getGuideSidebar() { return [ diff --git a/docs/guide/configuration.md b/docs/guide/configuration.md index 7dc8d1e0..08c5b42b 100644 --- a/docs/guide/configuration.md +++ b/docs/guide/configuration.md @@ -20,4 +20,15 @@ module.exports = { } ``` +If you are using TypeScript, you can use `.vitepress/config.ts` instead to get better types hint for VitePress Config. + +```ts +import type { UserConfig } from 'vitepress' + +export default { + title: 'Hello VitePress', + description: 'Just playing around.' +} as UserConfig +``` + Check out the [Config Reference](/config/basics) for a full list of options.