We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65a891c commit ea2bcb7Copy full SHA for ea2bcb7
packages/react-scripts/config/modules.js
@@ -12,6 +12,7 @@ const fs = require('fs');
12
const path = require('path');
13
const paths = require('./paths');
14
const chalk = require('react-dev-utils/chalk');
15
+const resolve = require('resolve');
16
17
/**
18
* Get the baseUrl of a compilerOptions object.
@@ -71,7 +72,10 @@ function getModules() {
71
72
// TypeScript project and set up the config
73
// based on tsconfig.json
74
if (hasTsConfig) {
- 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;
79
// Otherwise we'll check if there is jsconfig.json
80
// for non TS projects.
81
} else if (hasJsConfig) {
0 commit comments