feat: Улучшена работа с svg, добавлена поддержка кастомизации

This commit is contained in:
Ilia Mashkov committed 2025-11-20 12:04:08 +03:00
1 parent 71330e4f78
commit 1ed871a9fd
2 files changed
+31 -2

No files matched your search

+26 -1
View File
@@ -17,7 +17,32 @@
export function buildSvgrLoader() {
const svgrLoader = {
test: /\.svg$/,
use: ['@svgr/webpack'],
use: [
{
loader: '@svgr/webpack',
options: {
// Replace currentColor with props
replaceAttrValues: {
currentColor: '{props.stroke || "currentColor"}',
},
// Allow width and height to be customizable
dimensions: false,
svgoConfig: {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
// Keep viewBox for proper scaling
removeViewBox: false,
},
},
},
],
},
},
},
],
}
return svgrLoader