mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-22 20:39:05 +08:00
* 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:
committed by
Dan Abramov
parent
2de95c4097
commit
80a7fc391d
7
packages/react-scripts/scripts/build.js
vendored
7
packages/react-scripts/scripts/build.js
vendored
@@ -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');
|
||||
|
||||
7
packages/react-scripts/scripts/start.js
vendored
7
packages/react-scripts/scripts/start.js
vendored
@@ -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');
|
||||
|
||||
7
packages/react-scripts/scripts/test.js
vendored
7
packages/react-scripts/scripts/test.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user