import { transpileSync } from '@stencil/core/compiler' ; import type { TranspileOptions , TranspileResults } from '@stencil/core/internal' ; import { isString } from '@utils' ; export function transpile ( input , opts = { } ) { opts = { ... opts , componentExport : null , componentMetadata : 'compilerstatic' , coreImportPath : isString ( opts . coreImportPath ) ? opts . coreImportPath : '@stencil/core/internal/testing' , currentDirectory : opts . currentDirectory || process . cwd ( ) , module : 'cjs' , proxy : null , sourceMap : 'inline' , style : null , styleImportData : 'queryparams' , target : 'es2015' , } ; try { const v = process . versions . node . split ( '.' ) ; if ( parseInt ( v [ 0 ] , 10 ) >= 10 ) { opts . target = 'es2017' ; } } catch ( e ) { } return transpileSync ( input , opts ) ; }