config.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. ['script', { defer: 'true', 'data-domain': 'tresjs.org', src: 'https://plausible.io/js/script.js' }],
  9. ],
  10. themeConfig: {
  11. logo: '/logo.svg',
  12. search: {
  13. provider: 'local',
  14. },
  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: 'Troubleshooting', link: '/guide/troubleshooting' },
  24. { text: 'Migrate from v1', link: '/guide/migration-guide' },
  25. ],
  26. },
  27. {
  28. text: 'API',
  29. items: [
  30. { text: 'Renderer', link: '/api/renderer' },
  31. {
  32. text: 'Instances, arguments and props',
  33. link: '/api/instances-arguments-and-props',
  34. },
  35. {
  36. text: 'Composables',
  37. link: '/api/composables',
  38. },
  39. {
  40. text: 'Events',
  41. link: '/api/events',
  42. },
  43. ],
  44. },
  45. {
  46. text: 'Examples',
  47. items: [
  48. { text: 'Orbit Controls', link: '/examples/orbit-controls' },
  49. { text: 'Basic Animations', link: '/examples/basic-animations' },
  50. { text: 'Groups', link: '/examples/groups' },
  51. { text: 'Load Textures', link: '/examples/load-textures' },
  52. { text: 'Load Models', link: '/examples/load-models' },
  53. { text: 'Load Text', link: '/examples/text-3d' },
  54. ],
  55. },
  56. {
  57. text: 'Advanced',
  58. items: [
  59. { text: 'Extending', link: '/advanced/extending' },
  60. {
  61. text: 'Caveats',
  62. link: '/advanced/caveats',
  63. },
  64. ],
  65. },
  66. {
  67. text: 'Ecosystem',
  68. items: [
  69. {
  70. text: `Cientos 💛`,
  71. link: 'https://cientos.tresjs.org/',
  72. },
  73. ],
  74. },
  75. ],
  76. nav: [
  77. { text: 'Guide', link: '/guide/' },
  78. { text: 'API', link: '/api/renderer' },
  79. /* { text: 'API', link: '/api/' },
  80. { text: 'Config', link: '/config/' }, */
  81. {
  82. text: 'Ecosystem',
  83. items: [
  84. {
  85. text: `Cientos 💛`,
  86. link: 'https://cientos.tresjs.org/',
  87. },
  88. ],
  89. },
  90. ],
  91. socialLinks: [
  92. { icon: 'github', link: 'https://github.com/tresjs/tres' },
  93. { icon: 'twitter', link: 'https://twitter.com/tresjs_dev' },
  94. { icon: 'discord', link: 'https://discord.gg/UCr96AQmWn' },
  95. ],
  96. },
  97. vite: {
  98. optimizeDeps: {
  99. exclude: ['vitepress'],
  100. include: ['three'],
  101. },
  102. server: {
  103. hmr: {
  104. overlay: false,
  105. },
  106. },
  107. resolve: {
  108. alias: {
  109. '@tresjs/core': resolve(__dirname, '../../dist/tres.js'),
  110. },
  111. dedupe: ['@tresjs/cientos', 'three'],
  112. },
  113. },
  114. vue: {
  115. template: {
  116. compilerOptions: {
  117. isCustomElement: tag => tag.startsWith('Tres') && tag !== 'TresCanvas',
  118. },
  119. },
  120. },
  121. })