vite-plugin-magical-svg
Version:
An all-in-one Vite plugin that magically makes working with SVGs and bundling them a breeze
20 lines (16 loc) • 482 B
JavaScript
import { jsx } from "react/jsx-runtime";
export var createSvg = /*#__NO_SIDE_EFFECTS__*/ (viewBox, width, height, symbol) => {
let node = jsx("use", { href: symbol });
return (props) =>
jsx("svg", { viewBox, width, height, ...props, children: node });
};
export var createSvgDEV = /*#__NO_SIDE_EFFECTS__*/ (viewBox, width, height, xml) => {
return (props) =>
jsx("svg", {
viewBox,
width,
height,
...props,
dangerouslySetInnerHTML: { __html: xml },
});
};