diff --git a/development/build/scripts.js b/development/build/scripts.js index f42cfc091..596497766 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -625,6 +625,7 @@ function setupBundlerDefaults( // Ensure react-devtools are not included in non-dev builds if (!devMode || testing) { bundlerOpts.manualIgnore.push('react-devtools'); + bundlerOpts.manualIgnore.push('remote-redux-devtools'); } // Inject environment variables via node-style `process.env` diff --git a/ui/store/store.js b/ui/store/store.js index 75cbbab10..fd2790a15 100644 --- a/ui/store/store.js +++ b/ui/store/store.js @@ -4,15 +4,17 @@ import { composeWithDevTools } from 'remote-redux-devtools'; import rootReducer from '../ducks'; export default function configureStore(initialState) { - const composeEnhancers = composeWithDevTools({ - name: 'MetaMask', - hostname: 'localhost', - port: 8000, - realtime: Boolean(process.env.METAMASK_DEBUG), - }); - return createStore( - rootReducer, - initialState, - composeEnhancers(applyMiddleware(thunkMiddleware)), - ); + let storeEnhancers = applyMiddleware(thunkMiddleware); + + if (process.env.METAMASK_DEBUG && !process.env.IN_TEST) { + const composeEnhancers = composeWithDevTools({ + name: 'MetaMask', + hostname: 'localhost', + port: 8000, + realtime: Boolean(process.env.METAMASK_DEBUG), + }); + storeEnhancers = composeEnhancers(storeEnhancers); + } + + return createStore(rootReducer, initialState, storeEnhancers); }