Skip to content

Commit 7223356

Browse files
committed
perf(jest): readDefaultTsConfig should just execute once
1 parent 84de440 commit 7223356

File tree

4 files changed

+625
-643
lines changed

4 files changed

+625
-643
lines changed

packages/integrate/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"composite": true,
55
"rootDir": ".",
66
"outDir": "./lib",
7-
"jsx": "react-jsx"
7+
"jsx": "react-jsx",
8+
"types": ["node", "jest"]
89
},
910
"include": ["."],
1011
"files": ["./package.json"],

packages/jest/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ function getJestTransformConfig(jestConfig: JestConfig26 | JestConfig27): Option
2525
return {}
2626
}
2727

28+
const defaultTsConfig = readDefaultTsConfig()
29+
2830
export = {
2931
process(src: string, path: string, jestConfig: JestConfig26 | JestConfig27): Output | string {
3032
if (/\.(tsx?|jsx?|mjs)$/.test(path)) {
3133
return transformJest(src, path, {
32-
...tsCompilerOptionsToSwcConfig(readDefaultTsConfig(), path),
34+
...tsCompilerOptionsToSwcConfig(defaultTsConfig, path),
3335
...getJestTransformConfig(jestConfig),
3436
})
3537
}

0 commit comments

Comments
 (0)