Ensure that package.json environment > NODE_ENV

We only set the environment in package.json when it is packaged for
deployment. When we do that, we don't want to allow a local environment
variable to override it.

// FREEBIE
This commit is contained in:
lilia 2017-04-13 10:48:46 -07:00 committed by Scott Nonnenberg
parent c83dbc1bf0
commit d0fc2f7e71
No known key found for this signature in database
GPG Key ID: A4931C09644C654B
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ if (shouldQuit) {
}
const package_json = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf-8'))
process.env.NODE_ENV = process.env.NODE_ENV || package_json.environment || 'development';
process.env.NODE_ENV = package_json.environment || process.env.NODE_ENV || 'development';
process.env.NODE_CONFIG_DIR = path.join(__dirname, 'config');
const config = require('config');