{"id":24282249,"url":"https://github.com/tresjs/nuxt","last_synced_at":"2025-04-04T22:08:45.782Z","repository":{"id":174753959,"uuid":"652676957","full_name":"Tresjs/nuxt","owner":"Tresjs","description":"TresJS integration for Nuxt.","archived":false,"fork":false,"pushed_at":"2024-04-13T20:37:56.000Z","size":8872,"stargazers_count":171,"open_issues_count":16,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-13T20:45:38.996Z","etag":null,"topics":["3d","nuxt","nuxt-module","nuxt3","threejs","tresjs"],"latest_commit_sha":null,"homepage":"https://tresjs.org/","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tresjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["tresjs","alvarosabu"],"ko_fi":"alvarosaburido"}},"created_at":"2023-06-12T15:05:54.000Z","updated_at":"2024-06-06T08:40:14.866Z","dependencies_parsed_at":"2023-10-03T11:16:55.816Z","dependency_job_id":"e8cc0732-a3c0-4944-964d-6354af5ba161","html_url":"https://github.com/Tresjs/nuxt","commit_stats":null,"previous_names":["tresjs/nuxt"],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tresjs%2Fnuxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tresjs%2Fnuxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tresjs%2Fnuxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tresjs%2Fnuxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tresjs","download_url":"https://codeload.github.com/Tresjs/nuxt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256115,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","nuxt","nuxt-module","nuxt3","threejs","tresjs"],"created_at":"2025-01-16T03:19:18.494Z","updated_at":"2025-04-04T22:08:45.763Z","avatar_url":"https://github.com/Tresjs.png","language":"Vue","funding_links":["https://github.com/sponsors/tresjs","https://github.com/sponsors/alvarosabu","https://ko-fi.com/alvarosaburido"],"categories":[],"sub_categories":[],"readme":"![Repo banner](public/nuxt-tres-banner.png)\n\n# @tresjs/nuxt\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![License][license-src]][license-href]\n[![Nuxt][nuxt-src]][nuxt-href]\n\nOfficial Nuxt module for TresJS. Build 3D scenes as they were Vue components.\n\n- [✨ \u0026nbsp;Release Notes](/CHANGELOG.md)\n  \u003c!-- - [🏀 Online playground](https://stackblitz.com/github/@tresjs/nuxt?file=playground%2Fapp.vue) --\u003e\n- [📖 \u0026nbsp;Documentation](https://tresjs.org/guide/nuxt.html)\n\n## Features\n\n- 🤓 Auto-import components and composables from the [TresJS ecosystem](https://github.com/orgs/Tresjs/repositories)\n- `TresCanvas` client only, you don't need to add `.client` to the component name or `\u003cClientOnly /\u003e`\n- Automatically configures vue compiler to support TresJS components, see [why](https://tresjs.org/guide/troubleshooting.html#failed-resolve-component-trescomponent-%F0%9F%A4%94)?\n- All the DX Magic that comes with Nuxt ✨\n-  NEW v2: TresJS nuxt devtools.\n\n## Quick Setup\n\n1. Add `@tresjs/nuxt` dependency to your project\n\n```bash\nnpx nuxi@latest module add tresjs\n```\n\n2. Add `@tresjs/nuxt` to the `modules` section of `nuxt.config.ts`\n\n```js\nexport default defineNuxtConfig({\n  modules: ['@tresjs/nuxt'],\n})\n```\n\nThat's it! You can now use `@tresjs/nuxt` in your Nuxt app ✨\n\nIf you want to use the any package from the TresJS ecosystem, you can install the packages you want to use and they will be auto-imported by the module 🧙🏼‍♂️.\n\n```bash\n# Using pnpm\npnpm add @tresjs/cientos @tresjs/post-processing\n```\n\n## Devtools\n\n![Devtools](/public/tresjs-nuxt-devtools.png)\n\nTresJS nuxt module comes with a devtools extension that allows you to inspect the 3D scene and measure performance.\n\nTo activate the devtools, you need to add the `devtools` option to the `tres` section of `nuxt.config.ts`.\n\n```js\nexport default defineNuxtConfig({\n  modules: ['@tresjs/nuxt', '@nuxt/devtools'],\n  tres: {\n    devtools: true,\n  },\n})\n```\n\n## GLSL shaders support\n\nTresJS nuxt module comes with a vite plugin that allows you to import GLSL shaders as strings. It uses [`vite-plugin-glsl`](https://github.com/UstymUkhman/vite-plugin-glsl) under the hood.\n\n```js\nexport default defineNuxtConfig({\n  modules: ['@tresjs/nuxt', '@nuxt/devtools'],\n  tres: {\n    glsl: true,\n  },\n})\n```\n\nWith this option enabled, you can import GLSL shaders as strings in your components.\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\nimport fragmentShader from './shaders/fragment.glsl'\nimport vertexShader from './shaders/vertex.glsl'\n\nconst uniforms = {\n  uTime: { value: 0 },\n  uAmplitude: { value: new Vector2(0.1, 0.1) },\n  uFrequency: { value: new Vector2(20, 5) },\n}\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cTresMesh\n    :position=\"[0, 4, 0]\"\n  \u003e\n    \u003cTresSphereGeometry :args=\"[2, 32, 32]\" /\u003e\n    \u003cTresShaderMaterial\n      :vertex-shader=\"vertexShader\"\n      :fragment-shader=\"fragmentShader\"\n      :uniforms=\"uniforms\"\n    /\u003e\n  \u003c/TresMesh\u003e\n\u003c/template\u003e\n```\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Generate type stubs\nnpm run dev:prepare\n\n# Develop with the playground\nnpm run dev\n\n# Build the playground\nnpm run dev:build\n\n# Run ESLint\nnpm run lint\n\n# Run Vitest\nnpm run test\nnpm run test:watch\n\n# Release new version\nnpm run release\n```\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/@tresjs/nuxt/latest.svg?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\n[npm-version-href]: https://npmjs.com/package/@tresjs/nuxt\n[npm-downloads-src]: https://img.shields.io/npm/dm/@tresjs/nuxt.svg?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\n[npm-downloads-href]: https://npmjs.com/package/@tresjs/nuxt\n[license-src]: https://img.shields.io/npm/l/@tresjs/nuxt.svg?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\n[license-href]: https://npmjs.com/package/@tresjs/nuxt\n[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js\n[nuxt-href]: https://nuxt.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftresjs%2Fnuxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftresjs%2Fnuxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftresjs%2Fnuxt/lists"}