C.W.K.
Stream
Lesson 04 of 06 · published

tauri dev vs tauri build

~12 min · tauri, cli, dev, build

Level 0Web Tourist
0 XP0/56 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete
"Dev points your window at a living server. Build freezes everything into one binary. Know which world you're in."

Two Commands, Two Worlds

tauri dev is your inner loop. It runs beforeDevCommand to start your frontend dev server, waits until devUrl responds, then compiles the Rust core in debug mode and launches a native window pointed at that dev server. You get HMR on the frontend and recompile-on-save on the Rust side. Edit a component — it updates live. Edit a command — Rust rebuilds and relaunches.

tauri build is the shipping path. It runs beforeBuildCommand to produce your static frontend, compiles the Rust core in release mode (optimized, slower to compile), embeds the frontendDist files into the binary, and then runs the bundler to produce installers for your targets. No dev server is involved; the app is fully self-contained.

Debug vs Release Is a Real Difference

The debug binary from tauri dev is large and unoptimized — great for fast iteration, terrible to ship. The release binary from tauri build is optimized and stripped, which is why it's small and fast but takes longer to compile. Never benchmark performance or binary size against a debug build; measure the release output.

Where the Output Lands

After tauri build, your installers appear under src-tauri/target/release/bundle/, organized by type — dmg/ and macos/ on a Mac, msi/ and nsis/ on Windows, deb/ and appimage/ on Linux. The raw executable is in target/release/; the bundle folder is what you hand to users. We'll go deep on this in the ship track.

Code

The two commands you'll type most·bash
# Inner loop — fast iteration, debug build, points at the dev server.
npm run tauri dev

# Shipping — release build, static frontend embedded, installers produced.
npm run tauri build

# Build without bundling installers (just the binary), e.g. for CI checks:
npm run tauri build -- --no-bundle

# Build only specific installer formats:
npm run tauri build -- --bundles dmg
Where your shippable artifacts appear·text
After `tauri build` (macOS example):

src-tauri/target/release/
├─ my-app                      # the raw release binary
└─ bundle/
    ├─ macos/My App.app        # the .app bundle
    └─ dmg/My App_1.0.0_*.dmg  # the installer you ship

External links

Exercise

Run tauri build on your scaffolded app (it'll take a few minutes the first time). Find the produced installer under src-tauri/target/release/bundle/ and note its size. Compare that to the size of the src-tauri/target/debug/ binary from your dev runs. Write down both numbers — that gap is the debug/release difference made concrete.
Hint
On macOS look in bundle/dmg/ or bundle/macos/. The debug binary lives in target/debug/. The release artifact should be dramatically smaller and is the only one you'd ever ship.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.