import { transform } from 'esbuild'; import { node } from './buildConstants.js'; export default { /** * @param {string} source * @param {string} filePath * @param {import('@jest/types').Config.GlobalConfig} jestConfig * @return {Promise} */ async processAsync(source, filePath) { const { code } = await transform(source, { loader: filePath.endsWith('tsx') ? 'tsx' : 'ts', sourcefile: filePath, format: 'esm', target: node, sourcemap: 'inline', }); return { code, originalCode: source, sourceMapPath: null, }; }, };