You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// vite.config.jsimport{defineConfig}from"vite";importtaurifrom"vite-plugin-tauri";// 1. import the pluginexportdefaultdefineConfig({plugins: [tauri(),// 2. add it to the plugins list],// 3. optional but recommendedclearScreen: false,server: {open: false,},});
Tauri CLI arguments
You can pass arguments to the tauri CLI by prefixing the args with -- -t/--tauri, for example:
pnpm dev -- -t --verbose --release
The -- is necessary, otherwise vite will crash with unkown CLI argument and -t or --tauri marks the start of the tauri arguments.
Advanced Usage
Using a separate config for Tauri
You can also use a separate config file to add the vite-plugin-tauri plugin
which allows you to define a separate script in package.json to develop
your tauri app that won't conflict with your normal vite web development flow.
Create a vite.config.tauri.js with the following content
import{defineConfig,mergeConfig}from"vite";importbaseViteConfigfrom"./vite.config";importtaurifrom"vite-plugin-tauri";exportdefaultdefineConfig(mergeConfig(baseViteConfig,{plugins: [tauri()],// optional but recommendedclearScreen: false,server: {open: false,},}),);