shared.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { defineConfig } from 'vitepress'
  2. import { resolve } from 'pathe'
  3. export const sharedConfig = 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. socialLinks: [
  33. { icon: 'github', link: 'https://github.com/tresjs/tres' },
  34. { icon: 'x', link: 'https://twitter.com/tresjs_dev' },
  35. { icon: 'discord', link: 'https://discord.gg/UCr96AQmWn' },
  36. ],
  37. },
  38. vite: {
  39. optimizeDeps: {
  40. exclude: ['vitepress'],
  41. include: ['three'],
  42. },
  43. server: {
  44. hmr: {
  45. overlay: false,
  46. },
  47. },
  48. resolve: {
  49. alias: {
  50. '@tresjs/core': resolve(__dirname, '../../../dist/tres.js'),
  51. },
  52. dedupe: ['@tresjs/cientos', 'three'],
  53. },
  54. },
  55. vue: {
  56. template: {
  57. compilerOptions: {
  58. isCustomElement: tag => tag.startsWith('Tres') && tag !== 'TresCanvas',
  59. },
  60. },
  61. },
  62. })