threejs-dev-setup
>-
>-
ALWAYS use this skill when the user mentions:
importmapthree package, aligning version with documentation, or TypeScript setup (@types/three where applicable)three/addons/..., examples/jsm, ESM vs CJS interop, or bare specifier resolutionIMPORTANT: this skill vs runtime topics
WebGLRenderer / WebGPURenderer, canvas, pixel ratio, render loop—after the project loads.GLTFLoader, DRACOLoader, progress callbacks—after imports resolve.Trigger phrases include:
importmap—each affects how three/addons/ resolves.three version to a release compatible with the docs the user cites; note that addon paths follow the published package layout.three; controls/loaders/effects from three/addons/... (mapped to examples/jsm in source tree). See examples/workflow-scaffold.md.requestAnimationFrame—enough to verify toolchain without duplicating threejs-renderers depth.moduleResolution appropriate for bundler; reference types from three package typings; avoid duplicating global script tag patterns unless user targets no-bundler HTML.window/document).| Docs section | Representative links | |--------------|----------------------| | Manual (getting started) | https://threejs.org/manual/ | | Docs index | https://threejs.org/docs/ | | Package / install context | https://www.npmjs.com/package/three |
three copies in one page breaks singletons; dedupe with bundler aliases.node_modules/.../examples/jsm paths is fragile; prefer package exports three/addons/... when available.Toolchain and import paths follow the three npm package version the user installs. The Manual and docs are updated with the library; addon paths (three/addons/...) must match the package layout for that release—when in doubt, cite the version number and the exact import line from the current docs.
When answering under this skill, prefer responses that:
importmap) and the intended three version.three in package.json / lockfile when duplicate singleton issues appear.English: three.js, vite, webpack, rollup, import map, typescript, npm, three/addons, examples jsm, module resolution, scaffold
中文: three.js 安装、构建、importmap、模块解析、three/addons、脚手架、Vite、Webpack
确保开发环境已安装必要的依赖和工具。
根据项目需求进行基础配置。
按照示例代码实现核心功能。
运行测试确保功能正常。
完成开发后进行部署和监控。