创建three.js项目[模块化开发]

257 阅读1分钟

parcel-bundler网址

gsap动画库

greensock.com/docs/v3/GSA…

快速开始 greensock.com/get-started…

1.新建文件夹:01-three-basic

2.打开终端:

npm init

npm install parcel-bundler --save-dev

3.把这个复制到package.json的对应位置

 "scripts": {
    "dev": "parcel <your entry file>",
    "build": "parcel build <your entry file>"
  },

4.package.json

{
  "name": "01-three-basic",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "parcel src/index.html",
    "build": "parcel build src/index.html"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "parcel-bundler": "^1.12.5"
  }
}

5.启动项目

image.png

6.安装three.js,gsap(动画库),dat.gui

npm install gsap dat.gui three