Closed tusharosu closed 5 years ago
having the exact same behavior as well.
using
also while skimming through the README i didn't see any examples that contained SVG as a filetype that file-loader can handle, so not exactly sure that this webpack loader can even handle SVG. 🤷♂️
Update
You might want to take a look at this
https://webpack.js.org/loaders/svg-inline-loader/
seems to get the job done for me, as I was able to add a SVG to the DOM.
cheers 🍩
Thanks for the advice Chris! Got it working with the svg-inline-loader!
Expected Behavior
The svg icon should show up as an image in the loaded application's html page
Actual Behavior
The svg icon shows up as the following text in the loaded application's html page
module.exports = __webpack_public_path__ + "images/97f09d2d69ed0771769efa0d68f58476.svg";
Code
Here is the webpack.config.js loader configuration (followed the documentation for asset management): loader configuration for webpack.config.js
Here is the code that loads the svg image (The checkbox shows up fine when the applciation is loaded using the source code instead of from the minified bundle):
The TristateCheckbox.js does the following to load the image:
How Do We Reproduce?
Using the configuration provided above.