Skip to content

Commit 79d49ec

Browse files
committed
Update README
1 parent 2cc02a9 commit 79d49ec

File tree

3 files changed

+75
-18
lines changed

3 files changed

+75
-18
lines changed

.github/demo.gif

3.49 MB
Loading

README.md

Lines changed: 71 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,89 @@
1-
# vue-tres-starter
1+
# Vue 3 + TresJS starter
22

3-
This template should help get you started developing with Vue 3 in Vite.
3+
![Short gif demonstrating how the starter works](./.github/demo.gif 'Demo GIF')
44

5-
## Recommended IDE Setup
5+
## What's included
66

7-
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
7+
### 1. Demo GLTF model
88

9-
## Customize configuration
9+
The `<Suzanne />` component in `/components/Suzanne` loads a custom GLTF model and uses a custom `ShaderMaterial`.
1010

11-
See [Vite Configuration Reference](https://vitejs.dev/config/).
11+
### 2. Box with click handler
1212

13-
## Project Setup
13+
The `<SampleBox />` component rotates and floats on every tick and has click/hover handlers.
1414

15-
```sh
15+
### 3. GSAP as a Vue Composable
16+
17+
GSAP is included as a composable and can be included in any component the following way:
18+
19+
```js
20+
import { useGSAP } from '@/composables/useGSAP'
21+
22+
const { gsap } = useGSAP()
23+
```
24+
25+
The composable file is located in `/src//composables/useGSAP.js`.
26+
27+
### 4. Pinia
28+
29+
[Pinia](https://pinia.vuejs.org/) is already included and configured.
30+
31+
The states are stored in the `/src//stores` folder.
32+
33+
## Setup
34+
35+
Make sure to install the dependencies:
36+
37+
```bash
38+
# yarn
39+
yarn install
40+
41+
# npm
42+
npm install
43+
44+
# pnpm
1645
pnpm install
1746
```
1847

19-
### Compile and Hot-Reload for Development
48+
## Development Server
49+
50+
Start the development server on `http://localhost:3000`
51+
52+
```bash
53+
# yarn
54+
yarn dev
55+
56+
# npm
57+
npm run dev
2058

21-
```sh
22-
pnpm dev
59+
# pnpm
60+
pnpm run dev
2361
```
2462

25-
### Compile and Minify for Production
63+
## Production
2664

27-
```sh
28-
pnpm build
65+
Build the application for production:
66+
67+
```bash
68+
# yarn
69+
yarn build
70+
71+
# npm
72+
npm run build
73+
74+
# pnpm
75+
pnpm run build
2976
```
3077

31-
### Lint with [ESLint](https://eslint.org/)
78+
Locally preview production build:
79+
80+
```bash
81+
# yarn
82+
yarn preview
83+
84+
# npm
85+
npm run preview
3286

33-
```sh
34-
pnpm lint
87+
# pnpm
88+
pnpm run preview
3589
```

vite.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { fileURLToPath, URL } from 'node:url'
2-
32
import { defineConfig } from 'vite'
43
import vue from '@vitejs/plugin-vue'
54
import glsl from 'vite-plugin-glsl'
65

76

87
// https://vitejs.dev/config/
98
export default defineConfig({
9+
server: {
10+
port: 3000
11+
},
12+
1013
plugins: [
1114
glsl(),
1215
vue({

0 commit comments

Comments
 (0)