Overview:
The TresJS Nuxt module is the official module for integrating TresJS with Nuxt. TresJS is a library for building 3D scenes as Vue components. This module provides a seamless integration between TresJS and Nuxt, allowing developers to easily import components and composables from the TresJS ecosystem and configure the Vue compiler to support TresJS components. It also includes the TresJS Nuxt devtools for inspecting 3D scenes and measuring performance. This module simplifies the process of integrating TresJS into Nuxt projects and enhances the development experience.
Features:
- Auto-import components and composables from the TresJS ecosystem.
- TresCanvas client only, no need to add “.client” to component names or use
<ClientOnly />
. - Automatic configuration of Vue compiler to support TresJS components.
- Includes all the developer experience (DX) magic that comes with Nuxt.
Installation:
To install the TresJS Nuxt module, follow these steps:
- Add
@tresjs/nuxt
as a dependency to your project. - Add
@tresjs/nuxt
to the modules section of yournuxt.config.ts
file.
That’s it! You can now use @tresjs/nuxt
in your Nuxt app. If you want to use any package from the TresJS ecosystem, you can install the desired packages and they will be automatically imported by the module.
Summary:
The TresJS Nuxt module provides seamless integration between TresJS and Nuxt, allowing developers to easily build 3D scenes as Vue components. It simplifies the process of importing components from the TresJS ecosystem, configures the Vue compiler to support TresJS components, and includes the TresJS Nuxt devtools for inspecting scenes and measuring performance. Overall, this module enhances the development experience when using TresJS in Nuxt projects.