import * as svelte from 'svelte/compiler' ; import { GraphQLTagFinder } from 'relay-compiler/lib/language/RelayLanguagePluginInterface' ; export function createFinder ( finder ) { return ( text , filePath ) => { let jsSource = '' ; if ( filePath . endsWith ( '.svelte' ) ) { svelte . preprocess ( text , { script ( { content } ) { jsSource += content ; return { code : content } ; } } ) ; } else { jsSource = text ; } return finder ( jsSource ! , filePath ) ; } ; }