From 5542f295698356ae57ecc360ea3e64de853bca68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Sat, 21 Oct 2023 18:53:56 +0200 Subject: [PATCH] docs: update types for theme config (#3118) * docs: update types for theme config --- docs/guide/extending-default-theme.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/guide/extending-default-theme.md b/docs/guide/extending-default-theme.md index 5aa6fadb..e58981bf 100644 --- a/docs/guide/extending-default-theme.md +++ b/docs/guide/extending-default-theme.md @@ -115,12 +115,10 @@ import type { Theme } from 'vitepress' import DefaultTheme from 'vitepress/theme' export default { - // ... + extends: DefaultTheme, async enhanceApp({ app }) { - if (!import.meta.env.SSR) { - const plugin = await import('plugin-that-access-window-on-import') - app.use(plugin) - } + // register your custom global components + ctx.app.component('MyGlobalComponent' /* ... */) } } satisfies Theme ```