File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -20,3 +20,4 @@ SEARCH_SUGGESTION_SERVICE_PORT=10000
20
20
ACTIVE_PROFILE=dev
21
21
REDIS_PASSWORD=mypass
22
22
REDIS_PORT=6379
23
+ ENVIRONMENT=prod
Original file line number Diff line number Diff line change @@ -13,11 +13,21 @@ import '../src/styles/library/swiper/swiper.min.css';
13
13
import log from 'loglevel' ;
14
14
import ErrorBoundary from "./ErrorBoundary" ;
15
15
16
- console . log = console . error = console . warn = function ( ) { }
17
- log . disableAll ( true )
18
- // log.setLevel("info")
16
+ let composeEnhancers
17
+
18
+ // enable logs & redux only in production.
19
+ if ( process . env . ENVIRONMENT === "dev" ) {
20
+
21
+ // by default set the level to info
22
+ log . setLevel ( "info" )
23
+ composeEnhancers = window . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose ( ) ;
24
+ } else {
25
+ console . log = console . error = console . warn = function ( ) { }
26
+ log . disableAll ( true )
27
+ composeEnhancers = compose ( ) ;
28
+ }
29
+
19
30
20
- const composeEnhancers = window . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose ( ) ;
21
31
const store = createStore (
22
32
reducers ,
23
33
composeEnhancers ( applyMiddleware ( thunk ) )
You can’t perform that action at this time.
0 commit comments