From 163c2c3a56ead98c386ba886b4aebf6945b084e7 Mon Sep 17 00:00:00 2001 From: Gwadaking Date: Fri, 3 Apr 2026 21:37:14 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20nettoyer=20assets/=20avant=20npm=20build?= =?UTF-8?q?=20=E2=80=94=20plus=20de=20bundles=20orphelins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rm -rf assets/ + index.html avant chaque build React pour ne garder que les fichiers du dernier build. index.php et sw.js Symfony sont préservés. Co-Authored-By: Claude Sonnet 4.6 --- deploy/post-receive.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy/post-receive.sh b/deploy/post-receive.sh index 057eb49..6d3fe0b 100644 --- a/deploy/post-receive.sh +++ b/deploy/post-receive.sh @@ -19,6 +19,8 @@ echo "==> composer install" docker compose exec -T php composer install --no-dev --no-interaction --optimize-autoloader --no-scripts 2>&1 # 3. Build React (outDir configuré à ../backend/public dans vite.config.js) +# Nettoyage préalable des anciens assets (sans toucher index.php ni sw.js Symfony) +rm -rf "$DEPLOY_DIR/backend/public/assets" "$DEPLOY_DIR/backend/public/index.html" echo "==> npm run build" docker run --rm -v "$DEPLOY_DIR/frontend:/app/frontend" -v "$DEPLOY_DIR/backend/public:/app/backend/public" -w /app/frontend node:20-alpine sh -c "npm ci --silent && npm run build"