用tree.js渲染立方体 关闭msedge同时关闭node进程 compounds同时关闭
cnpm install three
我怎么在msedge debug这个html
被ai气死
手写lauch.json
卧槽
忘记加“run”了
{"version": "0.2.0","configurations": [{"name": "Launch Edge with Vite Dev Server","type": "msedge","request": "launch","url": "http://localhost:5173", // 默认 Vite 的开发服务器地址"webRoot": "${workspaceFolder}","postDebugTask": "Kill Vite Dev Server"},{"type": "node","request": "launch","name": "Debug vite","runtimeExecutable": "npm","args": ["run","dev"],"console": "integratedTerminal"}],"compounds": [{"name": "Debug vite and Launch Edge","configurations": ["Debug vite", "Launch Edge with Vite Dev Server"]}]
}
{"version": "2.0.0","tasks": [{"label": "Kill Vite Dev Server","type": "shell","command": "taskkill /F /IM node.exe"}]
}
{"dependencies": {"three": "^0.176.0"},"devDependencies": {"vite": "^6.3.5"},"scripts": {"dev": "vite"
}
}
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8" /><title>Three.js + Vite</title>
</head>
<body><canvas id="scene"></canvas><script type="module">import * as THREE from 'three';const scene = new THREE.Scene();const camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHeight, 0.1, 1000);const renderer = new THREE.WebGLRenderer({ canvas: document.getElementById('scene') });renderer.setSize(window.innerWidth, window.innerHeight);const geometry = new THREE.BoxGeometry();const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });const cube = new THREE.Mesh(geometry, material);scene.add(cube);camera.position.z = 5;function animate() {requestAnimationFrame(animate);cube.rotation.x += 0.01;cube.rotation.y += 0.01;renderer.render(scene, camera);}animate();</script>
</body>
</html>