Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stimulate esbuild type to avoid importing esbuild directly #3147

Merged
merged 1 commit into from Dec 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/types.ts
@@ -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