Skip to content

Instantly share code, notes, and snippets.

@guiseek
Last active April 21, 2024 14:59
Show Gist options
  • Save guiseek/022b373d9173a2afdf3442286636bcca to your computer and use it in GitHub Desktop.
Save guiseek/022b373d9173a2afdf3442286636bcca to your computer and use it in GitHub Desktop.
create vite project with three.js
#!/bin/bash
pnpm create vite@latest $1 --template vanilla-ts
cd $1
nvm use 20
pnpm add three
pnpm add -D @types/three sass
rm src/counter.ts
mv src/typescript.svg public/ts.svg
sed 's/vite\.svg/ts\.svg/g' index.html > temp.html
rm index.html
mv temp.html index.html
rm public/vite.svg
mv src/style.css src/style.scss
echo 'import "./style.scss";' > src/main.ts
echo "declare const app: HTMLDivElement" >> src/vite-env.d.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment