|
| 1 | +import { defineConfig } from 'vitepress' |
| 2 | +import { resolve } from 'pathe' |
| 3 | + |
| 4 | +const whitelist = ['TresCanvas', 'TresLeches', 'TresScene'] |
| 5 | + |
| 6 | +// https://vitepress.dev/reference/site-config |
| 7 | +export default defineConfig({ |
| 8 | + title: 'Tres Rapier', |
| 9 | + description: |
| 10 | + 'We`ll make you love physics again', |
| 11 | + head: [ |
| 12 | + ['link', { rel: 'icon', type: 'image/svg', href: '/favicon.svg' }], |
| 13 | + ['meta', { name: 'theme-color', content: '#82DBC5' }], |
| 14 | + ['meta', { name: 'twitter:card', content: 'summary_large_image' }], |
| 15 | + ['meta', { name: 'twitter:site', content: '@tresjs_dev' }], |
| 16 | + ['meta', { name: 'twitter:creator', content: '@tresjs_dev' }], |
| 17 | + ['meta', { property: 'og:type', content: 'website' }], |
| 18 | + ['meta', { property: 'og:site_name', content: 'rapier - TresJS' }], |
| 19 | + [ |
| 20 | + 'meta', |
| 21 | + { |
| 22 | + property: 'og:image', |
| 23 | + content: |
| 24 | + 'https://repository-images.githubusercontent.com/571314349/10996566-7f70-473b-a8e5-4e56fc0ca850', |
| 25 | + }, |
| 26 | + ], |
| 27 | + [ |
| 28 | + 'meta', |
| 29 | + { |
| 30 | + property: 'twitter:image', |
| 31 | + content: |
| 32 | + 'https://repository-images.githubusercontent.com/571314349/10996566-7f70-473b-a8e5-4e56fc0ca850', |
| 33 | + }, |
| 34 | + ], |
| 35 | + [ |
| 36 | + 'script', |
| 37 | + { |
| 38 | + 'defer': 'true', |
| 39 | + 'data-site': 'OWBUVCJK', |
| 40 | + 'src': 'https://cdn.usefathom.com/script.js', |
| 41 | + }, |
| 42 | + ], |
| 43 | + ], |
| 44 | + themeConfig: { |
| 45 | + logo: '/logo.svg', |
| 46 | + search: { |
| 47 | + provider: 'local', |
| 48 | + }, |
| 49 | + // https://vitepress.dev/reference/default-theme-config |
| 50 | + nav: [ |
| 51 | + { text: 'Guide', link: '/guide/' }, |
| 52 | + { text: 'Examples', link: 'https://lab.tresjs.org/' }, |
| 53 | + ], |
| 54 | + |
| 55 | + sidebar: [ |
| 56 | + { |
| 57 | + text: 'Guide', |
| 58 | + items: [ |
| 59 | + { text: 'Introduction', link: '/guide/' }, |
| 60 | + { text: 'How does it work?', link: '/guide/how-does-it-work' }, |
| 61 | + ], |
| 62 | + }, |
| 63 | + { |
| 64 | + text: 'Components', |
| 65 | + items: [ |
| 66 | + { text: 'Physics', link: '/components/physics' }, |
| 67 | + { text: 'RigidBody', link: '/components/rigid-body' }, |
| 68 | + { text: 'Collider', link: '/components/collider' }, |
| 69 | + ], |
| 70 | + }, |
| 71 | + { |
| 72 | + text: 'Composables', |
| 73 | + items: [ |
| 74 | + ], |
| 75 | + }, |
| 76 | + ], |
| 77 | + |
| 78 | + socialLinks: [ |
| 79 | + { icon: 'github', link: 'https://github.com/Tresjs/rapier' }, |
| 80 | + { icon: 'twitter', link: 'https://twitter.com/tresjs_dev' }, |
| 81 | + { icon: 'discord', link: 'https://discord.gg/UCr96AQmWn' }, |
| 82 | + ], |
| 83 | + }, |
| 84 | + vite: { |
| 85 | + optimizeDeps: { |
| 86 | + exclude: ['vitepress'], |
| 87 | + include: ['three'], |
| 88 | + }, |
| 89 | + server: { |
| 90 | + hmr: { |
| 91 | + overlay: false, |
| 92 | + }, |
| 93 | + }, |
| 94 | + resolve: { |
| 95 | + alias: { |
| 96 | + '@tresjs/rapier': resolve(__dirname, '../../dist/tresrapier.js'), |
| 97 | + }, |
| 98 | + dedupe: ['three'], |
| 99 | + }, |
| 100 | + }, |
| 101 | + vue: { |
| 102 | + template: { |
| 103 | + compilerOptions: { |
| 104 | + isCustomElement: (tag: string) => |
| 105 | + (tag.startsWith('Tres') && !whitelist.includes(tag)) |
| 106 | + || tag === 'primitive', |
| 107 | + }, |
| 108 | + }, |
| 109 | + }, |
| 110 | +}) |
0 commit comments