mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 11:01:41 +01:00
b983971bfd
`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.
21 lines
678 B
JavaScript
21 lines
678 B
JavaScript
import { createStore, applyMiddleware } from 'redux';
|
|
import thunkMiddleware from 'redux-thunk';
|
|
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),
|
|
});
|
|
storeEnhancers = composeEnhancers(storeEnhancers);
|
|
}
|
|
|
|
return createStore(rootReducer, initialState, storeEnhancers);
|
|
}
|