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:
parent
c83dbc1bf0
commit
d0fc2f7e71
1 changed files with 1 additions and 1 deletions
2
main.js
2
main.js
|
@ -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');
|
||||
|
||||
|
|
Loading…
Reference in a new issue