Skip to content

Commit

Permalink
Cache tsconfig when generating per-file cache key.
Browse files Browse the repository at this point in the history
  • Loading branch information
tvald committed Aug 2, 2017
1 parent 95bd323 commit a8de326
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/preprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,17 @@ export function process(
return src;
}

let tsConfig = undefined;
export function getCacheKey(
fileData: string,
filePath: Path,
configStr: string,
options: TransformOptions = { instrument: false }): string {

const jestConfig: JestConfig = JSON.parse(configStr);
const tsConfig = getTSConfig(jestConfig.globals, options.instrument);
if (!tsConfig) {
tsConfig = getTSConfig(jestConfig.globals, options.instrument);
}

return crypto.createHash('md5')
.update(JSON.stringify(tsConfig), 'utf8')
Expand Down

0 comments on commit a8de326

Please sign in to comment.