Vite Demo – yFiles for HTML

This demo shows how to load yFiles for HTML with Vite as a loader for efficient web development and easy builds.

Additionally, a layout algorithm in a Web Worker thread without blocking the UI or main thread is loaded using Vite's built-in support for Web Workers.

First, install the required npm modules in the demo directory:

npm install

Then, start the Vite development server:

npm run dev

The Vite development server will launch the index file in a browser.

This demo supports Vite's Hot Module Replacement (HMR) abilities: When the server runs, try making changes to the demo source code and see how the app will be updated in the browser immediately.

The demo code uses module workers. Vite's development build relies on browser native support and therefore currently only works in some browsers (e.g., Chrome). These browsers only support this demo in production mode.

The demo can be built for production and subsequently served:

npm run build
npm run preview