Files
gsap-carousel/config/build/loaders/buildSvgrLoader.ts
2025-11-19 10:10:16 +03:00

25 lines
708 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Конфигурация SVGR loader для webpack
*
* Преобразует SVG файлы в React компоненты.
* Позволяет импортировать SVG как обычные React компоненты с возможностью
* управления их свойствами (цвет, размер и т.д.) через props.
*
* @returns {Object} Конфигурация @svgr/webpack loader
*
* @example
* import Logo from './logo.svg'
*
* function App() {
* return <Logo width={100} height={100} fill="red" />
* }
*/
export function buildSvgrLoader() {
const svgrLoader = {
test: /\.svg$/,
use: ['@svgr/webpack'],
}
return svgrLoader
}