import { importModule } from 'local-pkg' ; import { camelize } from '../utils' ; import type { Compiler } from './types' ; export const JSXCompiler = < Compiler > ( async ( svg , collection , icon , options ) => { const svgrCore = await importModule ( '@svgr/core' ) ; const svgr = svgrCore . transform || svgrCore . default || svgrCore ; let res = await svgr ( svg , { } , { componentName : camelize ( `${ collection }-${ icon }` ) } ) ; if ( options . jsx !== 'react' ) res = res . replace ( 'import * as React from "react";' , '' ) ; return res ; } ) ;