File tree 1 file changed +13
-3
lines changed
packages/react-scripts/scripts/utils
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,11 @@ function verifyTypeScriptSetup() {
52
52
const isYarn = fs . existsSync ( paths . yarnLockFile ) ;
53
53
54
54
// Ensure typescript is installed
55
+ let ts ;
55
56
try {
56
- resolve . sync ( 'typescript' , {
57
+ ts = require ( resolve . sync ( 'typescript' , {
57
58
basedir : paths . appNodeModules ,
58
- } ) ;
59
+ } ) ) ;
59
60
} catch ( _ ) {
60
61
console . error (
61
62
chalk . red (
@@ -88,7 +89,16 @@ function verifyTypeScriptSetup() {
88
89
const messages = [ ] ;
89
90
let tsconfig ;
90
91
try {
91
- tsconfig = require ( paths . appTsConfig ) ;
92
+ const { config, error } = ts . readConfigFile (
93
+ paths . appTsConfig ,
94
+ ts . sys . readFile
95
+ ) ;
96
+
97
+ if ( error ) {
98
+ throw error ;
99
+ }
100
+
101
+ tsconfig = config ;
92
102
} catch ( _ ) {
93
103
console . error (
94
104
chalk . red . bold (
You can’t perform that action at this time.
0 commit comments