Integrates Tauri into a Vite project, enabling cross-platform desktop app development with seamless dev and build workflows. Current stable version is 4.0.0, which adds support for Tauri v2 and removes the debug, verbose, and target config options in favor of CLI arguments. The plugin is actively maintained and distributed as an ESM-only package. It ships TypeScript types and requires @tauri-apps/cli >=1 and vite >=2 as peer dependencies. Key differentiators include automatic detection of Tauri project initialization, support for separate Vite configs for Tauri, and CLI argument passthrough via -- -t or --tauri syntax. Version 3.1.0 introduced a default export alongside the named export, and version 3.0.2 removed internal modification of vite clearScreen and server.open settings.
npm install vite-plugin-tauriVerified import paths — ran on the pinned version, not inferred.
Shows how to install, import, and configure the plugin in a Vite config with optional but recommended settings.
Pass these options as Tauri CLI arguments, e.g., pnpm dev -- -t --verbose --release
Use import tauri from 'vite-plugin-tauri' instead of import { tauri } from 'vite-plugin-tauri'Use ES module import syntax in your project (set type:module in package.json or use .mjs files)
Manually set clearScreen: false and server.open: false in your Vite config if desired
Run 'npm install -D vite-plugin-tauri @tauri-apps/cli'
Switch to import statement: import tauri from 'vite-plugin-tauri' or set type:module in package.json
Ensure you import correctly: import tauri from 'vite-plugin-tauri' (default) or import { tauri } from 'vite-plugin-tauri' (named)Use -- -t or -- --tauri before Tauri arguments: npm run dev -- -- -t --verbose