Skip to content

Commit

Permalink
feat: conditionally export TypeScript bindings in debug mode
Browse files Browse the repository at this point in the history
- Added `#[cfg(debug_assertions)]` to only export TypeScript bindings when running in debug mode.
- This ensures that the bindings are not included in release builds, optimizing production performance.
  • Loading branch information
yaoshiu committed Oct 19, 2024
1 parent 54d3577 commit 5e652e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tauri-app/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub fn run() {
let builder =
Builder::<tauri::Wry>::new().commands(collect_commands![login, get_daily_limit, upload,]);

#[cfg(debug_assertions)] // only export typescript bindings in debug mode
builder
.export(
Typescript::default()
Expand Down

0 comments on commit 5e652e5

Please sign in to comment.