- 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
42 lines
1.0 KiB
Makefile
42 lines
1.0 KiB
Makefile
.PHONY: dev build build-linux css css-watch clean build-editor highlight-css test
|
|
|
|
build:
|
|
@$(MAKE) build-editor
|
|
@$(MAKE) highlight-css
|
|
@tailwindcss -i input.css -o public/style.css --minify
|
|
@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:
|
|
@cargo run --bin generate_highlight_css
|
|
|
|
build-editor:
|
|
@echo "Building Tiptap editor..."
|
|
@cd libs/tiptap-editor && npm install && npx vite build
|
|
@echo "Tiptap editor built."
|
|
|
|
dev:
|
|
@echo "Starting tailwindcss watch and dx serve..."
|
|
@tailwindcss -i input.css -o public/style.css --watch & \
|
|
TAILWIND_PID=$$!; \
|
|
trap 'kill $$TAILWIND_PID 2>/dev/null; exit' INT TERM EXIT; \
|
|
dx serve --addr 0.0.0.0
|
|
|
|
css:
|
|
@tailwindcss -i input.css -o public/style.css
|
|
|
|
css-watch:
|
|
@tailwindcss -i input.css -o public/style.css --watch
|
|
|
|
test:
|
|
@cargo test
|
|
|
|
clean:
|
|
@cargo clean
|
|
@rm -f public/style.css
|