Enable Dioxus 0.7 automatic WASM bundle splitting by route: - Add wasm-split feature to dioxus and dioxus-router in Cargo.toml - Add --wasm-split flag to dx build in Makefile - Router definitions stay as plain #[route] — splitting is automatic Dioxus 0.7.9 handles splitting automatically when the feature and CLI flag are enabled. Per-route #[wasm_split] attributes are not required (and not supported by this version's derive macro).
36 lines
905 B
Makefile
36 lines
905 B
Makefile
.PHONY: dev build css css-watch clean build-editor highlight-css
|
|
|
|
build:
|
|
@$(MAKE) build-editor
|
|
@$(MAKE) highlight-css
|
|
@tailwindcss -i input.css -o public/style.css --minify
|
|
@dx build --release --wasm-split
|
|
@echo "Fixing WASM paths for production..."
|
|
@python3 scripts/fix-wasm-paths.py
|
|
@echo "WASM paths fixed."
|
|
|
|
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
|
|
|
|
clean:
|
|
@cargo clean
|
|
@rm -f public/style.css
|