implement hot reloading for desktop

This commit is contained in:
Evan Almloff committed 2023-01-11 13:40:02 -06:00
1 parent 0e40619b52
commit 1073574896
9 files changed
+155 -32

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
[package]
name = "dioxus-hot-reload-macro"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
syn = { version = "1.0.107", features = ["full"] }
proc-macro2 = { version = "1.0" }
[lib]
proc-macro = true
+7
View File
@@ -0,0 +1,7 @@
use proc_macro::TokenStream;
use syn::__private::quote::quote;
#[proc_macro]
pub fn hot_reload(_: TokenStream) -> TokenStream {
quote!(dioxus_hot_reload::init(core::env!("CARGO_MANIFEST_DIR"))).into()
}