Feature/different env config files #1343 (#1344)

* support different env configs.

* fomrat code

* Hide doc

* Slightly rework the PR

* Remove .env in default template
* Use just one entry in the paths
* Unify env.js and loadEnv.js

* Oops, forgot these folks
This commit is contained in:
Valerii Sorokobatko
2017-05-12 13:30:59 +03:00
committed by Dan Abramov
parent 2de95c4097
commit 80a7fc391d
13 changed files with 103 additions and 22 deletions

View File

@@ -20,11 +20,8 @@ process.on('unhandledRejection', err => {
throw err;
});
// Load environment variables from .env file. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set.
// https://github.com/motdotla/dotenv
require('dotenv').config({ silent: true });
// Ensure environment variables are read.
require('../config/env');
const chalk = require('chalk');
const fs = require('fs-extra');

View File

@@ -19,11 +19,8 @@ process.on('unhandledRejection', err => {
process.env.NODE_ENV = 'development';
// Load environment variables from .env file. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set.
// https://github.com/motdotla/dotenv
require('dotenv').config({ silent: true });
// Ensure environment variables are read.
require('../config/env');
const fs = require('fs');
const chalk = require('chalk');

View File

@@ -20,11 +20,8 @@ process.on('unhandledRejection', err => {
throw err;
});
// Load environment variables from .env file. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set.
// https://github.com/motdotla/dotenv
require('dotenv').config({ silent: true });
// Ensure environment variables are read.
require('../config/env');
const jest = require('jest');
const argv = process.argv.slice(2);