Skip to content

Commit

Permalink
Merge pull request #40 from rbatsenko/chore/parse-tsconfig-with-built…
Browse files Browse the repository at this point in the history
…in-ts-helper

fix: parse tsconfig.json with built-in ts helper
  • Loading branch information
steven-pribilinskiy authored Oct 13, 2024
2 parents e981079 + 9f7e514 commit fab0d77
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/compileTypes/helpers/getTSConfigCompilerOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@ export function getTSConfigCompilerOptions(tsconfigFileNameOrPath: string): ts.C
process.exit(1);
}

return require(tsconfigPath).compilerOptions;
const tsconfigJsonFile = ts.readJsonConfigFile(tsconfigPath, ts.sys.readFile);
const parsedConfig = ts.parseJsonSourceFileConfigFileContent(
tsconfigJsonFile,
ts.sys,
path.dirname(tsconfigPath),
);

return parsedConfig.options;
}

0 comments on commit fab0d77

Please sign in to comment.