Instead of battling with Vite (e.g. https://github.com/vitejs/vite/issues/4863) and its configs, I have decided to drop it and to use esbuild directly. Builds are now 6x faster if running the script directly (not via PNPM). This has other advantages:
we can fine-tune the output of CSS and JS without relying on too many other plugins and dependencies
we can later re-use the esbuild dev server to build docs (see #102)
Instead of battling with Vite (e.g. https://github.com/vitejs/vite/issues/4863) and its configs, I have decided to drop it and to use esbuild directly. Builds are now 6x faster if running the script directly (not via PNPM). This has other advantages: