diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 35a6b4818..627f12dfe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,6 +45,13 @@ yarn start L'application est exécuté sur https://localhost:8080/mon-entreprise pour la version française et http://localhost:8080/infrance pour la version anglaise. +Pour activer le tracing Redux: + +``` +REDUX_TRACE=true yarn start +``` + + ### Messages de commit A mettre sans retenue dans les messages de commit : diff --git a/mon-entreprise/source/Provider.tsx b/mon-entreprise/source/Provider.tsx index 7d4b88e0e..17ea9d6ec 100644 --- a/mon-entreprise/source/Provider.tsx +++ b/mon-entreprise/source/Provider.tsx @@ -18,8 +18,17 @@ declare global { __REDUX_DEVTOOLS_EXTENSION_COMPOSE__: any } } - -const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose +if (process.env.REDUX_TRACE) { + console.log('going to trace') +} +const composeEnhancers = + (process.env.REDUX_TRACE + ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ && + window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ + trace: true, + traceLimit: 25, + }) + : window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose if ( process.env.NODE_ENV === 'production' && diff --git a/mon-entreprise/webpack.dev.js b/mon-entreprise/webpack.dev.js index a2e2b8f9e..c0c8b51bb 100644 --- a/mon-entreprise/webpack.dev.js +++ b/mon-entreprise/webpack.dev.js @@ -19,7 +19,10 @@ module.exports = { plugins: [ ...common.plugins, ...HTMLPlugins(), - new webpack.EnvironmentPlugin({ NODE_ENV: 'development' }), + new webpack.EnvironmentPlugin({ + NODE_ENV: 'development', + REDUX_TRACE: false, + }), new webpack.HotModuleReplacementPlugin(), ], }