\r\n2. 配置文件如下所示:\u003Cbr /> \n\n### Expected behavior\n\n使用 Github 自带的 https://xihuanxiaorang.github.io/docs/ 访问就没有任何问题,如果是使用自定义域名 https://docs.xiaorang.fun/ 的话,样式就会丢失\n\n### System Info\n\n```Text\nSystem:\r\n OS: Windows 10 10.0.19045\r\n CPU: (4) x64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz\r\n Memory: 659.73 MB / 3.92 GB\r\n Binaries:\r\n Node: 20.11.0 - E:\\nodejs\\node.EXE\r\n Yarn: 1.22.21 - E:\\nodejs\\node_global\\yarn.CMD\r\n npm: 10.2.4 - E:\\nodejs\\npm.CMD\r\n pnpm: 8.14.3 - E:\\nodejs\\node_global\\pnpm.CMD\r\n Browsers:\r\n Edge: Chromium (120.0.2210.144)\r\n Internet Explorer: 11.0.19041.3636\r\n npmPackages:\r\n vitepress: 1.0.0-rc.40 => 1.0.0-rc.40\n```\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.",[2882],{"name":2883,"color":2884},"question","5D5FAE",3513,"closed","部署到Github Pages之后,如果使用自定义域名的话样式会丢失","2024-02-07T00:04:15Z","https://github.com/vuejs/vitepress/issues/3513",0.67907286,{"description":2892,"labels":2893,"number":2895,"owner":2872,"repository":2873,"state":2886,"title":2896,"updated_at":2897,"url":2898,"score":2899},"### Describe the bug\n\nFor some reason vitepress's module resolution doesn't pick up re-exported things in esm modules. This may affect more than just the dependency I'm having problems with, but in this case it's @popperjs/core aka. [floating ui](https://github.com/floating-ui/floating-ui) - when importing their constant `placements` `vitepress build` throws the following error:\r\n\r\n```\r\nvitepress v1.0.0-beta.1\r\n\r\n✓ building client + server bundles...\r\n⠋ rendering pages...(node:238582) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time\r\n(Use `node --trace-warnings ...` to show where the warning was created)\r\nfile:///xxx/.vitepress/.temp/markdown-examples.md.js:3\r\nimport { createPopper, placements } from \"@popperjs/core\";\r\n ^^^^^^^^^^\r\nSyntaxError: Named export 'placements' not found. The requested module '@popperjs/core' is a CommonJS module, which may not support all module.exports as named exports.\r\nCommonJS modules can always be imported via the default export, for example using:\r\n\r\nimport pkg from '@popperjs/core';\r\nconst { createPopper, placements } = pkg;\r\n\r\n at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)\r\n at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)\r\n at async Promise.all (index 0)\r\n at async ESMLoader.import (node:internal/modules/esm/loader:530:24)\r\n at async loadPage (file:///xxx/.vitepress/.temp/Content.2e4fdb81.js:210:18)\r\n at async Object.go (file:///xxx/.vitepress/.temp/Content.2e4fdb81.js:202:5)\r\n at async render (file:///xxx/.vitepress/.temp/app.js:4561:3)\r\n at async renderPage (file:///xxx/node_modules/vitepress/dist/node/serve-d5608de4.js:41246:19)\r\n at async Promise.all (index 3)\r\n at async build (file:///xxx/node_modules/vitepress/dist/node/serve-d5608de4.js:41781:7)\r\n✖ rendering pages...\r\nbuild error:\r\nfile:///xxx/.vitepress/.temp/markdown-examples.md.js:3\r\nimport { createPopper, placements } from \"@popperjs/core\";\r\n ^^^^^^^^^^\r\nSyntaxError: Named export 'placements' not found. The requested module '@popperjs/core' is a CommonJS module, which may not support all module.exports as named exports.\r\nCommonJS modules can always be imported via the default export, for example using:\r\n\r\nimport pkg from '@popperjs/core';\r\nconst { createPopper, placements } = pkg;\r\n\r\n at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)\r\n at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)\r\n at async Promise.all (index 0)\r\n at async ESMLoader.import (node:internal/modules/esm/loader:530:24)\r\n at async loadPage (file:///xxx/.vitepress/.temp/Content.2e4fdb81.js:210:18)\r\n at async Object.go (file:///xxx/.vitepress/.temp/Content.2e4fdb81.js:202:5)\r\n at async render (file:///xxx/.vitepress/.temp/app.js:4561:3)\r\n at async renderPage (file:///xxx/node_modules/vitepress/dist/node/serve-d5608de4.js:41246:19)\r\n at async Promise.all (index 3)\r\n at async build (file:///xxx/node_modules/vitepress/dist/node/serve-d5608de4.js:41781:7)\r\n\r\nProcess finished with exit code 1\r\n```\r\n\r\nThe dependency is not marked as \"native\" esm module (via `\"type\": \"module\"` in the `package.json`) but provides both cjs, esm and umd bundles. \r\n\r\nThe import path looks like the following: `@popperjs/core -> @popperjs/core/dist/esm/index.js -> @popperjs/core/dist/esm/enums.js `, you can check it out in the `node_modules` folder.\n\n### Reproduction\n\nReproduced [here](https://stackblitz.com/edit/vite-k6uusu?file=package.json,docs%2Fexample.md), in actuality this is a dependency of another dependency, where it wasn't possible to import it if `\"type\": \"module\"` wasn't specified in the `package.json`. So it seems like there is a problem with esm modules that support esm, but don't have `\"type\": \"module\"` set in their `package.json`.\n\n### Expected behavior\n\nIt should import the constant correctly.\n\n### System Info\n\n```sh\nSystem:\r\n OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)\r\n CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics\r\n Memory: 4.73 GB / 31.22 GB\r\n Container: Yes\r\n Shell: 5.1.16 - /bin/bash\r\n Binaries:\r\n Node: 18.12.1 - /usr/local/bin/node\r\n npm: 9.6.6 - /usr/local/bin/npm\r\n Browsers:\r\n Chrome: 113.0.5672.126\r\n npmPackages:\r\n vitepress: ^1.0.0-beta.1 => 1.0.0-beta.1\n```\n\n\n### Additional context\n\nMaybe related to #1232 and [#10822](https://github.com/nuxt/nuxt/discussions/10822)\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.",[2894],{"name":2866,"color":2867},2411,"Build fails because a requested module is a CommonJS module, even though it's not (kinda)","2023-06-02T00:04:14Z","https://github.com/vuejs/vitepress/issues/2411",0.6840263,{"description":2901,"labels":2902,"number":2904,"owner":2872,"repository":2873,"state":2886,"title":2905,"updated_at":2906,"url":2907,"score":2908},"### Describe the bug\n\nI have `.github/workflows/deploy.yml` set up in my project root as doc instructed. And Github action succeeds. However, when I visit my pages, its not vitepress that I see but regular github pages.\r\n\r\nIs there some settings I have to alter in github repository itself?\n\n### Reproduction\n\n\r\nThis is my app structure \r\n\r\n```\r\n- root\r\n - docs (vitepress)\r\n - theme/index.js\r\n - config.js\r\n - index.md \r\n - src (src for my vue component lib)\r\n - dist (for my vue component lib)\r\n```\r\n\r\nThis is my github workflow deploy.yml\r\n```\r\nname: Deploy\r\n\r\non:\r\n push:\r\n branches:\r\n - master\r\n\r\njobs:\r\n deploy:\r\n runs-on: ubuntu-latest\r\n steps:\r\n - uses: actions/checkout@v2\r\n - uses: actions/setup-node@v3\r\n with:\r\n node-version: 16\r\n cache: npm\r\n - run: npm ci\r\n\r\n - name: Build\r\n run: npm run docs:build\r\n\r\n - name: Deploy\r\n uses: peaceiris/actions-gh-pages@v3\r\n with:\r\n github_token: ${{ secrets.GITHUB_TOKEN }}\r\n publish_dir: docs/.vitepress/dist\r\n```\n\n### Expected behavior\n\nBuilt vitepress in github pages.\n\n### System Info\n\n```shell\n(Local)\r\nSystem:\r\n OS: macOS 12.2\r\n CPU: (8) arm64 Apple M1 Pro\r\n Memory: 99.72 MB / 16.00 GB\r\n Shell: 5.8 - /bin/zsh\n```\n\n\n### Additional context\n\nMy repository is in an organization.\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.",[2903],{"name":2866,"color":2867},1144,"Github pages shows index.md natively","2023-01-21T14:26:58Z","https://github.com/vuejs/vitepress/issues/1144",0.6896791,{"description":2910,"labels":2911,"number":2912,"owner":2872,"repository":2873,"state":2886,"title":2913,"updated_at":2914,"url":2915,"score":2916},"### Is your feature request related to a problem? Please describe.\n\nI use vitepress to generate documentation for a GitHub project. The documentation will be generated locally and then pushed to GitHub. It is then deployed from the /docs folder to GitHub pages.\r\n\r\nEvery time I build the documentation the filenames in /assets will change. A filename looks for e.g. \"index.md.497bee00.js\". The part \"497bee00\" changes every time I build the documentation. As I must check it in in order to havbe the built documentation in my GitHub project, there are new filenames for each build. \n\n### Describe the solution you'd like\n\nUse filenames in /asset, that are not changing for each build.\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.",[],386,"Unique names for files in /assets","2023-01-21T16:22:04Z","https://github.com/vuejs/vitepress/issues/386",0.69106996,{"description":2918,"labels":2919,"number":2923,"owner":2872,"repository":2873,"state":2886,"title":2924,"updated_at":2925,"url":2926,"score":2927},"### Describe the bug\n\nI was deploying my project with GitHub Pages as indicated in the documentation using a `deploy.sh` file and everything works correctly until I open my web from the GH pages link.\r\n\r\nHere a preview https://dev.adonys.me/vitepress/\r\n\r\nI am using a custom domain with CNAME which redirects me from https://dev.adonys.me to https://adonyssantos.github.io.\n\n### Reproduction\n\nThe only thing I did was to deploy the page with GitHub Page using a `deploy.sh` file as indicated in the official documentation.\n\n### Expected behavior\n\nI expected that when I enter my site from https://dev.adonys.me/vitepress to see my site correctly (no duplicate), but I enter and the same page is repeated 2 times.\n\n### System Info\n\n```shell\nMy vitepress config:\r\n\r\nexport default {\r\n base: '/vitepress/',\r\n title: 'Adonys Santos',\r\n description: 'Learning Vitepress.',\r\n};\n```\n\n\n### Additional context\n\nhttps://dev.adonys.me/vitepress/\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.",[2920],{"name":2921,"color":2922},"need more info","bdbefc",845,"bug: Duplicate view when deployed with GitHub Pages","2023-01-21T14:30:24Z","https://github.com/vuejs/vitepress/issues/845",0.6966178,{"description":2929,"labels":2930,"number":2932,"owner":2872,"repository":2873,"state":2886,"title":2933,"updated_at":2934,"url":2935,"score":2936},"### Describe the bug\n\n\r\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vite-pzpqo8?file=docs%2F.vitepress%2Ftheme%2Fx.ts\r\n\r\n在 `theme/x.ts` 中引入了 `echarts` ,开发时是可以的,页面正常显示。构建时报错。\r\n\r\n\r\n\r\n**如果是一个纯 vite 项目,构建不错误**\n\n### Expected behavior\n\n正常编译不出错\n\n### System Info\n\n```sh\nSystem:\r\n OS: macOS 13.4\r\n CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz\r\n Memory: 48.46 MB / 32.00 GB\r\n Shell: 3.2.57 - /bin/bash\r\n Binaries:\r\n Node: 16.18.1 - ~/Library/Caches/fnm_multishells/19014_1691646234602/bin/node\r\n Yarn: 1.22.19 - ~/Library/pnpm/yarn\r\n npm: 8.19.2 - ~/Library/Caches/fnm_multishells/19014_1691646234602/bin/npm\r\n pnpm: 8.6.8 - ~/Library/pnpm/pnpm\r\n npmPackages:\r\n vitepress: 1.0.0-rc.4 => 1.0.0-rc.4\n```\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.",[2931],{"name":2866,"color":2867},2769,"引入 echarts 编译时报错","2023-08-18T00:04:16Z","https://github.com/vuejs/vitepress/issues/2769",0.697301,{"description":2938,"labels":2939,"number":2940,"owner":2872,"repository":2873,"state":2886,"title":2941,"updated_at":2942,"url":2943,"score":2944},"### Discussed in https://github.com/vuejs/vitepress/discussions/609\r\n\r\n\u003Cdiv type='discussions-op-text'>\r\n\r\n\u003Csup>Originally posted by **Roman-00** April 25, 2022\u003C/sup>\r\nWhen hosting, I have already brought down this project for hosting in a subdirectory https://domain.com/ms/guide , can't get to js files and styles, writes 404. How can I specify the path to styles and js files when building\r\n\r\n\r\nCan I somehow register the path to the files myself within vitepress?\u003C/div>",[],610,"When hosting, I have already brought down this project for hosting in a subdirectory https://domain.com/ms/guide , can't get to js files and styles, writes 404","2023-01-21T16:04:28Z","https://github.com/vuejs/vitepress/issues/610",0.70042217,{"description":2946,"labels":2947,"number":2951,"owner":2872,"repository":2873,"state":2886,"title":2952,"updated_at":2953,"url":2954,"score":2955},"### Describe the bug\n\nWhen following the steps in https://vitepress.dev/guide/getting-started, the production build doesn't work. \n\n### Reproduction\n\nFirst I used \r\n```\r\nnpx vitepress init\r\n```\r\nto create [this repo](https://gitlab.com/urswilke/vitepress_from_template2).\r\n\r\nI used all the default settings, apart from setting `./docs` in\r\n```\r\nWhere should VitePress initialize the config?\r\n ./docs\r\n```\r\n\r\n\r\nThen, I run:\r\n```\r\nnpm run docs:build \r\n```\r\n\r\nWhen opening the file `docs/.vitepress/dist/index.html`, this results in the CORS errors in the following screenshot:\r\n\r\n\r\n\r\n\r\n\n\n### Expected behavior\n\nThe production build should result in the same as on the dev server (which works).\n\n### System Info\n\n```Text\nSystem:\r\n OS: Linux 6.9 Arch Linux\r\n CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz\r\n Memory: 20.41 GB / 31.12 GB\r\n Container: Yes\r\n Shell: 5.2.26 - /bin/bash\r\n Binaries:\r\n Node: 22.4.1 - /usr/bin/node\r\n npm: 10.8.2 - /usr/bin/npm\r\n npmPackages:\r\n vitepress: ^1.3.1 => 1.3.1\n```\n\n\n### Additional context\n\nOn chrome, the site isn't correctly built either.\r\nThe deploy on gitlab pages also doesn't work (see [here](https://vitepress-from-template2-urswilke-295c17a73cbd456dc43a7cf324dd1.gitlab.io/)).\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.",[2948],{"name":2949,"color":2950},"docs","0075ca",4055,"update notes on base in gitlab deploy guide","2024-07-25T04:42:43Z","https://github.com/vuejs/vitepress/issues/4055",0.70429164,{"description":2957,"labels":2958,"number":2960,"owner":2872,"repository":2873,"state":2886,"title":2961,"updated_at":2962,"url":2963,"score":2964},"### Describe the bug\n\n\u003Cimg width=\"269\" alt=\"image\" src=\"https://github.com/vuejs/vitepress/assets/61684763/10622fbc-efb0-4dbd-a342-5c4e73ed04a0\">\r\n\u003Cimg width=\"1272\" alt=\"image\" src=\"https://github.com/vuejs/vitepress/assets/61684763/42577ef3-634d-459e-bf05-97ada3afef7b\">\r\n以前旧版本是没有这个问题的。升级后才有的。\n\n### Reproduction\n\n升级vitepress打包部署后出现的\n\n### Expected behavior\n\n望能修复正常\n\n### System Info\n\n```sh\nSystem:\r\n OS: macOS 13.4.1\r\n CPU: (8) arm64 Apple M1\r\n Memory: 57.69 MB / 16.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node\r\n Yarn: 1.22.19 - ~/.nvm/versions/node/v16.14.0/bin/yarn\r\n npm: 9.8.0 - ~/.nvm/versions/node/v16.14.0/bin/npm\r\n Watchman: 2023.03.27.00 - /opt/homebrew/bin/watchman\r\n Browsers:\r\n Chrome: 115.0.5790.170\r\n Safari: 16.5.2\n```\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.",[2959],{"name":2866,"color":2867},2772,"升级vitepress后部署到阿里云服务器后,刷新页面会404","2023-08-18T00:04:13Z","https://github.com/vuejs/vitepress/issues/2772",0.704618,["Reactive",2966],{},["Set"],["ShallowReactive",2969],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fmbN0JNl_EqTpQliIbr-5l4XgGA1F_FdJLAKkQu5XUj0":-1},"/vuejs/vitepress/382"]