In TypeScript, I am able to declare a module like this:
declare module '*.svg' {
const content: string
export default content
}
After declaring the module, I can import it using import svg from './src/file.svg'
without encountering any errors.
However, if I try to import with a query parameter like
import svg from './src/file.svg?query'
, an error is thrown saying Cannot find module ./src/file.svg?query
.
Is there a way to handle ./src/file.svg?query
as if it were ./src/file.svg
?