Configure vite-plugin-tauri in Vite
masterTo use the plugin, import tauri from vite-plugin-tauri and add it to the plugins array in your vite.config.js.
It is highly recommended to set clearScreen: false and server.open: false to prevent the Vite development server from interfering with the Tauri CLI output or automatically opening a browser window.
// vite.config.js
import { defineConfig } from "vite";
import tauri from "vite-plugin-tauri"; // 1. import the plugin
export default defineConfig({
plugins: [
tauri(), // 2. add it to the plugins list
],
// 3. optional but recommended
clearScreen: false,
server: {
open: false,
},
});