Skip to content

Commit

Permalink
docs: note about add pre-loaded languages for vitepress
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 22, 2025
1 parent 871c5f6 commit 5d2e27b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/packages/vitepress.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ npm i -D @shikijs/vitepress-twoslash

In your [`.vitepress/config.ts`](https://vitepress.dev/reference/site-config):

```ts twoslash
```ts
// .vitepress/config.ts
import { transformerTwoslash } from '@shikijs/vitepress-twoslash' // [!code hl]
import { defineConfig } from 'vitepress'
Expand All @@ -31,7 +31,10 @@ export default defineConfig({
markdown: {
codeTransformers: [
transformerTwoslash() // [!code hl]
]
],
// [!code hl:2]
// Explicitly load these languages for types hightlighting
languages: ['js', 'jsx', 'ts', 'tsx',]
}
})
```
Expand Down

0 comments on commit 5d2e27b

Please sign in to comment.