config.ts 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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-site': 'OWBUVCJK', src: 'https://cdn.usefathom.com/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: 'Nuxt', link: '/guide/nuxt' },
  44. { text: 'Troubleshooting', link: '/guide/troubleshooting' },
  45. { text: 'Migrate from v1', link: '/guide/migration-guide' },
  46. ],
  47. },
  48. {
  49. text: 'API',
  50. items: [
  51. { text: 'TresCanvas', link: '/api/tres-canvas' },
  52. {
  53. text: 'Instances, arguments and props',
  54. link: '/api/instances-arguments-and-props',
  55. },
  56. {
  57. text: 'Composables',
  58. link: '/api/composables',
  59. },
  60. {
  61. text: 'Events',
  62. link: '/api/events',
  63. },
  64. ],
  65. },
  66. {
  67. text: 'Advanced',
  68. items: [
  69. { text: 'Extending', link: '/advanced/extending' },
  70. { text: 'primitive', link: '/advanced/primitive' },
  71. {
  72. text: 'Caveats',
  73. link: '/advanced/caveats',
  74. },
  75. ],
  76. },
  77. {
  78. text: 'Debug',
  79. items: [
  80. { text: 'Devtools', link: '/debug/devtools' },
  81. ],
  82. },
  83. {
  84. text: 'Examples',
  85. collapsed: true,
  86. items: [
  87. { text: 'Orbit Controls', link: '/examples/orbit-controls' },
  88. { text: 'Basic Animations', link: '/examples/basic-animations' },
  89. { text: 'Groups', link: '/examples/groups' },
  90. { text: 'Load Textures', link: '/examples/load-textures' },
  91. { text: 'Load Models', link: '/examples/load-models' },
  92. { text: 'Load Text', link: '/examples/text-3d' },
  93. { text: 'Lights & Shadows', link: '/examples/lights-shadows' },
  94. { text: 'Shaders', link: '/examples/shaders' },
  95. ],
  96. },
  97. {
  98. text: 'Directives',
  99. collapsed: true,
  100. items: [
  101. { text: 'v-log', link: '/directives/v-log' },
  102. { text: 'v-light-helper', link: '/directives/v-light-helper' },
  103. { text: 'v-always-look-at', link: '/directives/v-always-look-at' },
  104. { text: 'v-distance-to', link: '/directives/v-distance-to' },
  105. ],
  106. },
  107. {
  108. text: 'Ecosystem',
  109. items: [
  110. {
  111. text: 'Cientos 💛',
  112. link: 'https://cientos.tresjs.org/',
  113. },
  114. {
  115. text: 'Nuxt module',
  116. link: 'https://github.com/Tresjs/nuxt',
  117. },
  118. {
  119. text: 'TresLeches 🍰',
  120. link: 'https://tresleches.tresjs.org/',
  121. },
  122. {
  123. text: 'Post-processing (Soon)',
  124. },
  125. ],
  126. },
  127. ],
  128. nav: [
  129. { text: 'Guide', link: '/guide/' },
  130. { text: 'API', link: '/api/tres-canvas' },
  131. /* { text: 'API', link: '/api/' },
  132. { text: 'Config', link: '/config/' }, */
  133. { text: 'Resources',
  134. items: [
  135. { text: 'Team', link: '/team' },
  136. { text: 'Releases', link: 'https://github.com/Tresjs/tres/releases' },
  137. {
  138. text: 'Playground',
  139. link: 'https://playground.tresjs.org/',
  140. },
  141. {
  142. text: 'Github',
  143. link: 'https://github.com/Tresjs/tres/',
  144. },
  145. {
  146. text: 'Issues',
  147. link: 'https://github.com/Tresjs/tres/issues',
  148. },
  149. {
  150. text: 'Ecosystem',
  151. items: [
  152. {
  153. text: 'Cientos 💛',
  154. link: 'https://cientos.tresjs.org/',
  155. },
  156. {
  157. text: 'Nuxt module',
  158. link: 'https://github.com/Tresjs/nuxt',
  159. },
  160. {
  161. text: 'TresLeches 🍰',
  162. link: 'https://tresleches.tresjs.org/',
  163. },
  164. ],
  165. },
  166. ],
  167. },
  168. ],
  169. socialLinks: [
  170. { icon: 'github', link: 'https://github.com/tresjs/tres' },
  171. { icon: 'x', link: 'https://twitter.com/tresjs_dev' },
  172. { icon: 'discord', link: 'https://discord.gg/UCr96AQmWn' },
  173. ],
  174. },
  175. vite: {
  176. optimizeDeps: {
  177. exclude: ['vitepress'],
  178. include: ['three'],
  179. },
  180. server: {
  181. hmr: {
  182. overlay: false,
  183. },
  184. },
  185. resolve: {
  186. alias: {
  187. '@tresjs/core': resolve(__dirname, '../../dist/tres.js'),
  188. },
  189. dedupe: ['@tresjs/cientos', 'three'],
  190. },
  191. },
  192. vue: {
  193. template: {
  194. compilerOptions: {
  195. isCustomElement: tag => tag.startsWith('Tres') && tag !== 'TresCanvas',
  196. },
  197. },
  198. },
  199. })