Skip to content

Commit c68f23d

Browse files
docs: fix async config example (#3500)
1 parent 5811b62 commit c68f23d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/reference/site-config.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ If you need to dynamically generate the config, you can also default export a fu
3131
```ts
3232
import { defineConfig } from 'vitepress'
3333

34-
export default async () => defineConfig({
35-
const posts = await (await fetch('https://my-cms.com/blog-posts')).json()
34+
export default async () => {
35+
const posts = await (await fetch('https://my-cms.com/blog-posts')).json()
3636

37-
return {
37+
return defineConfig({
3838
// app level config options
3939
lang: 'en-US',
4040
title: 'VitePress',
@@ -49,8 +49,8 @@ export default async () => defineConfig({
4949
}))
5050
]
5151
}
52-
}
53-
})
52+
})
53+
}
5454
```
5555

5656
You can also use top-level `await`. For example:

0 commit comments

Comments
 (0)