Disable `remote-redux-devtools` in non-dev builds (#12956)

`remote-redux-devtools` is now explicitly excluded and disabled in non-
dev builds, and in the `testDev` build. This was causing console errors
in the `testDev` build during e2e tests, which would cause certain
tests to fail.

This was already only supposed to be enabled for development builds,
but this library used the `NODE_ENV` environment variable to make that
determination. This gives us more control over when it's disabled.
feature/default_network_editable
Mark Stacey 3 years ago committed by GitHub
parent 7c59fd035e
commit b983971bfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      development/build/scripts.js
  2. 24
      ui/store/store.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`

@ -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);
}

Loading…
Cancel
Save