diff --git a/ui/js/app.js b/ui/js/app.js index e69c40218..b354036ba 100644 --- a/ui/js/app.js +++ b/ui/js/app.js @@ -1,6 +1,6 @@ import store from 'store.js'; -const env = process.env.NODE_ENV || 'production'; +const env = ENV; const config = require(`./config/${env}`); const logs = []; const app = { diff --git a/ui/js/store.js b/ui/js/store.js index 3c582ce5e..5ed542db5 100644 --- a/ui/js/store.js +++ b/ui/js/store.js @@ -1,6 +1,6 @@ const redux = require('redux'); const thunk = require("redux-thunk").default; -const env = process.env.NODE_ENV || 'production'; +const env = ENV; import { createLogger diff --git a/ui/webpack.config.js b/ui/webpack.config.js index 9afb1d82f..fe0a5277b 100644 --- a/ui/webpack.config.js +++ b/ui/webpack.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const webpack = require('webpack') const appPath = path.resolve(__dirname, 'js'); const PATHS = { @@ -18,6 +19,11 @@ module.exports = { root: appPath, extensions: ['', '.js', '.jsx', '.css'], }, + plugins: [ + new webpack.DefinePlugin({ + ENV: JSON.stringify("development"), + }), + ], module: { preLoaders: [ { diff --git a/ui/webpack.dev.config.js b/ui/webpack.dev.config.js index cc5372370..15ec5652d 100644 --- a/ui/webpack.dev.config.js +++ b/ui/webpack.dev.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const webpack = require('webpack') const WebpackNotifierPlugin = require('webpack-notifier') const appPath = path.resolve(__dirname, 'js'); @@ -25,6 +26,9 @@ module.exports = { }, plugins: [ new WebpackNotifierPlugin(), + new webpack.DefinePlugin({ + ENV: JSON.stringify("development"), + }), ], module: { preLoaders: [