import type { TransformOptions } from '@babel/core' ; import { transform } from '@babel/core' ; import tsLibBabelPreset from '../index' ; const transformOptions = { presets : [ [ tsLibBabelPreset ] ] , filename : 'test.ts' } ; param source export default function buildSource ( source ) { const babelFileResult = transform ( source , transformOptions ) ; return babelFileResult . code ; }