Revert "Use yarn when running inside yarn workspace. (#3997)"

This reverts commit 2c34d5b66e.
This commit is contained in:
Joe Haddad
2018-09-18 14:14:05 -04:00
parent d8c2da5668
commit cc328d6287
9 changed files with 49 additions and 84 deletions

View File

@@ -46,6 +46,7 @@ const { printBrowsers } = require('react-dev-utils/browsersHelper');
const measureFileSizesBeforeBuild =
FileSizeReporter.measureFileSizesBeforeBuild;
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
const useYarn = fs.existsSync(paths.yarnLockFile);
// These sizes are pretty large. We'll warn for bundles exceeding them.
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
@@ -116,7 +117,7 @@ checkBrowsers(paths.appPath)
publicUrl,
publicPath,
buildFolder,
paths.useYarn
useYarn
);
printBrowsers(paths.appPath);
},

View File

@@ -224,7 +224,7 @@ inquirer
}
}
if (paths.useYarn) {
if (fs.existsSync(paths.yarnLockFile)) {
const windowsCmdFilePath = path.join(
appPath,
'node_modules',

View File

@@ -29,6 +29,7 @@ if (process.env.SKIP_PREFLIGHT_CHECK !== 'true') {
}
// @remove-on-eject-end
const fs = require('fs');
const chalk = require('chalk');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
@@ -45,6 +46,7 @@ const paths = require('../config/paths');
const config = require('../config/webpack.config.dev');
const createDevServerConfig = require('../config/webpackDevServer.config');
const useYarn = fs.existsSync(paths.yarnLockFile);
const isInteractive = process.stdout.isTTY;
// Warn and crash if required files are missing
@@ -91,13 +93,7 @@ checkBrowsers(paths.appPath)
const appName = require(paths.appPackageJson).name;
const urls = prepareUrls(protocol, HOST, port);
// Create a webpack compiler that is configured with custom messages.
const compiler = createCompiler(
webpack,
config,
appName,
urls,
paths.useYarn
);
const compiler = createCompiler(webpack, config, appName, urls, useYarn);
// Load proxy config
const proxySetting = require(paths.appPackageJson).proxy;
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);