mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-23 04:40:23 +08:00
Revert "Use yarn when running inside yarn workspace. (#3997)"
This reverts commit 2c34d5b66e.
This commit is contained in:
3
packages/react-scripts/scripts/build.js
vendored
3
packages/react-scripts/scripts/build.js
vendored
@@ -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);
|
||||
},
|
||||
|
||||
2
packages/react-scripts/scripts/eject.js
vendored
2
packages/react-scripts/scripts/eject.js
vendored
@@ -224,7 +224,7 @@ inquirer
|
||||
}
|
||||
}
|
||||
|
||||
if (paths.useYarn) {
|
||||
if (fs.existsSync(paths.yarnLockFile)) {
|
||||
const windowsCmdFilePath = path.join(
|
||||
appPath,
|
||||
'node_modules',
|
||||
|
||||
10
packages/react-scripts/scripts/start.js
vendored
10
packages/react-scripts/scripts/start.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user