Skip to content

Commit 9ace0a9

Browse files
authored
fix: stimulate esbuild type to avoid importing esbuild directly (#3147)
1 parent 0e8f829 commit 9ace0a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/types.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Transformer, TransformOptions } from '@jest/transform'
22
import type { Config } from '@jest/types'
33
import type * as _babel from 'babel__core'
4-
import type * as _esbuild from 'esbuild'
54
import type * as _ts from 'typescript'
65

76
import type { ConfigSet } from './config'
@@ -27,7 +26,13 @@ declare module '@jest/types' {
2726
*/
2827
export type TBabelCore = typeof _babel
2928
export type TTypeScript = typeof _ts
30-
export type TEsBuild = typeof _esbuild
29+
// Stimulate `esbuild` type to avoid import `esbuild` while building the assets which are shipped to npm
30+
export interface TEsBuild {
31+
transformSync(
32+
input: string,
33+
options?: { loader: 'ts' | 'js'; format: 'cjs' | 'esm'; target: string },
34+
): { code: string; map: string }
35+
}
3136
/**
3237
* @internal
3338
*/

0 commit comments

Comments
 (0)