Skip to content

Commit f4355c7

Browse files
docs: add info about getting config in loaders (#2147)
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
1 parent dae4168 commit f4355c7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/guide/data-loading.md

+10
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,13 @@ export default defineLoader({
193193
}
194194
})
195195
```
196+
197+
## Configuration
198+
199+
To get the configuration information inside a loader, you can use some code like this:
200+
201+
```ts
202+
import type { SiteConfig } from 'vitepress'
203+
204+
const config: SiteConfig = (globalThis as any).VITEPRESS_CONFIG
205+
```

0 commit comments

Comments
 (0)