How to Make Your Tauri Dev Faster
Tauri is great. Small bundles. Low memory. Not Electron.
But tauri dev can be painfully slow. Change one line of Rust, wait a minute. Watch dependencies recompile for no apparent reason. Wonder if you made a terrible technology choice.
You didn’t. The tooling is just fighting itself.
Here’s how to fix it.
The Problem
Watch your terminal next time you run tauri dev. Notice how it recompiles dependencies that haven’t changed? That’s not normal. Something is triggering unnecessary rebuilds.
The culprit: MACOSX_DEPLOYMENT_TARGET.
Tauri reads bundle.macos.minimumSystemVersion from your config and sets this environment variable during builds. If you haven’t set it, it defaults to 10.13.
Meanwhile, rust-analyzer runs cargo check in your editor — without that variable set. Different environment means different build cache. Every time you save, both tools invalidate each other’s work.
One minute per change. Unacceptable.
The Fix
Make them agree. Add this to your editor settings:
{
"rust-analyzer.cargo.extraEnv": {
"MACOSX_DEPLOYMENT_TARGET": "10.13"
}
}
And this to tauri.conf.json:
{
"bundle": {
"macos": {
"minimumSystemVersion": "10.13"
}
}
}
Same value. Both places. Restart everything.
One minute became twenty-five seconds.
Still Slow?
You might still see this: Blocking waiting for file lock on build directory.
rust-analyzer and tauri dev are fighting over the same target folder. One waits for the other. Your build stalls.
Give them separate directories:
{
"rust-analyzer.cargo.targetDir": "target/analyzer"
}
Now rust-analyzer writes to target/analyzer. tauri dev writes to target. No conflicts.
This also fixes the environment variable problem. Separate caches mean they can’t invalidate each other.
Twenty-five seconds became fifteen.
Going Further
Want more? Tweak your Cargo profiles.
You probably don’t need full debug info for dependencies. A little optimization can speed up linking.
# src-tauri/Cargo.toml
[profile.dev]
incremental = true
opt-level = 0
debug = true
[profile.dev.package."*"]
opt-level = 1
debug = false
First build after this change will be slow. Dependencies need recompiling. Judge by subsequent builds.
Fifteen seconds became ten.
Summary
Three changes:
-
Match
MACOSX_DEPLOYMENT_TARGET— Same value in editor settings andtauri.conf.json. Stops cache invalidation between tools. -
Set
rust-analyzer.cargo.targetDir— Separate build caches. No file locks. No environment conflicts. This is the big one. -
Optimize dependency builds — Less debug info, slight optimization. Minor gains, some trade-offs.
One minute to ten seconds. Worth the five minutes it took to configure.
Now get back to building.