1
0

config.ts 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. import { defineConfig } from 'vitepress'
  2. import { resolve } from 'pathe'
  3. export default defineConfig({
  4. title: 'TresJS',
  5. description: 'Declarative ThreeJS using Vue Components',
  6. head: [
  7. ['link', { rel: 'icon', type: 'image/svg', href: '/favicon.svg' }],
  8. ['meta', { name: 'theme-color', content: '#82DBC5' }],
  9. ['meta', { name: 'twitter:card', content: 'summary_large_image' }],
  10. ['meta', { name: 'twitter:site', content: '@tresjs_dev' }],
  11. ['meta', { name: 'twitter:creator', content: '@tresjs_dev' }],
  12. ['meta', { property: 'og:type', content: 'website' }],
  13. ['meta', { property: 'og:site_name', content: 'TresJS' }],
  14. [
  15. 'meta',
  16. {
  17. property: 'og:image',
  18. content: 'https://repository-images.githubusercontent.com/571314349/10996566-7f70-473b-a8e5-4e56fc0ca850',
  19. },
  20. ],
  21. [
  22. 'meta',
  23. {
  24. property: 'twitter:image',
  25. content: 'https://repository-images.githubusercontent.com/571314349/10996566-7f70-473b-a8e5-4e56fc0ca850',
  26. },
  27. ],
  28. ['script', { defer: 'true', 'data-domain': 'tresjs.org', src: 'https://plausible.io/js/script.js' }],
  29. ],
  30. themeConfig: {
  31. logo: '/logo.svg',
  32. search: {
  33. provider: 'local',
  34. },
  35. sidebar: [
  36. {
  37. text: 'Guide',
  38. items: [
  39. // This shows `/guide/index.md` page.
  40. { text: 'Introduction', link: '/guide/' },
  41. { text: 'Getting Started', link: '/guide/getting-started' },
  42. { text: 'Your first Scene', link: '/guide/your-first-scene' },
  43. { text: 'Troubleshooting', link: '/guide/troubleshooting' },
  44. { text: 'Migrate from v1', link: '/guide/migration-guide' },
  45. ],
  46. },
  47. {
  48. text: 'API',
  49. items: [
  50. { text: 'Renderer', link: '/api/renderer' },
  51. {
  52. text: 'Instances, arguments and props',
  53. link: '/api/instances-arguments-and-props',
  54. },
  55. {
  56. text: 'Composables',
  57. link: '/api/composables',
  58. },
  59. {
  60. text: 'Events',
  61. link: '/api/events',
  62. },
  63. ],
  64. },
  65. {
  66. text: 'Examples',
  67. items: [
  68. { text: 'Orbit Controls', link: '/examples/orbit-controls' },
  69. { text: 'Basic Animations', link: '/examples/basic-animations' },
  70. { text: 'Groups', link: '/examples/groups' },
  71. { text: 'Load Textures', link: '/examples/load-textures' },
  72. { text: 'Load Models', link: '/examples/load-models' },
  73. { text: 'Load Text', link: '/examples/text-3d' },
  74. ],
  75. },
  76. {
  77. text: 'Advanced',
  78. items: [
  79. { text: 'Extending', link: '/advanced/extending' },
  80. {
  81. text: 'Caveats',
  82. link: '/advanced/caveats',
  83. },
  84. ],
  85. },
  86. {
  87. text: 'Ecosystem',
  88. items: [
  89. {
  90. text: `Cientos 💛`,
  91. link: 'https://cientos.tresjs.org/',
  92. },
  93. ],
  94. },
  95. ],
  96. nav: [
  97. { text: 'Guide', link: '/guide/' },
  98. { text: 'API', link: '/api/renderer' },
  99. /* { text: 'API', link: '/api/' },
  100. { text: 'Config', link: '/config/' }, */
  101. {
  102. text: 'Ecosystem',
  103. items: [
  104. {
  105. text: `Cientos 💛`,
  106. link: 'https://cientos.tresjs.org/',
  107. },
  108. ],
  109. },
  110. ],
  111. socialLinks: [
  112. { icon: 'github', link: 'https://github.com/tresjs/tres' },
  113. { icon: 'twitter', link: 'https://twitter.com/tresjs_dev' },
  114. { icon: 'discord', link: 'https://discord.gg/UCr96AQmWn' },
  115. ],
  116. },
  117. vite: {
  118. optimizeDeps: {
  119. exclude: ['vitepress'],
  120. include: ['three'],
  121. },
  122. server: {
  123. hmr: {
  124. overlay: false,
  125. },
  126. },
  127. resolve: {
  128. alias: {
  129. '@tresjs/core': resolve(__dirname, '../../dist/tres.js'),
  130. },
  131. dedupe: ['@tresjs/cientos', 'three'],
  132. },
  133. },
  134. vue: {
  135. template: {
  136. compilerOptions: {
  137. isCustomElement: tag => tag.startsWith('Tres') && tag !== 'TresCanvas',
  138. },
  139. },
  140. },
  141. })