mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-01 17:52:10 +05:30
Properly remove DevTools from production build
This commit is contained in:
parent
006f8d531c
commit
a915424259
@ -6,16 +6,22 @@ import classNames from 'classnames';
|
|||||||
|
|
||||||
import Userbar from 'components/userbar/Userbar';
|
import Userbar from 'components/userbar/Userbar';
|
||||||
import PopupStack from 'components/ui/popup/PopupStack';
|
import PopupStack from 'components/ui/popup/PopupStack';
|
||||||
import DevTools from 'containers/DevTools';
|
|
||||||
|
|
||||||
import styles from './root.scss';
|
import styles from './root.scss';
|
||||||
|
|
||||||
import messages from './RootPage.intl.json';
|
import messages from './RootPage.intl.json';
|
||||||
|
|
||||||
|
/* global process: false */
|
||||||
|
let DevTools;
|
||||||
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
DevTools = () => null;
|
||||||
|
} else {
|
||||||
|
DevTools = require('containers/DevTools').default;
|
||||||
|
}
|
||||||
|
|
||||||
function RootPage(props) {
|
function RootPage(props) {
|
||||||
const isRegisterPage = props.location.pathname === '/register';
|
const isRegisterPage = props.location.pathname === '/register';
|
||||||
|
|
||||||
/* global process: false */
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.root}>
|
<div className={styles.root}>
|
||||||
<div id="view-port" className={classNames(styles.viewPort, {
|
<div id="view-port" className={classNames(styles.viewPort, {
|
||||||
@ -39,7 +45,7 @@ function RootPage(props) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<PopupStack />
|
<PopupStack />
|
||||||
{process.env.NODE_ENV === 'production' ? null : <DevTools /> }
|
<DevTools />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ import { syncHistory } from 'react-router-redux';
|
|||||||
import { browserHistory } from 'react-router';
|
import { browserHistory } from 'react-router';
|
||||||
|
|
||||||
import reducers from 'reducers';
|
import reducers from 'reducers';
|
||||||
import DevTools from 'containers/DevTools';
|
|
||||||
|
|
||||||
export default function storeFactory() {
|
export default function storeFactory() {
|
||||||
const reduxRouterMiddleware = syncHistory(browserHistory);
|
const reduxRouterMiddleware = syncHistory(browserHistory);
|
||||||
@ -22,6 +21,7 @@ export default function storeFactory() {
|
|||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
enhancer = compose(middlewares);
|
enhancer = compose(middlewares);
|
||||||
} else {
|
} else {
|
||||||
|
const DevTools = require('containers/DevTools').default;
|
||||||
enhancer = compose(middlewares, DevTools.instrument());
|
enhancer = compose(middlewares, DevTools.instrument());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user