Redux tracing env variable

pull/1368/head
Alexandre Hajjar 2021-02-11 19:46:51 +01:00 committed by Maxime Quandalle
parent 6b2799c9e7
commit a59cf9e708
3 changed files with 22 additions and 3 deletions

View File

@ -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 :

View File

@ -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' &&

View File

@ -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(),
],
}