Vite Loading Demo
This demo shows how to load yFiles for HTML with Vite as a loader for efficient web development and easy builds.
Also 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.
Running the demo
First, install the required npm modules in the demo directory:
> npm install
Now the Vite development server can be started:
> npm run dev
The Vite development server will launch the index file in a browser.
The Vite loading 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 browser (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 serve