diff --git a/.eslintrc b/.eslintrc index 16917a4..310be34 100644 --- a/.eslintrc +++ b/.eslintrc @@ -17,6 +17,7 @@ }, "globals": { "__DEV__": false, + "__ENV__": false, "__REDUX_DEV__": false } } diff --git a/.gitignore b/.gitignore index 23f0139..2e104d2 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ npm-debug.log # Application specific src/constants/configurations.production.yml +src/constants/configurations.staging.yml src/constants/configurations.development.yml diff --git a/package.json b/package.json index 90aeb88..7b70343 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "src/main.jsx", "scripts": { "build": "better-npm-run build", + "build:staging": "better-npm-run build:staging", "build:dev": "better-npm-run build:dev", "start": "better-npm-run start", "test": "echo \"Error: no test specified\" && exit 1", @@ -17,6 +18,12 @@ "NODE_ENV": "production" } }, + "build:staging": { + "command": "webpack", + "env": { + "NODE_ENV": "staging" + } + }, "build:dev": { "command": "webpack", "env": { diff --git a/src/constants/index.js b/src/constants/index.js index ea01de4..5e1d3b2 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -1,6 +1,9 @@ +const PROD_CONFIG = (__ENV__ === 'production') ? + require('./configurations.production.yml') : + require('./configurations.staging.yml'); + const CONFIG = (__DEV__) ? - require('./configurations.development.yml') : - require('./configurations.production.yml'); + require('./configurations.development.yml') : PROD_CONFIG; // load local visualizations configurations const USER_CONFIGURABLE_OPTIONS = (__DEV__) ? diff --git a/webpack.config.js b/webpack.config.js index d5c9ebe..6a95409 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,7 +7,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const __ENV__ = process.env.NODE_ENV || 'development'; -const __PROD__ = __ENV__ === 'production'; +const __PROD__ = __ENV__ !== 'development'; const __DEV__ = __ENV__ === 'development'; const __REDUX_DEV__ = __DEV__; // && false; @@ -80,6 +80,7 @@ const webpackConfig = { 'process.env': { NODE_ENV: JSON.stringify(__ENV__) }, + __ENV__: JSON.stringify(__ENV__), __DEV__: JSON.stringify(__DEV__), __REDUX_DEV__: JSON.stringify(__REDUX_DEV__) }),