v0.1.8
Menu
Download

Vite Build Tool

Vite bundles the desktop React app that Tauri loads in main and mini webviews.

Root vite.config.ts enables @vitejs/plugin-react and @tailwindcss/vite. Dev server binds port 1420 with strictPort: true. tauri.conf.json points devUrl there for npm run tauri dev. The watch config ignores the src-tauri tree so Rust rebuild noise does not restart the frontend dev server.

Production path: beforeBuildCommand runs npm run build, which is tsc then vite build. Output lands in repo-root dist/, referenced as frontendDist in Tauri config. Tauri packages that folder into the NSIS/MSI installer.

Optional TAURI_DEV_HOST enables HMR over LAN (protocol ws on port 1421). Chunk size warnings above ~500 kB are a known heads-up, not a release blocker.

The marketing site in website/ is a separate Astro project with its own Vite instance (astro.config.mjs). Only the root Vite build feeds the desktop bundle.

In the repo

export default defineConfig(async () => ({
  plugins: [react(), tailwindcss()],
  clearScreen: false,
  server: {
    port: 1420,
    strictPort: true,
    host: host || false,
    hmr: host ? { protocol: "ws", host, port: 1421 } : undefined,
    watch: { ignored: ["**/src-tauri/**"] },
  },
}));
  "build": {
    "beforeDevCommand": "npm run dev",
    "devUrl": "http://localhost:1420",
    "beforeBuildCommand": "npm run build",
    "frontendDist": "../dist"

Where it shows up

  • Root vite.config.ts and package.json scripts (dev, build)
  • tauri.conf.json beforeBuildCommand, devUrl, frontendDist
  • Separate website/ Vite via Astro for Cloudflare Pages