\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.6648988,{"description":2922,"labels":2923,"number":2927,"owner":2871,"repository":2872,"state":2873,"title":2928,"updated_at":2929,"url":2930,"score":2931},"> ```ts\n> import { defineConfig } from 'vitepress';\n> \n> export default defineConfig({\n> vite: {\n> // @ts-ignore\n> foo: 'bar',\n> plugins: [\n> {\n> \n> },\n> ``` \n\n _Originally posted by @brc-dd in [#1706](https://github.com/vuejs/vitepress/issues/1706#issuecomment-1359442549)_\n\n```\n vite: {\n server: {\n port: 5171,\n },\n },\n```\n1. Based on the example above, I added above, but my port did not change.\n2. Also tried creating `vite.config.ts`, but port still remained as the default 5172\n3. Any idea what I'm missing?",[2924],{"name":2925,"color":2926},"need more info","bdbefc",4733,"Cannot change port","2025-05-05T03:09:20Z","https://github.com/vuejs/vitepress/issues/4733",0.6668978,{"description":2933,"labels":2934,"number":2936,"owner":2871,"repository":2872,"state":2873,"title":2937,"updated_at":2938,"url":2939,"score":2940},"### Describe the bug\n\nI want to use TS for my theme config, but I get the following error:\r\n```\r\nTS2307: Cannot find module 'vitepress/theme' or its corresponding type declarations.\r\n```\r\nI think it happens because there is no `theme.d.ts` in the `files` array of `package.json`.\n\n### Reproduction\n\n1. Install vitepress\r\n2. Create `docs/.vitepress/theme/index.ts` file\r\n3. Type `import DefaultTheme from 'vitepress/theme'`\r\n4. Get the error from the IDE\n\n### Expected behavior\n\nNo type error\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 11.3.1\r\n CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz\r\n Memory: 25.62 MB / 8.00 GB\r\n Shell: 5.8 - /bin/zsh\r\n Binaries:\r\n Node: 16.4.1 - ~/.nvm/versions/node/v16.4.1/bin/node\r\n npm: 7.18.1 - ~/.nvm/versions/node/v16.4.1/bin/npm\r\n Browsers:\r\n Chrome: 95.0.4638.69\r\n Firefox Developer Edition: 92.0\r\n Safari: 14.1\r\n npmPackages:\r\n vitepress: ^0.20.1 => 0.20.1\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/coc)\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.",[2935],{"name":2868,"color":2869},438,"No `theme.d.ts` file in the installed library","2023-01-21T16:20:16Z","https://github.com/vuejs/vitepress/issues/438",0.66965806,{"description":2942,"labels":2943,"number":2950,"owner":2871,"repository":2872,"state":2873,"title":2951,"updated_at":2952,"url":2953,"score":2954},"Vite might be removing/deprecating it's CJS API is near future (https://github.com/vitejs/vite/discussions/13928) which will impact VitePress' CJS API as well.\r\n\r\n**Edit: Let's wait on discussion at Vite's side to conclude and we will try to follow their footsteps. But, it is recommended to use ESM APIs for anything new you might be building.**\r\n\r\n~~Most of the projects already appear to be using the import syntax. A quick [GitHub code search](https://github.com/search?q=/require%5C%28%5Cs*%5B%22'%5Dvitepress%5B%22'%5D/+NOT+is:fork&type=code) shows about 20 public projects doing `require('vitepress')`. Exploring more, over half of them appear to be on `vitepress@0.x` branch. Leaving less than 10 projects that might need minor refactoring.~~\r\n\r\n`import` syntax in `config.js` file when `\"type\": \"module\"` is not specified in nearest package.json also uses the CJS build. Might be difficult to estimate the impact. But for most of the cases where people are using import without type module or mjs/mts extension the migration should be straight forward -- either change the file extension or project level type.\r\n\r\nMigration:\r\n\r\n```ts\r\n// use .mjs/.mts file extension if can't use `\"type\": \"module\"`\r\n\r\n// change\r\nconst { defineConfig } = require('vitepress')\r\n\r\nmodule.exports = {/*...*/}\r\n\r\n// to\r\nimport { defineConfig } from 'vitepress'\r\n\r\nexport default {/*...*/}\r\n\r\n// or since it's just a type helper simply do something like this\r\n\r\n/** @type {ReturnType\u003Ctypeof import('vitepress').defineConfig>} */\r\nmodule.exports = {/*...*/}\r\n\r\n// change\r\nconst { createMarkdownRenderer } = require('vitepress')\r\n // ^ or any async API like createServer, build, resolveConfig, resolveSiteData\r\n\r\nasync fn() {\r\n const md = await createMarkdownRenderer(/*...*/)\r\n}\r\n\r\n// to\r\nasync fn() {\r\n const { createMarkdownRenderer } = await import('vitepress')\r\n const md = await createMarkdownRenderer(/*...*/)\r\n}\r\n```\r\n\r\n---\r\n\r\n~~For maintainers, we will need to use [jiti](https://github.com/unjs/jiti) for the CLI and remove CJS stuff from rollup config.~~\r\n\r\nCLI won't need any changes, it's already CJS compatible and uses ESM output. Only rollup related changes need to be done.\r\n\r\nRollout plan:\r\n\r\nLet's log a warning for now if someone `require`'s the package. We can drop the CJS API by RC.\r\n\r\n/cc @kiaking @zonemeen ",[2944,2947],{"name":2945,"color":2946},"build","377ba8",{"name":2948,"color":2949},"keep-open","96DAA7",2703,"Moving VitePress' Node API as ESM only","2023-08-08T10:21:50Z","https://github.com/vuejs/vitepress/issues/2703",0.6701109,{"description":2956,"labels":2957,"number":2958,"owner":2871,"repository":2872,"state":2873,"title":2959,"updated_at":2960,"url":2961,"score":2962},"### Is your feature request related to a problem? Please describe.\n\n## Adding Static Resources config\r\nWhen I use **vitepress** with external css files e.g. `element-plus.css`. I found that the only way to import the css file is via JavaScript. You can't actually add it in the rendered template `head` tag. So I wonder is it possible to expose a config field for importing external resources via `CDN`\r\n\r\n## Benefits\r\n\r\nWhen using external resources this way we could potentially benefit from using CDN.\n\n### Describe the solution you'd like\n\n### Exposing a field named `externals` or `resources` with type:\r\n\r\n```typescript\r\ntype Resource = {\r\n type: 'script' | 'link',\r\n target: 'url_to_resource',\r\n async: boolean // or defer?\r\n}\r\n\r\ntype Resources = Resource[]\r\n```\r\n\r\n### When rendering\r\n\r\nAdd co-responding HTML tag into the `head` tag for external links.\n\n### Describe alternatives you've considered\n\n_No response_\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/coc)\n- [X] Read the [docs](https://vitepress.vuejs.org/).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/master/.github/contributing.md).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[],375,"[Feature Request] Adding config for external resources","2023-01-21T16:22:09Z","https://github.com/vuejs/vitepress/issues/375",0.67159784,["Reactive",2964],{},["Set"],["ShallowReactive",2967],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fHkRrMfeD5J8xpvFbjD1oVInZcZ0EdLMALXek99xwugM":-1},"/vuejs/vitepress/464"]