config.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import {defineConfig} from 'vitepress';
  2. import {applyPlugins} from '@ruabick/md-demo-plugins';
  3. import {genTemp} from '@ruabick/vite-plugin-gen-temp';
  4. import {genApiDoc} from '@ruabick/vite-plugin-gen-api-doc';
  5. import {sidebar} from './sidebar.js';
  6. import {resolve} from 'path';
  7. export default defineConfig({
  8. lang: 'zh-CN',
  9. lastUpdated: true,
  10. title: "hc-vue3-ui",
  11. themeConfig: {
  12. logo: '/favicon.ico',
  13. outlineTitle: '此页的大纲',
  14. nav: [
  15. {
  16. text: '使用说明',
  17. link: '/guide/index'
  18. },
  19. {
  20. text: '组件库',
  21. link: '/components/app-config/index'
  22. },
  23. {
  24. text: 'API函数',
  25. link: '/api/storage/index'
  26. },
  27. {
  28. text: '样式说明',
  29. link: '/style/base/index'
  30. },
  31. {
  32. text: '资料导航',
  33. link: '/guide/nav'
  34. },
  35. {
  36. text: '更新日志',
  37. link: '/CHANGELOG.md'
  38. },
  39. ],
  40. sidebar,
  41. search: {
  42. provider: 'local'
  43. }
  44. },
  45. vue: {},
  46. vite: {
  47. resolve: {
  48. alias: {
  49. 'docs': resolve('./src/'),
  50. },
  51. },
  52. plugins: [
  53. genTemp(),
  54. genApiDoc(),
  55. ],
  56. server: {
  57. port: 3300,
  58. }
  59. },
  60. markdown: {
  61. config: (md) => {
  62. applyPlugins(md);
  63. },
  64. theme: {
  65. light: 'github-light',
  66. dark: 'github-dark',
  67. },
  68. },
  69. buildEnd() {
  70. process.exit(0);
  71. },
  72. });