chore: optimize release profile for fullstack and add linux static build target

- Change opt-level from 'z' to 3 for better runtime performance
- Use thin LTO for faster compilation with similar results
- Remove panic=abort and strip=true to preserve server debuggability
- Add --debug-symbols=false to dx build for smaller WASM
- Add build-linux target for static musl binary
This commit is contained in:
xfy 2026-06-09 10:30:36 +08:00
parent 4595d1c8e7
commit 28d3ed998a
2 changed files with 10 additions and 6 deletions

View File

@ -40,11 +40,9 @@ tokio = { version = "1.52", features = ["rt-multi-thread", "macros", "fs", "time
[profile.release] [profile.release]
debug = false debug = false
opt-level = "z" opt-level = 3
lto = true lto = "thin"
codegen-units = 1 codegen-units = 1
panic = "abort"
strip = true
[features] [features]
default = ["web", "server"] default = ["web", "server"]

View File

@ -1,10 +1,16 @@
.PHONY: dev build css css-watch clean build-editor highlight-css test .PHONY: dev build build-linux css css-watch clean build-editor highlight-css test
build: build:
@$(MAKE) build-editor @$(MAKE) build-editor
@$(MAKE) highlight-css @$(MAKE) highlight-css
@tailwindcss -i input.css -o public/style.css --minify @tailwindcss -i input.css -o public/style.css --minify
@dx build --release @dx build --release --debug-symbols=false
build-linux:
@$(MAKE) build-editor
@$(MAKE) highlight-css
@tailwindcss -i input.css -o public/style.css --minify
@dx build --release --debug-symbols=false --target x86_64-unknown-linux-musl
highlight-css: highlight-css:
@cargo run --bin generate_highlight_css @cargo run --bin generate_highlight_css