diff --git a/.vitepress/theme/index.js b/.vitepress/theme/index.js index 29786f8f..78d93930 100644 --- a/.vitepress/theme/index.js +++ b/.vitepress/theme/index.js @@ -1,12 +1,14 @@ -import DefaultTheme from 'vitepress/theme'; -import '../../style.scss'; -import VPBadge from 'vitepress/dist/client/theme-default/components/VPBadge.vue'; +import DefaultTheme from "vitepress/theme"; +import "../../style.scss"; +import VPBadge from "vitepress/dist/client/theme-default/components/VPBadge.vue"; const theme = { ...DefaultTheme, enhanceApp: (ctx) => { const { app } = ctx; - app.component('Badge', VPBadge); - window.WhaleDocs = ctx; + app.component("Badge", VPBadge); + if (typeof window !== "undefined") { + window.WhaleDocs = ctx; } -} + }, +}; export default theme;