Skip to content

Commit

Permalink
rewrite chapter 7 in Vite and r3f
Browse files Browse the repository at this point in the history
  • Loading branch information
mprcodes committed Mar 20, 2023
1 parent 444e801 commit b8822cb
Show file tree
Hide file tree
Showing 35 changed files with 2,166 additions and 6,701 deletions.
24 changes: 24 additions & 0 deletions 07 Cameras/Vite/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions 07 Cameras/Vite/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.14.2
18 changes: 18 additions & 0 deletions 07 Cameras/Vite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 07. Cameras

I've set up a custom Vite config to use TypeScript and Sass.

## Setup

Run this following commands to install the dependencies, start the development server, and build for production:

```bash
# Install dependencies (only the first time)
pnpm install

# Run the local server at localhost:5173
pnpm dev

# Build for production in the dist/ directory
pnpm build
```
15 changes: 15 additions & 0 deletions 07 Cameras/Vite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/threejs-journey-logo.svg" />
<title>04 - Local Server</title>
</head>
<body>
<canvas id="webgl"></canvas>

<script src="/src/index.ts" type="module"></script>
</body>
</html>
21 changes: 21 additions & 0 deletions 07 Cameras/Vite/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "vite-local-server",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"@types/three": "^0.149.0",
"gsap": "^3.11.4",
"sass": "^1.58.3",
"typescript": "^4.9.3",
"vite": "^4.1.0"
},
"dependencies": {
"three": "^0.150.1"
}
}
Loading

0 comments on commit b8822cb

Please sign in to comment.