From 8c208554d5c81630ae36c6f1d0ef8cdd205d5349 Mon Sep 17 00:00:00 2001 From: syoul Date: Wed, 3 Dec 2025 15:42:33 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20d=C3=A9sactiver=20Fast=20Refresh=20dans?= =?UTF-8?q?=20next.config.js=20pour=20=C3=A9viter=20les=20rechargements=20?= =?UTF-8?q?en=20boucle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ajout d'un patch dans Dockerfile.business pour modifier next.config.js après installation - Le patch supprime ReactRefreshPlugin de la configuration webpack en mode développement - Cela devrait empêcher Fast Refresh de déclencher des rechargements en boucle - Le problème venait du fait que le script strategie-script.js modifie le DOM, ce qui déclenche Fast Refresh --- Dockerfile.business | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile.business b/Dockerfile.business index 5c7c902..aaf8c86 100644 --- a/Dockerfile.business +++ b/Dockerfile.business @@ -29,6 +29,8 @@ RUN chmod +x scripts/start-business.sh RUN npx techradar install && \ node -e "const fs=require('fs');const p='.techradar/package.json';const pkg=JSON.parse(fs.readFileSync(p,'utf8'));pkg.scripts=pkg.scripts||{};pkg.scripts.prepare='';fs.writeFileSync(p,JSON.stringify(pkg,null,2));" && \ cd .techradar && npm install --legacy-peer-deps && npm run build:icons && cd .. +# Patcher next.config.js pour désactiver Fast Refresh (évite les rechargements en boucle) +RUN node -e "const fs=require('fs');const path='.techradar/next.config.js';let content=fs.readFileSync(path,'utf8');const webpackConfig=' webpack: (config, { dev, isServer }) => { if (dev && !isServer) { const idx=config.plugins.findIndex(p=>p.constructor.name===\"ReactRefreshPlugin\"); if(idx>=0)config.plugins.splice(idx,1); } return config; },';if(!content.includes('webpack:')){content=content.replace('reactStrictMode: true,',\"reactStrictMode: true,\\n \"+webpackConfig);fs.writeFileSync(path,content);}" # --- CONFIGURATION BUSINESS --- # Application de la logique Business (remplacement de la config et des données)