docs: add info about getting config in loaders (#2147)

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
pull/2160/head
John Campion Jr 2 years ago committed by GitHub
parent dae4168e18
commit f4355c7cd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -193,3 +193,13 @@ export default defineLoader({
}
})
```
## Configuration
To get the configuration information inside a loader, you can use some code like this:
```ts
import type { SiteConfig } from 'vitepress'
const config: SiteConfig = (globalThis as any).VITEPRESS_CONFIG
```

Loading…
Cancel
Save