Skip to content

Add optional Vite build system

Emiel Wiedijk requested to merge vitejs into master

ViteJS has several advantages over the current webpack build: much faster build times, easier configuration and a better working development setup (for example with auto-reloading). However, a rework of the frontend build system introduces many sources of, potentially subtle, bugs. This MR introduces Vite as a (for now) alternative build system.

For development outside Docker, Vite needs to be enable manually using the VITE_SERVER environment variable. For development in Docker, Vite is enabled automatically. Production still uses the existing webpack build system.

The use of the Vite development server in Docker also simplifies the setup. Previously, a webpack process that watched the frontend files was included in the backend server. The new Vite development server is now run in a separate service that is exposed to the host. Flask, detects the Vite server, and includes the CSS/JS files in the base template. These CSS/Js files are then loaded directly from the browser to the Vite server.

Supersedes: !1108 (closed)

Merge request reports