import starUrl, { ReactComponent as Star } from'./star.svg'constApp= () => ( <div> <imgsrc={starUrl} alt="star" /> <Star /> </div>)
Use your own Babel configuration
By default, @svgr/webpack includes a babel-loader with an optimized configuration. In some case you may want to apply a custom one (if you are using Preact for an example). You can turn off Babel transformation by specifying babel: false in options.
It is possible to detect the module that requires your SVG using Rule.issuer in Webpack. Using it you can specify two different configurations for JavaScript and the rest of your files.