File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/react-scripts/config Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const fs = require('fs');
12
12
const path = require ( 'path' ) ;
13
13
const paths = require ( './paths' ) ;
14
14
const chalk = require ( 'react-dev-utils/chalk' ) ;
15
+ const resolve = require ( 'resolve' ) ;
15
16
16
17
/**
17
18
* Get the baseUrl of a compilerOptions object.
@@ -71,7 +72,10 @@ function getModules() {
71
72
// TypeScript project and set up the config
72
73
// based on tsconfig.json
73
74
if ( hasTsConfig ) {
74
- config = require ( paths . appTsConfig ) ;
75
+ const ts = require ( resolve . sync ( 'typescript' , {
76
+ basedir : paths . appNodeModules ,
77
+ } ) ) ;
78
+ config = ts . readConfigFile ( paths . appTsConfig , ts . sys . readFile ) . config ;
75
79
// Otherwise we'll check if there is jsconfig.json
76
80
// for non TS projects.
77
81
} else if ( hasJsConfig ) {
You can’t perform that action at this time.
0 commit comments