From 87b8764eefec79ea179609254fd1ce12593a1de2 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 5 Dec 2025 12:50:06 -0600 Subject: [PATCH 1/2] optimize bundle size --- .cargo/config.toml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..3c712e59 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,19 @@ +[unstable] +build-std = ["std", "panic_abort", "core", "alloc"] +build-std-features = ["panic_immediate_abort"] + +[build] +rustflags = [ + "-Clto", + "-Zvirtual-function-elimination", + "-Zlocation-detail=none" +] + +[profile.release] +opt-level = "z" +debug = false +lto = true +codegen-units = 1 +panic = "abort" +strip = true +incremental = false From 131c0a32d66183565712825439d01453f9b9ab79 Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 5 Dec 2025 13:03:07 -0600 Subject: [PATCH 2/2] less aggressive optimizations --- .cargo/config.toml | 19 ------------------- Cargo.toml | 8 ++++++++ 2 files changed, 8 insertions(+), 19 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 3c712e59..00000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,19 +0,0 @@ -[unstable] -build-std = ["std", "panic_abort", "core", "alloc"] -build-std-features = ["panic_immediate_abort"] - -[build] -rustflags = [ - "-Clto", - "-Zvirtual-function-elimination", - "-Zlocation-detail=none" -] - -[profile.release] -opt-level = "z" -debug = false -lto = true -codegen-units = 1 -panic = "abort" -strip = true -incremental = false diff --git a/Cargo.toml b/Cargo.toml index b536150b..21cda6ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,11 @@ dioxus-primitives = { path = "primitives" } dioxus = "0.7.0" tracing = { version = "0.1", features = ["std"] } + +[profile.release] +opt-level = "z" +debug = false +lto = true +codegen-units = 1 +strip = true +incremental = false