diff --git a/package.json b/package.json index 8f58557d..bbd2c27e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "description": "enviPath UI - Tailwind CSS + DaisyUI", "scripts": { - "dev": "tailwindcss -i static/css/input.css -o static/css/output.css --watch", + "dev": "tailwindcss -i static/css/input.css -o static/css/output.css --watch=always", "build": "tailwindcss -i static/css/input.css -o static/css/output.css --minify" }, "devDependencies": { diff --git a/pyproject.toml b/pyproject.toml index 6985c14d..346618fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,13 +83,21 @@ cleanup() { kill $PNPM_PID echo "✓ CSS watcher stopped" fi + if [ ! -z "${DJ_PID:-}" ] && kill -0 $DJ_PID 2>/dev/null; then + kill $DJ_PID + echo "✓ Django server stopped" + fi } # Set trap for cleanup trap cleanup EXIT INT TERM -# Start Django dev server -uv run python manage.py runserver +# Start Django dev server in background +uv run python manage.py runserver & +DJ_PID=$! + +# Wait for Django to finish +wait $DJ_PID """, help = "Start the development server with CSS watcher", deps = ["db-up", "js-deps"] } build = { sequence = ["build-frontend", "collectstatic"], help = "Build frontend assets and collect static files" } @@ -121,4 +129,4 @@ shell = { cmd = "uv run python manage.py shell", help = "Open Django shell" } # Build tasks build-frontend = { cmd = "pnpm run build", help = "Build frontend assets using pnpm", deps = ["js-deps"] } -collectstatic = { cmd = "uv run python manage.py collectstatic --noinput", help = "Collect static files for production" } +collectstatic = { cmd = "uv run python manage.py collectstatic --noinput", help = "Collect static files for production", deps = ["build-frontend"] }