1
0

shared.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import { resolve } from 'pathe'
  2. import { defineConfig } from 'vitepress'
  3. import { groupIconMdPlugin } from 'vitepress-plugin-group-icons'
  4. export const sharedConfig = defineConfig({
  5. title: 'TresJS',
  6. description: 'Declarative ThreeJS using Vue Components',
  7. head: [
  8. ['link', { rel: 'icon', type: 'image/svg', href: '/favicon.svg' }],
  9. ['meta', { name: 'theme-color', content: '#82DBC5' }],
  10. ['meta', { name: 'twitter:card', content: 'summary_large_image' }],
  11. ['meta', { name: 'twitter:site', content: '@tresjs_dev' }],
  12. ['meta', { name: 'twitter:creator', content: '@tresjs_dev' }],
  13. ['meta', { property: 'og:type', content: 'website' }],
  14. ['meta', { property: 'og:site_name', content: 'TresJS' }],
  15. [
  16. 'meta',
  17. {
  18. property: 'og:image',
  19. content: 'https://repository-images.githubusercontent.com/571314349/10996566-7f70-473b-a8e5-4e56fc0ca850',
  20. },
  21. ],
  22. [
  23. 'meta',
  24. {
  25. property: 'twitter:image',
  26. content: 'https://repository-images.githubusercontent.com/571314349/10996566-7f70-473b-a8e5-4e56fc0ca850',
  27. },
  28. ],
  29. ['script', { 'defer': 'true', 'data-domain': 'tresjs.org', 'src': 'https://plausible.io/js/script.js' }],
  30. ],
  31. themeConfig: {
  32. logo: '/logo.svg',
  33. search: {
  34. provider: 'local',
  35. options: {
  36. locales: {
  37. root: {
  38. translations: {
  39. button: {
  40. buttonText: 'Search',
  41. buttonAriaLabel: 'Search',
  42. },
  43. modal: {
  44. displayDetails: 'Display detailed list',
  45. resetButtonTitle: 'Reset search',
  46. backButtonTitle: 'Close search',
  47. noResultsText: 'No results for',
  48. footer: {
  49. selectText: 'to select',
  50. selectKeyAriaLabel: 'enter',
  51. navigateText: 'to navigate',
  52. navigateUpKeyAriaLabel: 'up arrow',
  53. navigateDownKeyAriaLabel: 'down arrow',
  54. closeText: 'to close',
  55. closeKeyAriaLabel: 'escape',
  56. },
  57. },
  58. },
  59. },
  60. },
  61. },
  62. },
  63. socialLinks: [
  64. { icon: 'github', link: 'https://github.com/tresjs/tres' },
  65. { icon: 'x', link: 'https://twitter.com/tresjs_dev' },
  66. { icon: 'discord', link: 'https://discord.gg/UCr96AQmWn' },
  67. ],
  68. },
  69. vite: {
  70. optimizeDeps: {
  71. exclude: ['vitepress'],
  72. include: ['@tresjs/cientos', '@stackblitz/sdk', '@vueuse/core', 'three'],
  73. },
  74. server: {
  75. hmr: {
  76. overlay: false,
  77. },
  78. },
  79. resolve: {
  80. alias: {
  81. '@tresjs/core': resolve(__dirname, '../../../dist/tres.js'),
  82. },
  83. dedupe: ['@tresjs/cientos', 'three'],
  84. },
  85. },
  86. vue: {
  87. template: {
  88. compilerOptions: {
  89. isCustomElement: tag => tag.startsWith('Tres') && tag !== 'TresCanvas',
  90. },
  91. },
  92. },
  93. markdown: {
  94. config: (md) => {
  95. md.use(groupIconMdPlugin)
  96. },
  97. },
  98. })