* ci: test docs-publish * Specify to use prod * Babel should transpile with env set by webpack * chore: production defaults to true; set in --env.production by cli * Remove lingering merge issue * Add minimification plugins * Need relative URLs to find root assets * Default public url to forward slash in define plugin * Don't wrap w/ react-hot-loader if we're building for production * No need to log extensions * Minimize using terser; and minimize css * Import redux from es; this bypasses commonjs as import and fixes our "production build" warning * Split commone webpack build for now to test hotfix * postfix slash * undefined safe env access * Try to fix node_env prod issue w/ redux * Set NODE_ENV production for all prod builds * Syntax error * nix tests * Increase max amount of available memory * Don't run bundle analyzer by default
40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
import {
|
|
applyMiddleware,
|
|
combineReducers,
|
|
createStore,
|
|
} from 'redux/es/redux.js';
|
|
|
|
// import { createLogger } from 'redux-logger';
|
|
import layoutReducers from './layout/reducers.js';
|
|
import { reducer as oidcReducer } from 'redux-oidc';
|
|
import { redux } from '@ohif/core';
|
|
import thunkMiddleware from 'redux-thunk';
|
|
|
|
// Combine our ohif-core, ui, and oidc reducers
|
|
// Set init data, using values found in localStorage
|
|
const { reducers, localStorage } = redux;
|
|
// const loggerMiddleware = createLogger();
|
|
|
|
reducers.ui = layoutReducers;
|
|
reducers.oidc = oidcReducer;
|
|
|
|
const rootReducer = combineReducers(reducers);
|
|
const store = createStore(
|
|
rootReducer,
|
|
localStorage.loadState(), // preloadedState
|
|
applyMiddleware(
|
|
thunkMiddleware // Lets us dispatch() functions
|
|
// loggerMiddleware // neat middleware that logs actions
|
|
)
|
|
);
|
|
|
|
// When the store's preferences change,
|
|
// Update our cached preferences in localStorage
|
|
store.subscribe(() => {
|
|
localStorage.saveState({
|
|
preferences: store.getState().preferences,
|
|
});
|
|
});
|
|
|
|
export default store;
|