A Vite plugin to seamlessly integrate with Tauri.
- π Auto Integration Automatically initializes and integrates Tauri with your Vite project
- π οΈ Dev Mode Launches Tauri alongside your Vite dev server
- π¦ Build Ready Configures Tauri build with your Vite output directory
- π§° CLI Passthrough Supports passing Tauri CLI arguments for advanced configurations
- π Multi-Environment Works across different platforms with proper configuration
- πΌ Zero Config Works out of the box with sensible defaults
- π§ Smart Detection Automatically detects your Tauri configuration file
- π System Tray Easily add system tray functionality to your desktop applications
npm install -D @stacksjs/vite-plugin-tauri
# or
yarn add -D @stacksjs/vite-plugin-tauri
# or
pnpm add -D @stacksjs/vite-plugin-tauri
# or
bun add -D @stacksjs/vite-plugin-tauri
// vite.config.ts
import { defineConfig } from 'vite'
import Tauri from 'vite-plugin-tauri'
export default defineConfig({
plugins: [
Tauri()
]
})
That's it! When you run your Vite development server, Tauri will automatically be initialized if not already present, and will launch alongside your Vite app.
The plugin accepts an optional configuration object. Here's an example with available options:
// vite.config.ts
import { defineConfig } from 'vite'
import Tauri from 'vite-plugin-tauri'
export default defineConfig({
plugins: [
Tauri({
// System tray configuration
systemTray: {
enabled: true, // Enable system tray support
menuOnLeftClick: true, // Show menu on left click (default: true)
useAppIcon: true // Use the app icon as the tray icon (default: true)
}
})
]
})
You can pass arguments to the Tauri CLI by adding them after a double dash (--
) and the -t
or --tauri
flag:
# Development mode
npm run dev -- -t --debug
# Build mode
npm run build -- -t --debug
TAURI_PATH_DEPTH
: Controls how deep the plugin searches for Tauri configuration files. Default is3
.
This plugin works with Tauri, a framework for building desktop applications with web technologies.
If you don't have a Tauri project initialized in your directory, the plugin will automatically prompt you to create one when you run your Vite dev server:
npm run dev
The plugin will automatically find your Tauri configuration file (tauri.conf.json
, tauri.conf.json5
, or Tauri.toml
) and use it to configure the integration.
For advanced Tauri configuration, you can use the Tauri CLI directly. The plugin is designed to work alongside the CLI without conflicts.
For more information on Tauri, visit tauri.app.
bun test
Please see our releases page for more information on what has changed recently.
Please review the Contributing Guide for details.
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
For casual chit-chat with others using this package:
Join the Stacks Discord Server
βSoftware that is free, but hopes for a postcard.β We love receiving postcards from around the world showing where vite-plugin-tauri
is being used! We showcase them on our website too.
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States π
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
- Tauri for creating a powerful desktop app framework
- Chris Breuer
- All Contributors
The MIT License (MIT). Please see LICENSE for more information.
Made with π