I'm using single-spa for modular React app. I'm using Typescript, Webpack and svg-url-loader. The SVG appears to be generated and present ([hash].svg), but is not loaded correctly (you cannot see the image, just a placeholder).
Here is my Webpack configuration:
module.exports = (webpackConfigEnv, argv) => {
const defaultConfig = singleSpaDefaults({
orgName: "Daboo1998",
projectName: "react-module",
webpackConfigEnv,
argv,
});
return merge(defaultConfig, {
// modify the webpack config however you'd like to by adding to this object
module: {
rules: [
{
test: /\.svg$/,
use: [
{
loader: 'svg-url-loader',
options: {
limit: 10000000,
},
},
],
},
]
}
});
};
Thats the SVG decleration:
declare module "*.svg" {
const src: string;
export default src;
}
and that how I use it:
import homeIcon from "./icons/house-4.svg";
...
<img src={homeIcon} />
What could I be doing wrong? If more information is needed, please comment!