File tree 2 files changed +10
-3
lines changed
packages/react-scripts/scripts
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ const { defaultBrowsers } = require('react-dev-utils/browsersHelper');
23
23
const os = require ( 'os' ) ;
24
24
const resolveFrom = require ( 'resolve-from' ) ;
25
25
const paths = require ( '../config/paths' ) ;
26
+ const { findMonorepo } = require ( 'react-dev-utils/workspaceUtils' ) ;
26
27
27
28
function isInGitRepository ( ) {
28
29
try {
@@ -177,10 +178,18 @@ module.exports = function(
177
178
fs . unlinkSync ( templateDependenciesPath ) ;
178
179
}
179
180
181
+ // yarn ws bug not creating app/node_modules/.bin link to hoisted react-scripts
182
+ // -- workaround: install react-scripts again to create link
183
+ // bug in yarn 1.3.2, fixed in nightly 1.4.1-20180211.2236
184
+ const rerunYarn = useYarn && findMonorepo ( appPath ) . isAppIncluded ;
185
+ if ( rerunYarn ) {
186
+ console . log ( 'Detected app in yarn workspace, running install again' ) ;
187
+ }
188
+
180
189
// Install react and react-dom for backward compatibility with old CRA cli
181
190
// which doesn't install react and react-dom along with react-scripts
182
191
// or template is presetend (via --internal-testing-template)
183
- if ( ! isReactInstalled ( appPackage ) || template ) {
192
+ if ( ! isReactInstalled ( appPackage ) || template || rerunYarn ) {
184
193
console . log ( `Installing react and react-dom using ${ command } ...` ) ;
185
194
console . log ( ) ;
186
195
Original file line number Diff line number Diff line change 126
126
pushd packages
127
127
npx create-react-app newapp
128
128
cd newapp
129
- yarn
130
129
yarn build
131
130
yarn start --smoke-test
132
131
CI=true yarn test --watch=no
138
137
pushd packages
139
138
npx create-react-app --internal-testing-template=" $root_path " /packages/react-scripts/fixtures/monorepos/cra-app cra-app2
140
139
cd cra-app2
141
- yarn
142
140
verifyBuild
143
141
yarn start --smoke-test
144
142
verifyTest
You can’t perform that action at this time.
0 commit comments