config.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. import Unocss from 'unocss/vite'
  2. import svgLoader from 'vite-svg-loader'
  3. import { defineConfig } from 'vitepress'
  4. import { resolve } from 'pathe'
  5. import Components from 'unplugin-vue-components/vite'
  6. export default defineConfig({
  7. title: 'TresJS',
  8. description: 'Declarative ThreeJS using Vue Components',
  9. head: [
  10. ['link', { rel: 'icon', type: 'image/svg', href: '/favicon.svg' }],
  11. ['script', { defer: 'true', 'data-domain': 'tresjs.org', src: 'https://plausible.io/js/script.js' }],
  12. ],
  13. themeConfig: {
  14. logo: '/logo.svg',
  15. sidebar: [
  16. {
  17. text: 'Guide',
  18. items: [
  19. // This shows `/guide/index.md` page.
  20. { text: 'Introduction', link: '/guide/' },
  21. { text: 'Getting Started', link: '/guide/getting-started' },
  22. { text: 'Your first Scene', link: '/guide/your-first-scene' },
  23. { text: 'Migrate from v1', link: '/guide/migration-guide' },
  24. ],
  25. },
  26. {
  27. text: 'API',
  28. items: [
  29. { text: 'Renderer', link: '/api/renderer' },
  30. {
  31. text: 'Instances, arguments and props',
  32. link: '/api/instances-arguments-and-props',
  33. },
  34. {
  35. text: 'Composables',
  36. link: '/api/composables',
  37. },
  38. {
  39. text: 'Events',
  40. link: '/api/events',
  41. },
  42. ],
  43. },
  44. {
  45. text: 'Examples',
  46. items: [
  47. { text: 'Orbit Controls', link: '/examples/orbit-controls' },
  48. { text: 'Basic Animations', link: '/examples/basic-animations' },
  49. { text: 'Groups', link: '/examples/groups' },
  50. { text: 'Load Textures', link: '/examples/load-textures' },
  51. { text: 'Load Models', link: '/examples/load-models' },
  52. { text: 'Load Text', link: '/examples/text-3d' },
  53. ],
  54. },
  55. {
  56. text: 'Advanced',
  57. items: [
  58. { text: 'Extending', link: '/advanced/extending' },
  59. {
  60. text: 'Caveats',
  61. link: '/advanced/caveats',
  62. },
  63. ],
  64. },
  65. {
  66. text: 'Ecosystem',
  67. items: [
  68. {
  69. text: `Cientos 💛`,
  70. link: 'https://cientos.tresjs.org/',
  71. },
  72. ],
  73. },
  74. ],
  75. nav: [
  76. { text: 'Guide', link: '/guide/' },
  77. { text: 'API', link: '/api/renderer' },
  78. /* { text: 'API', link: '/api/' },
  79. { text: 'Config', link: '/config/' }, */
  80. {
  81. text: 'Ecosystem',
  82. items: [
  83. {
  84. text: `Cientos 💛`,
  85. link: 'https://cientos.tresjs.org/',
  86. },
  87. ],
  88. },
  89. ],
  90. socialLinks: [
  91. /* { icon: 'github', link: 'https://github.com/tresjs/tres' }, */
  92. { icon: 'twitter', link: 'https://twitter.com/alvarosabu' },
  93. { icon: 'discord', link: 'https://discord.gg/wXx63MwW' },
  94. ],
  95. },
  96. vite: {
  97. plugins: [
  98. svgLoader(),
  99. Unocss(),
  100. Components({
  101. dirs: ['./theme/components'],
  102. }),
  103. ],
  104. resolve: {
  105. alias: {
  106. '/@': resolve(__dirname, '../../src'),
  107. },
  108. },
  109. },
  110. })