Skip to main content

SVGImage module

📖 Description

The SVGImage module is a type declaration to allow direct imports of SVG images for block icons. It should be used in combination with an appropiate webpack configuration that handles the actual loading of the SVG images and converts them into a Base64-encoded string.

👩‍💻 Example

The following example shows how to configure webpack so it loads and converts SVG images using image-webpack-loader.

webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.svg$/,
use: ["url-loader", "image-webpack-loader"]
},
],
}
};