Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit b74f1e1

Browse files
committed
no yargs
1 parent 236a5ce commit b74f1e1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as path from 'path'
22
import * as _ from 'lodash'
3-
import { argv } from 'yargs'
43

54
// ------------------------------------
65
// Environment vars
@@ -70,6 +69,12 @@ const paths = {
7069
}
7170

7271
const isRoot = process.cwd() === __dirname
72+
let packageName = isRoot ? 'react' : path.basename(process.cwd())
73+
// don't use yargs here because it causes build errors in certain circumstances
74+
const packageArgIndex = process.argv.indexOf('--package')
75+
if (packageArgIndex > -1 && process.argv[packageArgIndex + 1]) {
76+
packageName = process.argv[packageArgIndex + 1]
77+
}
7378

7479
const config = {
7580
...envConfig,
@@ -141,7 +146,7 @@ const config = {
141146
/** True if command is running from repo root */
142147
isRoot,
143148
/** Package name the task is running against: default to react if running at root, or cwd otherwise */
144-
package: (argv.package as string) || (isRoot ? 'react' : path.basename(process.cwd())),
149+
package: packageName,
145150
}
146151

147152
export default config

0 commit comments

Comments
 (0)