diff --git a/examples/react/next.js/src-tauri/Cargo.toml b/examples/react/next.js/src-tauri/Cargo.toml index bd38e7239..205cd053a 100644 --- a/examples/react/next.js/src-tauri/Cargo.toml +++ b/examples/react/next.js/src-tauri/Cargo.toml @@ -9,6 +9,7 @@ license = "" repository = "" default-run = "app" edition = "2018" +build = "src/build.rs" [package.metadata.bundle] identifier = "com.tauri.dev" @@ -22,13 +23,16 @@ icon = [ [dependencies] serde_json = "1.0.41" -serde = "1.0" -serde_derive = "1.0" +serde = "1.0.104" +serde_derive = "1.0.104" tiny_http = "0.6" -phf = "0.7.24" -includedir = "0.5.0" +phf = "0.8.0" +tauri_includedir = "0.5.0" tauri = { version = "0.2.0", features = [ "edge" ] } +[target."cfg(windows)".build-dependencies] +winres = "0.1" + [features] dev-server = [ "tauri/dev-server" ] embedded-server = [ "tauri/embedded-server" ] diff --git a/examples/react/next.js/src-tauri/src/build.rs b/examples/react/next.js/src-tauri/src/build.rs new file mode 100644 index 000000000..fcd568038 --- /dev/null +++ b/examples/react/next.js/src-tauri/src/build.rs @@ -0,0 +1,12 @@ +#[cfg(windows)] +extern crate winres; + +#[cfg(windows)] +fn main() { + let mut res = winres::WindowsResource::new(); + res.set_icon("icons/icon.ico"); + res.compile().expect("Unable to find visual studio tools"); +} + +#[cfg(not(windows))] +fn main() {} diff --git a/examples/react/next.js/src-tauri/src/main.rs b/examples/react/next.js/src-tauri/src/main.rs index 4c2d44740..8a4babc3e 100644 --- a/examples/react/next.js/src-tauri/src/main.rs +++ b/examples/react/next.js/src-tauri/src/main.rs @@ -1,3 +1,8 @@ +#![cfg_attr( + all(not(debug_assertions), target_os = "windows"), + windows_subsystem = "windows" +)] + mod cmd; #[macro_use]