I have an answer: If you create a webGL three.js website, you should place the resource files .gltf .glb, etc. in the Public directory.
Node: node -v v20.18.1 npm -v 10.8.2
create project:
npm create vite@latest mynameProjectGame -- --template vanilla-ts npm install @types/three three npm install npm run dev
1.install three version
"dependencies": {
"@types/three": "^0.171.0",
"three": "^0.171.0"
}
2. Edit file typescript.json
"types": ["vite","three"]