Loader For Svg Webpack. First install the dependency. In some case you may want to apply a custom one if you are using Preact for an example.
By default it depends on target webpack config option. Simply add configuration object to moduleloaders like this. Webpack has a loader called Image-Webpack-Loader that can be used to compress PNG JPEG GIF SVG and WEBP images.
Npm install url-loader --save-dev url-loader works like file-loader but can return a DataURL if the file is smaller than a byte limit.
If you use Adobe suite or Sketch to export SVGs you will get auto-generated unneeded crusts. Svg-url-loader 2. Install npm install svg-inline-loader --save-dev Configuration. If you need custom behavior use this option to specify a path of your sprite implementation module.