Add preflight check to guard against wrong versions of webpack/eslint/jest higher up the tree (#3771)

* Run real scripts in local development

* Add preflight check warning

* I know what I am doing

* Move preflight check into individual scripts

This ensures we don't try to filter NODE_PATH twice, accidentally removing the now-absolute path.

* Slightly tweak the wording

* Fix lint
This commit is contained in:
Dan Abramov
2018-01-13 15:55:48 +00:00
committed by Joe Haddad
parent aa67a4f78e
commit 11db9af4df
6 changed files with 185 additions and 4 deletions

View File

@@ -21,6 +21,13 @@ process.on('unhandledRejection', err => {
// Ensure environment variables are read.
require('../config/env');
// @remove-on-eject-begin
// Do the preflight check (only happens before eject).
const verifyPackageTree = require('./utils/verifyPackageTree');
if (process.env.SKIP_PREFLIGHT_CHECK !== 'true') {
verifyPackageTree();
}
// @remove-on-eject-end
const fs = require('fs');
const chalk = require('chalk');