In some places, I need to import my SVG file as a component, to have a control on it ( change style for example, change the fill color of the SVG element ) I used SVGR for that, and in other places, I want to use the SVG file as a normal image and get benefit with the built-in "next/image" module features.
I can't use next/image module as when I import it like
import FacebookIcon from "public/images/icons/social/facebook.svg";
FacebookIcon is a component.
Not a format that the src attribute of next/image component can accept.
From what I understood is src accept string or object with this format
{ src: "**", width: **px, height: **px }
Desired usage
Required next.config.js
Required typescript declaration (if using ts)
How I figured it out
resourceQuery: { not: [/svgr/] }
into the logged output object so that*.svg?svgr
paths will be ignored