{
  "name": "unplugin-object-3d",
  "version": "0.2.1",
  "description": "Import 3d objects with obj, mtl and textures whilte importing .obj file",
  "keywords": [
    "unplugin",
    "vite",
    "webpack",
    "rollup",
    "transform",
    "obj",
    "mtl",
    "textures"
  ],
  "homepage": "https://github.com/m0ksem/unplugin-object-3d",
  "bugs": {
    "url": "https://github.com/m0ksem/unplugin-object-3d/issues"
  },
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/m0ksem/unplugin-object-3d"
  },
  "main": "dist/index.js",
  "module": "dist/index.mjs",
  "types": "dist/index.d.ts",
  "exports": {
    ".": {
      "require": "./dist/index.js",
      "import": "./dist/index.mjs"
    },
    "./vite": {
      "require": "./dist/vite.js",
      "import": "./dist/vite.mjs"
    },
    "./webpack": {
      "require": "./dist/webpack.js",
      "import": "./dist/webpack.mjs"
    },
    "./rollup": {
      "require": "./dist/rollup.js",
      "import": "./dist/rollup.mjs"
    },
    "./nuxt": {
      "require": "./dist/nuxt.js",
      "import": "./dist/nuxt.mjs"
    },
    "./types": {
      "require": "./dist/types.js",
      "import": "./dist/types.mjs"
    },
    "./internal/*": {
      "require": "./dist/exports/*.js",
      "import": "./dist/exports/*.mjs"
    },
    "./*": "./*"
  },
  "files": [
    "dist",
    "*.d.ts"
  ],
  "dependencies": {
    "unplugin": "^0.6.3"
  },
  "peerDependencies": {
    "three": "*"
  },
  "devDependencies": {
    "@antfu/eslint-config": "^0.23.1",
    "@types/node": "^17.0.34",
    "bumpp": "^7.1.1",
    "eslint": "^8.15.0",
    "esno": "^0.16.3",
    "fast-glob": "^3.2.11",
    "nodemon": "^2.0.16",
    "rimraf": "^3.0.2",
    "rollup": "^2.74.0",
    "tsup": "^5.12.8",
    "typescript": "^4.7.4",
    "vite": "^2.9.9",
    "vitest": "^0.12.6",
    "webpack": "^5.72.1"
  },
  "scripts": {
    "build": "tsup",
    "dev": "tsup --watch src",
    "build:fix": "esno scripts/postbuild.ts",
    "lint": "eslint .",
    "play": "npm -C playground run dev",
    "release": "bumpp --commit --push --tag && pnpm publish",
    "start": "esno src/index.ts",
    "test": "vitest"
  },
  "readme": "# unplugin-object-3d\n\nCreate ThreeJS object with one line of code\n\n## Install\n\n```bash\nnpm i unplugin-object-3d\n# or\nyarn add unplugin-object-3d\n# or\npnpm i unplugin-object-3d\n```\n\n<details>\n<summary>Vite</summary><br>\n\n```ts\n// vite.config.ts\nimport Object3d from 'unplugin-object-3d/vite'\n\nexport default defineConfig({\n  plugins: [\n    Object3d({ /* options */ }),\n  ],\n})\n```\n\nExample: [`playground/`](./playground/)\n\n<br></details>\n\n<details>\n<summary>Rollup</summary><br>\n\n```ts\n// rollup.config.js\nimport Object3d from 'unplugin-object-3d/rollup'\n\nexport default {\n  plugins: [\n    Object3d({ /* options */ }),\n  ],\n}\n```\n\n<br></details>\n\n\n<details>\n<summary>Webpack</summary><br>\n\n```ts\n// webpack.config.js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    require('unplugin-object-3d/webpack')({ /* options */ })\n  ]\n}\n```\n\n<br></details>\n\n<details>\n<summary>Nuxt</summary><br>\n\n```ts\n// nuxt.config.js\nexport default {\n  buildModules: [\n    ['unplugin-object-3d/nuxt', { /* options */ }],\n  ],\n}\n```\n\n> This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)\n\n<br></details>\n\n<details>\n<summary>Vue CLI</summary><br>\n\n```ts\n// vue.config.js\nmodule.exports = {\n  configureWebpack: {\n    plugins: [\n      require('unplugin-object-3d/webpack')({ /* options */ }),\n    ],\n  },\n}\n```\n\n<br></details>\n\n## Supported loader extensions\n- `.obj`\n- `.glb` and `.gltf`\n\n## How it works?\nPlugin load `.obj`, scan for `mtl` libs and trying to load them. From mtl plugin also trying to load textures. Plugin return ThreeJS Object3d.\nFor `.glb` and `.gltf` files plugin load them asynchronously and adds methods for animations.\n\n## Example\n```js\nimport house from 'house.obj?three'\nimport car from 'car.glb?three'\n// ...\nscene.add(house).add(car)\n//...\nconst render = () => {\n  requestAnimationFrame(render)\n  // ...\n  car.animate()\n}\n```\nExample: [`playground`](./playground/main.ts)\n\n## Plugin options\n\n| Option | Type | Description  |\n|---|---|---|\n|warnings | `boolean`  | If `.obj` file require texture or mtl file that can not be found plugin will throw warning. You can turn off warnings by passing `warnings: false` in plugin options if you don't care about missing assets.    |\n|draco|`boolean`| Use draco loader for GLB and GLTF models |\n|   |   |   |\n\n\n> Make sure change absolute paths to relative in `.obj` and `.mtl`\n\n## Concepts and extensions\n\nFor `.glb` and `.gltf` plugin uses [`Async3dObject`](./src/exports/async-3d-object.ts). To keep your code clean async model can be added to scene. You can also listen to load event. It also adds `animate` method, so you can simply call it in render function.\n```ts\nscene.add(car)\n\nconst render = () => {\n  car.animate()\n}\n\ncar.addEventListener('loaded', () => { /* ... */ })\n```\n`.obj` loads synchronously.\n\n## Types\nMake sure `files.d.ts` included in your tsconfig to have TS suggestion for imports.\n<details>\n<summary>tsconfig.json example</summary><br>\n\n```ts\n{\n  \"include\": [\"node_modules/unplugin-3d-object/files.d.ts\"],\n  ...\n}\n```\n\n<br></details>\n"
}