Skip to content

Commit 979b95d

Browse files
committed
docs: added package.json to docs and local search
1 parent 6c4577b commit 979b95d

File tree

8 files changed

+65
-6
lines changed

8 files changed

+65
-6
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ dist-ssr
2323
*.sln
2424
*.sw?
2525
docs/.vitepress/dist
26-
docs/.vitepress/cache
27-
.vitepress/cache
26+
docs/.vitepress/cache/deps/*.*

docs/.vitepress/config.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export default defineConfig({
1010
head: [['link', { rel: 'icon', type: 'image/svg', href: '/favicon.svg' }]],
1111
themeConfig: {
1212
logo: '/logo.svg',
13+
search: {
14+
provider: 'local',
15+
},
1316
// https://vitepress.dev/reference/default-theme-config
1417
nav: [
1518
{ text: 'Guide', link: '/guide/' },
@@ -90,10 +93,27 @@ export default defineConfig({
9093
],
9194
},
9295
vite: {
96+
optimizeDeps: {
97+
exclude: ['vitepress'],
98+
include: ['three'],
99+
},
100+
server: {
101+
hmr: {
102+
overlay: false,
103+
},
104+
},
93105
plugins: [svgLoader(), Unocss()],
94106
resolve: {
95107
alias: {
96-
'/@': resolve(__dirname, '../../src'),
108+
'@tresjs/cientos': resolve(__dirname, '../../dist/trescientos.js'),
109+
},
110+
dedupe: ['three'],
111+
},
112+
},
113+
vue: {
114+
template: {
115+
compilerOptions: {
116+
isCustomElement: tag => tag.startsWith('Tres') && tag !== 'TresCanvas',
97117
},
98118
},
99119
},

docs/.vitepress/theme/components/Feather.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { useGLTF, Levioso } from '/@'
2+
import { useGLTF, Levioso } from '@tresjs/cientos'
33
import { shallowRef } from 'vue'
44
import { watchEffect } from 'vue'
55
const { scene: feather, nodes } = await useGLTF('/feather.glb')

docs/.vitepress/theme/components/LeviosoDemo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { TresCanvas } from '@tresjs/core'
3-
import { OrbitControls, Levioso, GLTFModel } from '/@'
3+
import { OrbitControls, Levioso, GLTFModel } from '@tresjs/cientos'
44
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
55
import Feather from './Feather.vue'
66

docs/.vitepress/theme/components/WobbleMaterial.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { TresCanvas } from '@tresjs/core'
3-
import { OrbitControls, MeshWobbleMaterial } from '/@'
3+
import { OrbitControls, MeshWobbleMaterial } from '@tresjs/cientos'
44
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
55
66
const gl = {

docs/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "docs",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vitepress dev",
8+
"build": "vitepress build",
9+
"preview": "vitepress preview"
10+
},
11+
"devDependencies": {
12+
"unocss": "^0.51.13",
13+
"vite-svg-loader": "^4.0.0",
14+
"vitepress": "1.0.0-alpha.75"
15+
}
16+
}

docs/tsconfig.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"module": "esnext",
4+
"target": "esnext",
5+
"lib": ["DOM", "ESNext"],
6+
"strict": true,
7+
"esModuleInterop": true,
8+
"skipLibCheck": true,
9+
"jsx": "preserve",
10+
"noUnusedLocals": true,
11+
"moduleResolution": "node",
12+
"resolveJsonModule": true,
13+
"forceConsistentCasingInFileNames": true,
14+
"types": ["vite/client"]
15+
},
16+
"exclude": ["dist", "node_modules"]
17+
}

docs/vite.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vite'
2+
import Unocss from 'unocss/vite'
3+
import svgLoader from 'vite-svg-loader'
4+
5+
export default defineConfig({
6+
plugins: [svgLoader(), Unocss()],
7+
})

0 commit comments

Comments
 (0)