Minimal setup for a WebXR project using Vite, Babylon.js, TypeScript, and Vue

Overview

WebXR-Vite-Babylon-Simple

Minimal setup for WebXR development using:

Intentionally made minimal changes from the default vite scaffolding.

Uses the ES6 packaging from Babylon.js and tree shaking. With this repo and babylon.js 5.0.0-beta.7, vite is reporting a vendor build size of 2.5MB (562k gzipped). If importing all of @babylonjs/core, the build size goes to ~4MB.

This repo includes enough setup so that controller models can be loaded for supported XR devices. This requires making sure the GLTF/GLB loader is active.

Notes

Setup has become straight-forward in recent Babylon.js 5.x beta releases. What required the most time was figuring out the correct ES6 imports to allow for optimal tree shaking. (If tree shaking is not needed, simply importing everything from @babylonjs/core works.)

Relevant files:

A similar project setup, but that does not use vue, is available here:

A more advanced project, with bootstrap and opinionated setup, is located here:

Usage

Developed and tested with node 16.x, but 14.x probably works too.

  • npm install
  • npm run dev

Or, to allow access over network:

  • npm run dev -- --host=0.0.0.0

Browse:

  • https:// :3443

HTTPS security warnings are expected. Certain WebXR functionality requires HTTPS, but it seems to work with self-signed certs, at least on Oculus Quest 2.

Be sure that host firewall allows 3443. And if using docker, that any port redirects are setup, etc.

The code adds an ArcRotateCamera for the initial non-immersive view to allow moving around scene with a mouse. To interact in an immersive view on a desktop browser, the WebXR emulator extension works. However, it's cumbersome to use.

The vite dev server will automatically rebuild and hot reload source changes, almost instantly.

To fully validate the typescript types and check resulting dist bundle sizes:

  • npm run build

ScreenShot

Screenshot from within Meta/Oculus Quest 2 browser (v37, 2022-02):

screenshot

You might also like...

Basic https setup using an automatically generated self-signed certificate

@vitejs/plugin-basic-ssl A plugin to generate untrusted certificates which still allows to access the page after proceeding a wall with warning. In mo

Jan 2, 2023

:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin

:tada: A magical vue admin                                                                https://panjiachen.github.io/vue-element-admin

English | 简体中文 | 日本語 | Spanish SPONSORED BY 活动服务销售平台 客户消息直达工作群 Introduction vue-element-admin is a production-ready front-end solution for admin inter

Dec 31, 2022

:eyes: Vue in React, React in Vue. Seamless integration of the two. :dancers:

vuera NOTE: This project is looking for a maintainer! Use Vue components in your React app: import React from 'react' import MyVueComponent from './My

Dec 30, 2022

Jenesius vue modal is simple library for Vue 3 only

Jenesius Vue Modal Jenesius vue modal is simple library for Vue 3 only . Site Documentation Installation npm i jenesius-vue-modal For add modals in yo

Dec 30, 2022

Vite template with TypeScript, Chakra UI, Eslint Airbnb, Prettier

Vite + Typescript + ChakraUI = ❤️ This is a vite template that combines several technologies: Vite React TypeScript ChakraUI Eslint with eslint-config

Mar 26, 2022

vue3 + vite + typescript template

Vue 3 + Typescript + Vite This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 script setu

Aug 1, 2022

Modern ThreeJS boilerplate powered by Vite & Typescript

Modern ThreeJS boilerplate powered by Vite & Typescript

Modern ThreeJS ⚡️ Modern ThreeJS boilerplate powered by Vite & Typescript. Features Powered with Vite 📦 GUI controls using Tweakpane 🎛 Typescript 🦾

Jan 4, 2023

Experimenting with vite typescript template rewrite for hot.opensauced.pizza

Experimenting with vite typescript template rewrite for hot.opensauced.pizza

🍕 Open Sauced Vite Typescript Template Test 🍕 The path to your next Open Source contribution 📖 Prerequisites In order to run the project we need th

Mar 11, 2022

Chrome Extension Boilerplate with SolidJS + Vite + TypeScript + Manifest V3 + Hot Relaod

Chrome Extension Boilerplate with SolidJS + Vite + TypeScript + Manifest V3 + Hot Relaod

Chrome Extension Boilerplate with SolidJS + Vite + TypeScript + Manifest V3 + Hot Relaod Intro This boilerplate is made for creating chrome extensions

Dec 27, 2022
Veloce: Starter template that uses Vue 3, Vite, TypeScript, SSR, Pinia, Vue Router, Express and Docker

Veloce Lightning-fast cold server start Instant hot module replacement (HMR) and dev SSR True on-demand compilation Tech Stack Vue 3: UI Rendering lib

Alan Morel 10 Oct 7, 2022
Vue 3 + Vite + SSR template based on Vite Plugin SSR and inspired by Vitesse

Vite Vue SSR Starter Vue 3 + Vite + SSR template based on Vite Plugin SSR and inspired by Vitesse Features ⚡️ Vue 3, Vite 2, TypeScript ?? Domain-Driv

Oleg Koval 10 Aug 2, 2022
A template repository / quick start to build Azure Static Web Apps with a Node.js function. It uses Vue.js v3, Vue Router, Vuex, and Vite.js.

Azure Static Web App Template with Node.js API This is a template repository for creating Azure Static Web Apps that comes pre-configured with: Vue.js

Marc Duiker 6 Jun 25, 2022
🎉 基于 vite 2.0 + vue 3.0 + vue-router 4.0 + vuex 4.0 + element-plus 的后台管理系统vue3-element-admin

vue3-element-admin ?? 基于 Vite 2.0 + Vue3.0 + Vue-Router 4.0 + Vuex 4.0 + element-plus 的后台管理系统 简介 vue3-element-admin 是一个后台前端解决方案,它基于 vue3 和 element-plu

雪月欧巴 84 Nov 28, 2022
vite+vue3.2+setup+elementPlus+eslint+js+stylelint

前期准备工作,npm包和vscode配置 !!!很重要,关乎整个Vue3开发阶段的代码提示 Volar使用 使用Vue3开发需要禁用vscode插件Vetur 然后安装 Volar(Vue Language Features),这样Vue3代码提示即使是使用js开发也非常友好 如果volar没有任何

null 2 Feb 8, 2022
Light speed setup for MEVN(Mongo Express Vue Node) Apps

Light speed setup for MEVN stack based web-apps Chat: Telegram Donate: PayPal, Open Collective, Patreon A CLI tool for getting started with the MEVN s

madlabsinc 791 Dec 14, 2022
Vite-plugin-web-extension - A vite plugin for generating cross browser platform, ES module based web extensions.

vite-plugin-web-extension A vite plugin for generating cross browser platform, ES module based web extensions. Features Manifest V2 & V3 Support Compl

Ruben Medina 81 Dec 31, 2022
A plugin that can help you create project friendly with Vue for @vue/cli 4.5

vue-cli-plugin-patch A plugin that can help you create project friendly with Vue for @vue/cli 4.5. Install First you need to install @vue/cli globally

null 2 Jan 6, 2022
Using Cypress with Vite, React, TypeScript, MSW and react-query

Vie + Cypress + MSW + react-query Demo Example of using Cypress with Vite, MSW and react-query. Uses the appReady pattern to signal to Cypress when th

Rob Caldecott 9 Jul 16, 2022
Mosha-vue-toastify - A light weight and fun Vue 3 toast or notification or snack bar or however you wanna call it library.

Mosha Vue Toastify A lightweight and fun Vue 3 toast or notification or snack bar or however you wanna call it library. English | 简体中文 Talk is cheap,

Baidi Liu 187 Jan 2, 2023