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:
parent
7c59fd035e
commit
b983971bfd
@ -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) {
|
||||
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),
|
||||
});
|
||||
return createStore(
|
||||
rootReducer,
|
||||
initialState,
|
||||
composeEnhancers(applyMiddleware(thunkMiddleware)),
|
||||
);
|
||||
storeEnhancers = composeEnhancers(storeEnhancers);
|
||||
}
|
||||
|
||||
return createStore(rootReducer, initialState, storeEnhancers);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user