Skip to content

Commit

Permalink
fix: stimulate esbuild type to avoid importing esbuild directly (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl authored Dec 11, 2021
1 parent 0e8f829 commit 9ace0a9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Transformer, TransformOptions } from '@jest/transform'
import type { Config } from '@jest/types'
import type * as _babel from 'babel__core'
import type * as _esbuild from 'esbuild'
import type * as _ts from 'typescript'

import type { ConfigSet } from './config'
Expand All @@ -27,7 +26,13 @@ declare module '@jest/types' {
*/
export type TBabelCore = typeof _babel
export type TTypeScript = typeof _ts
export type TEsBuild = typeof _esbuild
// Stimulate `esbuild` type to avoid import `esbuild` while building the assets which are shipped to npm
export interface TEsBuild {
transformSync(
input: string,
options?: { loader: 'ts' | 'js'; format: 'cjs' | 'esm'; target: string },
): { code: string; map: string }
}
/**
* @internal
*/
Expand Down

0 comments on commit 9ace0a9

Please sign in to comment.