You’ve built an amazing WebXR experience! Now it’s time to optimize and deploy it so others can experience your creation. This chapter shows you how to build for production and deploy to GitHub Pages.
Production Build Process
Your starter app is already configured with Vite plugins that automatically optimize assets during build. When you run npm run build, it:
Bundles and minifies your JavaScript/TypeScript code.
Compresses GLTF models with Draco and optimizes textures.
Generates a deployable static site in the dist/ folder.
Building Your Project
Navigate to your project directory and run:
npm run build
This creates a dist/ folder with your optimized application. The build automatically:
Compresses your GLTF models using Draco compression.
Optimizes textures with KTX2 compression (when available).
Bundles and minifies JavaScript.
Copies public assets.
Asset Optimization
Your starter app includes the @iwsdk/vite-plugin-gltf-optimizer plugin that automatically compresses GLTF models and textures during build.
Current Configuration
In your vite.config.ts, you can see the optimizer is already configured:
The optimizer uses KTX2 compression by default for better texture compression. If you don’t have KTX-Software installed, you’ll see this warning:
⚠️ KTX-Software not found (missing "ktx" CLI). Skipping KTX2 compression.
Install from: https://github.com/KhronosGroup/KTX-Software/releases
The build won’t crash - it will fall back to standard texture optimization, but installing KTX-Software gives you better compression results. Download and install it from the KTX-Software releases page for optimal texture compression.
Advanced Configuration
For more control, you can customize specific options:
Congratulations! You’ve completed the IWSDK getting-started tutorial and successfully built and deployed your first WebXR application. You’ve now experienced the complete end-to-end workflow of IWSDK development - from creating basic 3D scenes to implementing custom systems and deploying optimized applications.
Throughout this tutorial, you’ve learned how to:
Set up IWSDK projects and load external assets.
Create professional environments with lighting and backgrounds.
Build interactive experiences with grabbing and locomotion.
Develop custom systems and components using ECS architecture.
Build and deploy IWSDK applications.
You now have the foundation to create professional WebXR experiences with IWSDK!