diff --git a/frontend/src/containers/app.js b/frontend/src/containers/app.js index 5f4da0dc..e751dbdd 100644 --- a/frontend/src/containers/app.js +++ b/frontend/src/containers/app.js @@ -10,7 +10,8 @@ import Home from '@containers/home'; import NotFound from '@containers/not-found'; import Nav from '@components/navigation'; import OrgNavigation from '@components/navigation/org'; -import PerfProfiler from '../perf-profiler'; +import { isProduction } from '@utils'; +import PerfProfiler from '@perf-profiler'; import React from 'react'; const App = connect()(React.createClass({ @@ -33,7 +34,7 @@ const App = connect()(React.createClass({ return _children; } - if (process.env.NODE_ENV !== 'production' && process.env.BASELINE_GRID) { + if ( !isProduction() && process.env.BASELINE_GRID) { _children = ( {_children} @@ -51,7 +52,7 @@ const App = connect()(React.createClass({ export default (props) => (
- { process.env.NODE_ENV !== 'production' && } + { !isProduction() && }
diff --git a/frontend/src/index.js b/frontend/src/index.js index d661694b..1ca4aff6 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -13,8 +13,9 @@ import MockState from '@mock-states'; import LeakDatasets from './dataset-leak.json'; import NormalDatasets from './dataset-normal.json'; import Store from '@state/store'; +import { isProduction } from '@utils'; -if (process.env.NODE_ENV !== 'production') { +if ( !isProduction() ) { a11y(React, { ReactDOM }); diff --git a/frontend/src/perf-profiler/index.js b/frontend/src/perf-profiler/index.js index 6bd6f4be..8d1acd20 100644 --- a/frontend/src/perf-profiler/index.js +++ b/frontend/src/perf-profiler/index.js @@ -12,6 +12,7 @@ const Profiler = styled.div` background: #bada55; border: 2px solid black; text-align: center; + z-index: 1; & > h1 { font-size: 1.5em; diff --git a/frontend/src/state/store.js b/frontend/src/state/store.js index 450d9bdd..b68d334e 100644 --- a/frontend/src/state/store.js +++ b/frontend/src/state/store.js @@ -6,6 +6,7 @@ import thunk from 'redux-thunk'; import perflogger from 'redux-perf-middleware'; import createReducer from '@state/reducers'; +import { isProduction } from '@utils'; const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; @@ -18,7 +19,7 @@ export default (state = Object.freeze({})) => { createLogger(), promiseMiddleware(), thunk, - process.env.NODE_ENV !== 'production' && perflogger + !isProduction() && perflogger ) ) ); diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js new file mode 100644 index 00000000..62db0282 --- /dev/null +++ b/frontend/src/utils/index.js @@ -0,0 +1 @@ +export const isProduction = () => process.env.NODE_ENV === 'production'; diff --git a/frontend/webpack/base.js b/frontend/webpack/base.js index daa463ff..d75e6709 100644 --- a/frontend/webpack/base.js +++ b/frontend/webpack/base.js @@ -9,8 +9,7 @@ const { MODULES, FRONTEND, UI, - STATIC, - MOCKSTATE + STATIC } = paths; module.exports = { @@ -25,8 +24,7 @@ module.exports = { [`@${path.basename(fullpath)}`]: fullpath }), { '@root': FRONTEND, - '@ui': UI, - '@mock-states': MOCKSTATE + '@ui': UI }) }, resolveLoader: { diff --git a/frontend/webpack/paths.js b/frontend/webpack/paths.js index d6bfb989..c8f5e346 100644 --- a/frontend/webpack/paths.js +++ b/frontend/webpack/paths.js @@ -14,7 +14,6 @@ module.exports = { 'node_modules' ], FRONTEND: path.join(FRONTEND, 'src'), - MOCKSTATE: path.join(FRONTEND, 'src/mock-states'), UI: process.env.NODE_ENV === 'production' ? path.join(FRONTEND, 'node_modules', '@tomgco/joyent-portal-ui', 'dist') : path.join(UI, 'src'),