\r\n\u003C/template>\r\n\r\n\u003Cscript setup>\r\n// import { useRoute } from \"vitepress\";\r\n// const route = useRoute();\r\n\u003C/script>\r\n```\r\n\r\n3. Create `docs/.vitepress/theme/index.js` with the following contents:\r\n\r\n```js\r\nimport Layout from \"./Layout.vue\";\r\n\r\nexport default {\r\n Layout,\r\n};\r\n```\r\n\r\n4. Run `yarn docs:dev` and open http://localhost:3000. Note the heading doesn't have any styles applied to it:\r\n\r\n\r\n\r\n5. Uncomment the lines in the `\u003Cscript setup>` section in `docs/.vitepress/theme/Layout.vue`. Note the heading now has the default styles applied to it, even though we only imported `useRoute`:\r\n\r\n\r\n\r\n**Expected behavior**\r\nThe heading should remain unstyled since we aren't explicitly importing any styles.\r\n\r\n**System Info**\r\n- vitepress version: v0.9.2\r\n- vite version: v1.0.0-rc.13\r\n- Node version: v12.20.0\r\n- OS version: macOS Catalina 10.15.7\r\n\r\n**Additional context**\r\nI had a quick look at the Vitepress code and it looks like the problem might be to do with this line: https://github.com/vuejs/vitepress/blob/309aa7a8d0e7ab08c1c9db258c74709a66b295cb/src/client/app/exports.ts#L29\r\n\r\nAdding the following to `docs/.vitepress/config.js`:\r\n\r\n```javascript\r\nmodule.exports = {\r\n alias: {\r\n \"/@default-theme/index\": \"/@theme/empty.js\",\r\n },\r\n};\r\n```\r\n\r\n...and creating an empty file `docs/.vitepress/theme/empty.js` prevents the default styles being applied.\r\n",[],182,"Importing default composables also imports default theme's styles","2023-01-21T16:23:59Z","https://github.com/vuejs/vitepress/issues/182",0.72309864,{"description":2915,"labels":2916,"number":2917,"owner":2871,"repository":2872,"state":2873,"title":2918,"updated_at":2919,"url":2920,"score":2921},"### Describe the bug\n\n\ni created a component with the following content\n```vue\n\u003Ctemplate>\n\u003Cspan>{{ name }}\u003C/span>\n\u003C/template>\n```\nwhen I use it after the title, the value of `name` will appear in the directory\n\n\n\nhow can I write it so that it acts like the \"Badge\" component and doesn't appear in the catalog?\n\n### Reproduction\n\n\u003Cimg width=\"397\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/b639d4bd-5f1f-42a8-b3f6-86e619cae028\" />\n\n\u003Cimg width=\"998\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/3f185339-dd13-443e-adb3-481337331a37\" />\n\nthis will not happen when using the Badge component:\n\n\u003Cimg width=\"467\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/dea1d53a-ec19-4142-a736-fc0b571e3d76\" />\n\n\u003Cimg width=\"1183\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/6916abdb-7106-4cb0-8e7d-27625a189287\" />\n\n\n\nexample: https://stackblitz.com/edit/vite-odjkgdaj\n\n### Expected behavior\n\nshould be like the `Badge` component\n\n### System Info\n\n```Text\nnone\n```\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [x] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [x] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [x] Read the [docs](https://vitepress.dev).\n- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[],4761,"directories should not read the contents of components","2025-05-25T17:54:49Z","https://github.com/vuejs/vitepress/issues/4761",0.72628874,{"description":2923,"labels":2924,"number":2926,"owner":2871,"repository":2872,"state":2873,"title":2927,"updated_at":2928,"url":2929,"score":2930},"### Describe the bug\n\nHey, \r\n\r\nIt's not a bug report, just a question.\r\n\r\nHow to install with a module who's use browser features (document.querySelectorAll) with `ctx.app.use()` on client side ? \r\n\r\nI can't find the way in the documentation. In VuePress, we can use the variable `__VUEPRESS_SSR__`, do you something similar in VitePress ? \r\n\r\nN.B: It's works fine with the dev serve but fail on build time\r\n\r\n## In VuePress\r\n\r\n`docs/.vuepress/client.ts`\r\n\r\n```ts\r\nimport { defineClientConfig } from '@vuepress/client'\r\nimport { clientModule } from 'lib'\r\n\r\nexport default defineClientConfig({\r\n enhance: async ({ app, router }) => {\r\n if (!__VUEPRESS_SSR__) {\r\n app.use(clientModule)\r\n }\r\n }\r\n})\r\n```\r\n\r\n## In VitePress \r\n\r\n`docs/.vitepress/theme/index.ts`\r\n\r\n```ts\r\nconst theme: typeof DefaultTheme = {\r\n ...DefaultTheme,\r\n enhanceApp({ app }) {\r\n app.use(clientModule) // It's doesn't works 😑\r\n },\r\n}\r\n```\r\n\r\n\n\n### Reproduction\n\n-\n\n### Expected behavior\n\nBe able to build the app with client\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 12.6.1\r\n CPU: (10) arm64 Apple M1 Pro\r\n Memory: 314.09 MB / 16.00 GB\r\n Shell: 5.8.1 - /bin/zsh\r\n Binaries:\r\n Node: 16.18.1 - /opt/homebrew/opt/node@16/bin/node\r\n Yarn: 1.22.19 - ~/.yarn/bin/yarn\r\n npm: 8.19.2 - /opt/homebrew/opt/node@16/bin/npm\r\n Browsers:\r\n Chrome: 108.0.5359.98\r\n Firefox: 101.0.1\r\n Safari: 15.6.1\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.30 => 1.0.0-alpha.30\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2925],{"name":2868,"color":2869},1681,"[QUESTION] checking if in client side to install plugin","2023-01-21T14:20:27Z","https://github.com/vuejs/vitepress/issues/1681",0.7264567,{"description":2932,"labels":2933,"number":2935,"owner":2871,"repository":2872,"state":2873,"title":2936,"updated_at":2937,"url":2938,"score":2939},"### Describe the bug\r\n\r\nWhen I run \"vitepress preview\" after executing \"vitepress build\" for packaging, the error message \"Cannot read properties of undefined (reading '_s')\" is prompted:\r\n\r\nAfter debugging, i is a reference to Pinia, but it is undefined here.\r\n\r\n### Reproduction\r\n\r\nvitepress config:\r\n\r\n```js\r\n// https://vitepress.dev/guide/custom-theme\r\nimport { h } from 'vue';\r\nimport Theme from 'vitepress/theme';\r\nimport { createPinia } from 'pinia';\r\nimport piniaPluginPersistedstate from 'pinia-plugin-persistedstate';\r\n\r\nimport './style.css';\r\n\r\nexport default {\r\n ...Theme,\r\n Layout: () => {\r\n return h(Theme.Layout, null, {\r\n // https://vitepress.dev/guide/extending-default-theme#layout-slots\r\n });\r\n },\r\n enhanceApp({ app, router, siteData }) {\r\n const store = createPinia().use(piniaPluginPersistedstate);\r\n\r\n app.use(store);\r\n },\r\n};\r\n```\r\n\r\n### Expected behavior\r\n\r\nit can operate normally in the production environment.\r\n\r\n### System Info\r\n\r\n```sh\r\ndependencies\r\n\r\n\"pinia\": \"~2.1.4\",\r\n\"pinia-plugin-persistedstate\": \"~3.1.0\",\r\n\r\ndevDependencies\r\n\r\n\"vitepress\": \"~1.0.0-beta.5\"\r\n```\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2934],{"name":2868,"color":2869},2672," Cannot read properties of undefined (reading '_s')","2023-09-02T00:04:14Z","https://github.com/vuejs/vitepress/issues/2672",0.73098207,{"description":2941,"labels":2942,"number":2944,"owner":2871,"repository":2872,"state":2873,"title":2945,"updated_at":2946,"url":2947,"score":2948},"### Describe the bug\n\nThe [docs](https://vitepress.vuejs.org/config/theme-configs#outline) specify that you can pick the levels at which to outline. However, even if you specify h1, it will not generate an outline for that level:\r\n\r\n```js\r\nexport default {\r\n themeConfig: {\r\n outline: [1,3]\r\n }\r\n}\r\n```\r\n\r\nThis was already mentioned as needing to be fixed in #954 and claimed to be fixed/added in #965.\n\n### Reproduction\n\n- Set the theme config as shown above to include h1 - h3 in the outline\r\n- Create an MD file with an h1 (or #) heading\n\n### Expected behavior\n\nShould see all headings h1 - h3 in the outline\n\n### System Info\n\n```shell\nSystem:\r\n OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)\r\n CPU: (6) x64 AMD FX(tm)-6300 Six-Core Processor\r\n Memory: 6.91 GB / 31.25 GB\r\n Container: Yes\r\n Shell: 5.1.16 - /bin/bash\r\n Binaries:\r\n Node: 16.16.0 - /usr/local/bin/node\r\n Yarn: 1.22.19 - ~/.yarn/bin/yarn\r\n npm: 8.15.0 - /usr/local/bin/npm\r\n Browsers:\r\n Chrome: 105.0.5195.125\r\n Firefox: 105.0.1\n```\n\n\n### Additional context\n\nThis _might_ be an error/issue with the [mdit-vue](https://github.com/mdit-vue/mdit-vue) package.\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2943],{"name":2868,"color":2869},1434,"Outlines Do Not Include h1 Even When Specified","2023-01-21T14:16:51Z","https://github.com/vuejs/vitepress/issues/1434",0.7313466,{"description":2950,"labels":2951,"number":2953,"owner":2871,"repository":2872,"state":2873,"title":2954,"updated_at":2955,"url":2956,"score":2957},"### Describe the bug\n\nIn a standard Vue project build output correctly lazy‐loads only the Shiki chunks required (e.g., `@shikijs/langs/vue` and `@shikijs/themes/material-theme-ocean`). \nHowever when the same code runs in a VitePress site (built with `pnpm docs:build`) the page is fetching **every** Shiki language and theme chunk up front. This results in dozens of unnecessary HTTP requests and significantly slows down page load. The expected on-demand loading behavior is not happening in the VitePress build.\n\n### Reproduction\n\nPrepared reproduction can be found here:\nhttps://github.com/alexchexes/vitepress-shiki-test\n\nSteps:\n1. `pnpm create vue@latest`\n2. `pnpm add -D vitepress` and `npx vitepress init`, default settings\n3. `pnpm add shiki`\n4. Put this code into a `.vue` file:\n```vue\n\u003Cscript setup lang=\"ts\">\nimport { onMounted, ref } from 'vue'\nimport { codeToHtml } from 'shiki'\n\nconst html = ref()\n\nonMounted(async () => {\n const code = '\u003Cdiv attr=\"123\" />'\n\n html.value = await codeToHtml(code, {\n lang: 'vue',\n theme: 'material-theme-ocean',\n })\n})\n\u003C/script>\n\n\u003Ctemplate>\n \u003Cdiv v-html=\"html\">\u003C/div>\n\u003C/template>\n```\n5. Put this code into a `.md` file:\n```md\n---\nlayout: page\nsidebar: false\n---\n\n\u003Cscript setup>\nimport CustomComponent from './CustomComponent.vue'\n\u003C/script>\n\n\u003CCustomComponent />\n```\n5. `pnpm build && pnpm docs:build`\n6. `pnpm preview`\n - Open the page where the Shiki is used.\n - Open DevTools → Network tab.\n - Notice that only the Vue grammar and material-theme-ocean chunks are fetched. This is correct. ✅\n7. `pnpm docs:preview`\n- Open the page where the Shiki is used.\n- Open DevTools → Network tab.\n- Notice that all Shiki languages and themes (even those not in use) are fetched at page load. This is incorrect. ❌\n\n### Expected behavior\n\nWhen building VitePress production site with `pnpm docs:build`, the output should behave like a standard Vue production build (`pnpm build`) when using libraries such as Shiki: the production page should not fetch every chunk up front at page load; it should only fetch the chunks when they are needed.\n\n### System Info\n\n```Text\nSystem:\n OS: Windows 11 10.0.26100\n CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H\n Memory: 33.51 GB / 63.67 GB\n Binaries:\n Node: 22.11.0 - C:\\Program Files\\nodejs\\node.EXE\n Yarn: 1.22.22 - ~\\AppData\\Roaming\\npm\\yarn.CMD\n npm: 11.4.1 - C:\\Program Files\\nodejs\\npm.CMD\n pnpm: 10.11.0 - ~\\AppData\\Local\\pnpm\\pnpm.EXE\n Browsers:\n Edge: Chromium (130.0.2849.80)\n npmPackages:\n vitepress: ^1.6.3 => 1.6.3\n```\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [x] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [x] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [x] Read the [docs](https://vitepress.dev).\n- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2952],{"name":2868,"color":2869},4770,"VitePress build eagerly loads all Shiki chunks instead of lazy-loading only what's needed","2025-06-03T04:11:18Z","https://github.com/vuejs/vitepress/issues/4770",0.73192626,["Reactive",2959],{},["Set"],["ShallowReactive",2962],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fvhjCjKcCa6QYX7wyvWi1S8s8pSOrY_VPhtDsaT_sXUc":-1},"/vuejs/vitepress/550"]