Skip to content

Commit 5568890

Browse files
committed
Expose svgToJSX [publish]
1 parent b67d11f commit 5568890

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.1.3
4+
5+
Expose svgToJSX for reuse in other build pipelines
6+
37
## 0.1.2
48

59
Use only `load` to skip source maps

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vite-plugin-fast-react-svg",
33
"description": "Turn SVG into React components, without Babel",
4-
"version": "0.1.2",
4+
"version": "0.1.3",
55
"license": "MIT",
66
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",
77
"main": "dist/index.js",

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function svgPlugin(): Plugin {
2727
};
2828
}
2929

30-
const svgToJSX = (svg: string) =>
30+
export const svgToJSX = (svg: string) =>
3131
`import React from "react";const ReactComponent = (props) => (${svg
3232
.replace(/\s([a-z-:]*)="[^"]*"/gu, (string, key: string) => {
3333
if (key.startsWith("data-")) return string;

0 commit comments

Comments
 (0)