1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

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.
This commit is contained in:
Mark Stacey 2021-12-06 11:55:40 -03:30 committed by GitHub
parent 7c59fd035e
commit b983971bfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 11 deletions

View File

@ -625,6 +625,7 @@ function setupBundlerDefaults(
// Ensure react-devtools are not included in non-dev builds // Ensure react-devtools are not included in non-dev builds
if (!devMode || testing) { if (!devMode || testing) {
bundlerOpts.manualIgnore.push('react-devtools'); bundlerOpts.manualIgnore.push('react-devtools');
bundlerOpts.manualIgnore.push('remote-redux-devtools');
} }
// Inject environment variables via node-style `process.env` // Inject environment variables via node-style `process.env`

View File

@ -4,15 +4,17 @@ import { composeWithDevTools } from 'remote-redux-devtools';
import rootReducer from '../ducks'; import rootReducer from '../ducks';
export default function configureStore(initialState) { export default function configureStore(initialState) {
const composeEnhancers = composeWithDevTools({ let storeEnhancers = applyMiddleware(thunkMiddleware);
name: 'MetaMask',
hostname: 'localhost', if (process.env.METAMASK_DEBUG && !process.env.IN_TEST) {
port: 8000, const composeEnhancers = composeWithDevTools({
realtime: Boolean(process.env.METAMASK_DEBUG), name: 'MetaMask',
}); hostname: 'localhost',
return createStore( port: 8000,
rootReducer, realtime: Boolean(process.env.METAMASK_DEBUG),
initialState, });
composeEnhancers(applyMiddleware(thunkMiddleware)), storeEnhancers = composeEnhancers(storeEnhancers);
); }
return createStore(rootReducer, initialState, storeEnhancers);
} }