`)\r\n\r\nI'm currently working on migrating and documenting the excellent Spectre CSS docs and am using Vitepress.\r\n\r\nI'm developing an ejected and modified default theme which has already come some way to solving this problem:\r\n\r\n- [original](https://picturepan2.github.io/spectre/components/menu.html) (custom app)\r\n- [migrated](https://spectre-org.github.io/spectre-docs/docs/components/menu.html) (VitePress with modified default theme)\r\n - note the `vp-doc` formatting which is all Spectre CSS\r\n - some fixed, and some not-yet fixed clashes of general class names\r\n\r\nFor reference to the use case (documenting a 3rd-party framework) here is the raw markdown page:\r\n\r\n- https://raw.githubusercontent.com/spectre-org/spectre-docs/main/docs/components/menu.md\r\n\r\nNote that:\r\n\r\n- Spectre CSS (or any other 3rd-party CSS framework) is now able to be simply \"dropped in\"\r\n- there is no pollution between VitePress and the 3rd-party framework\r\n- VitePress' default components remain fully-styled and work as they were before\r\n- `vp-doc` content can be safely used to demo any 3rd party HTML elements and classes\r\n\r\nI think I know enough to fix the problems in my modified theme and either:\r\n\r\n- publish a new \"neutral\" theme\r\n- port the changes to the default theme (ideal outcome)\r\n\r\nThere's actually not that much work; it's:\r\n\r\n- renaming the general component classes\r\n- moving some `vp-doc` classes to other locations\r\n- creating an additional unstyled entrypoint such as `without-formatting`\r\n\r\n### Describe alternatives you've considered\r\n\r\nPublishing the modified theme standalone, but then of course it would not benefit from ongoing updates.\r\n\r\n### Additional context\r\n\r\nI am proposing a PR in the coming weeks to integrate these updates.\r\n\r\n### Validations\r\n\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] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2881],{"name":2868,"color":2869},3021,"Make the default theme compatible with 3rd-party CSS frameworks","2023-11-06T14:43:58Z","https://github.com/vuejs/vitepress/issues/3021",0.7089801,{"description":2888,"labels":2889,"number":2893,"owner":2871,"repository":2872,"state":2894,"title":2895,"updated_at":2896,"url":2897,"score":2898},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\n`build`的时候报错,猜测可能是md文件名不支持中文\r\n\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.4.0\r\n- OS version: Macos Big Sur 11.1\r\n",[2890],{"name":2891,"color":2892},"need more info","bdbefc",186,"closed","Does markdown file name not support Chinese?","2023-01-21T16:20:25Z","https://github.com/vuejs/vitepress/issues/186",0.68101,{"description":2900,"labels":2901,"number":2902,"owner":2871,"repository":2872,"state":2894,"title":2903,"updated_at":2904,"url":2905,"score":2906},"### 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.69582766,{"description":2908,"labels":2909,"number":2910,"owner":2871,"repository":2872,"state":2894,"title":2911,"updated_at":2912,"url":2913,"score":2914},"### Is your feature request related to a problem? Please describe.\n\nMy request is related to the problem of limited access to VitePress documentation for Chinese developers.\n\n### Describe the solution you'd like\n\nDear VitePress team,\r\n\r\nI am writing to express my interest in translating your excellent documentation from English into Simplified Chinese. As an avid user of VitePress, I believe having Chinese documentation would greatly benefit the Chinese developer community, who may not be proficient in English.\r\n\r\nVitePress has quickly become one of the most popular static site generators thanks to its focus on speed and flexibility. However, currently all the official resources are only available in English. This creates a barrier to adoption for millions of developers in China who could greatly benefit from VitePress.\r\n\r\nAs a native Chinese speaker proficient in English, I would be honored to volunteer my time to translate the VitePress docs and site into Simplified Chinese. This would involve translating the documentation, guides, API references, and anything else on the site.\r\n\r\nI am part of the Chinese open source community and am committed to helping projects expand their reach. I would handle all the translation work, while making sure to maintain the original meaning and technical accuracy. I am also happy to coordinate with your team and demonstrate proficiency if required.\r\n\r\nPlease consider this request to translate VitePress into Chinese. I believe it will significantly lower the barrier to entry for Chinese developers and enable faster adoption in China. If you have any other questions or need clarification, please let me know. I am excited at the possibility of contributing to this great project!\r\n\r\nThank you for your consideration.\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/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],2883,"Request to Translate VitePress Documentation into Simplified Chinese","2023-09-07T00:04:19Z","https://github.com/vuejs/vitepress/issues/2883",0.69637036,{"description":2916,"labels":2917,"number":2921,"owner":2871,"repository":2872,"state":2894,"title":2922,"updated_at":2923,"url":2924,"score":2925},"### Is your feature request related to a problem? Please describe.\n\nThe outputs ESM entries are not fully compatible with native ESM actually, take the following as example\r\n\r\nhttps://unpkg.com/browse/vitepress@1.0.0-alpha.4/dist/client/index.js\r\n\r\nAll relative file paths should be ended with correct `.js` extension, and `/index.js` can not be omitted anymore.\r\n\r\nThat's being said, we should use `moduleResolution: \"Node16\"` instead.\r\n\r\nAnd when the user enables `type: \"module\"` in their `package.json` or `.vitepress/package.json`, all temporary `.js` files in `.vitepress/.temp` would be considered as ESM only, and now it would emit error:\r\n\r\n```log\r\nvitepress v1.0.0-alpha.4\r\n- building client + server bundles...\r\n@alauda/chart doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have \"type\": \"module\" or an .mjs extension for the entry point). Please contact the package author to fix.\r\nquill-image-uploader doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have \"type\": \"module\" or an .mjs extension for the entry point). Please contact the package author to fix.\r\n✓ building client + server bundles...\r\n- rendering pages...\r\n✖ rendering pages...\r\nbuild error:\r\n ReferenceError: exports is not defined in ES module scope\r\nThis file is being treated as an ES module because it has a '.js' file extension and '/home/jenkins/agent/workspace/frontend/frontend-vision-docs/docs/.vitepress/package.json' contains \"type\": \"module\". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.\r\n at file:///home/jenkins/agent/workspace/frontend/frontend-vision-docs/docs/.vitepress/.temp/app.js:2:25\r\n at ModuleJob.run (node:internal/modules/esm/module_job:195:25)\r\n at async Promise.all (index 0)\r\n at async ESMLoader.import (node:internal/modules/esm/loader:337:24)\r\n at async renderPage (file:///home/jenkins/agent/workspace/frontend/frontend-vision-docs/node_modules/vitepress/dist/node/serve-05342c3d.js:39534:25)\r\n at async build (file:///home/jenkins/agent/workspace/frontend/frontend-vision-docs/node_modules/vitepress/dist/node/serve-05342c3d.js:39853:9)\r\nerror Command failed with exit code 1.\r\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\r\nscript returned exit code 1\r\n```\n\n### Describe the solution you'd like\n\nEnable `moduleResolution: \"Node16\"` and add a `package.json` into `.vitepress/.temp` with `type: \"commonjs\"` for now, and migrate all outputs files as pure ESM later.\n\n### Describe alternatives you've considered\n\nWe can use `.cjs` files extensions for files outputs in `.vitepress/.temp`\n\n### Additional context\n\nReference https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing\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] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2918],{"name":2919,"color":2920},"build","377ba8",917,"Better support for `type: \"module\"` from user","2023-01-21T14:28:36Z","https://github.com/vuejs/vitepress/issues/917",0.69759685,{"description":2927,"labels":2928,"number":2932,"owner":2871,"repository":2872,"state":2894,"title":2933,"updated_at":2934,"url":2935,"score":2936},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\nWhen I use the components directly in markdown file, It raised a waring with `vue.js:1099 [Vue warn]: Failed to resolve componen` as:\r\n\r\n\r\n\r\nDoes vitepress auto register components in `.vitepress/components`? or where can I put the `.vue` files and how to use them? thank you.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n\r\n**Expected behavior**\r\nA clear and concise description of what you expected to happen.\r\n\r\n**System Info**\r\n- vitepress version:\r\n- vite version:\r\n- Node version:\r\n- OS version:\r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n",[2929],{"name":2930,"color":2931},"bug: pending triage","e99695",60,"Is vitepress auto register components in `.vitepress/components`?","2023-01-21T16:25:31Z","https://github.com/vuejs/vitepress/issues/60",0.6985857,{"description":2938,"labels":2939,"number":2944,"owner":2871,"repository":2872,"state":2894,"title":2945,"updated_at":2946,"url":2947,"score":2948},"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 ",[2940,2941],{"name":2919,"color":2920},{"name":2942,"color":2943},"keep-open","96DAA7",2703,"Moving VitePress' Node API as ESM only","2023-08-08T10:21:50Z","https://github.com/vuejs/vitepress/issues/2703",0.6991579,{"description":2950,"labels":2951,"number":2952,"owner":2871,"repository":2872,"state":2894,"title":2953,"updated_at":2954,"url":2955,"score":2956},"**Is your feature request related to a problem? Please describe.**\r\nCurrently there seems to be no way to extend the Vite config used by vitepress (or at least it's not clear how to do it).\r\nIt would be great to have that ability to specify aliases that are used inside of components that are not part of VitePress.\r\n\r\nIn our case we have a component library in `src`, and the docs in `docs`, but components imported in VitePress use `#components/button` imports (for example) and VitePress can't resolve those as there's no way to set up aliases for it.\r\n\r\n**Describe the solution you'd like**\r\nA way to extend vite config and/or specify aliases.\r\n\r\n**Describe alternatives you've considered**\r\nI tried creating a vite config in the root, but that prevents TS based SFC's from compiling properly (I think it overwrites the internal config).\r\n\r\n**Additional context**\r\nA quick screenshot of our setup:\r\n\r\n\r\n`docs/.vitepress` hosts VitePress, but the root is Vite itself (library mode).",[],241,"Ability to extend vite config","2023-01-21T14:20:28Z","https://github.com/vuejs/vitepress/issues/241",0.7013021,{"description":2958,"labels":2959,"number":2961,"owner":2871,"repository":2872,"state":2894,"title":2962,"updated_at":2963,"url":2964,"score":2965},"### Describe the bug\n\nI referenced a globally registered component in the markdown document of vitepress. When I used it, the error was reported as follows:\r\n**[vitepress] Internal server error: At least one \u003Ctemplate> or \u003Cscript> is required in a single file component.**\r\n\r\n\r\n\n\n### Reproduction\n\nCreate vite.config.js in the vitepress root directory, the content is as follows:\r\n\r\n```\r\nimport { defineConfig } from \"vite\";\r\nimport vueJsx from \"@vitejs/plugin-vue-jsx\";\r\nimport vue from \"@vitejs/plugin-vue\"\r\nexport default defineConfig({\r\n plugins: [\r\n vue(),\r\n vueJsx(),\r\n ],\r\n});\r\n```\n\n### Expected behavior\n\nRender component content correctly\n\n### System Info\n\n```shell\nnode 16\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.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2960],{"name":2891,"color":2892},2095,"vitepress not support jsx file?","2023-03-29T00:04:14Z","https://github.com/vuejs/vitepress/issues/2095",0.7026878,["Reactive",2967],{},["Set"],["ShallowReactive",2970],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fKzj80pi1UG7GKdFnzRUYVrVfIUMK3yipDuwNKh5e1FM":-1},"/vuejs/vitepress/861"]