Skip to content

Commit

Permalink
fix: optimize getGlobalCacheKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Connormiha committed Aug 27, 2023
1 parent 7ed8025 commit b450eb1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/jest-create-cache-key-function/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ type NewGetCacheKeyFunction = (

type GetCacheKeyFunction = OldGetCacheKeyFunction | NewGetCacheKeyFunction;

const {NODE_ENV, BABEL_ENV} = process.env;

function getGlobalCacheKey(
files: Array<string>,
values: Array<string>,
length: number,
) {
return [
process.env.NODE_ENV,
process.env.BABEL_ENV,
NODE_ENV,
BABEL_ENV,
...values,
...files.map((file: string) => readFileSync(file)),
]
Expand Down

0 comments on commit b450eb1

Please sign in to comment.