Skip to content

Commit

Permalink
Use named export instead of default export for better esm/cjs interop.
Browse files Browse the repository at this point in the history
…Closes #2 [publish]
  • Loading branch information
ArnaudBarre committed Aug 9, 2022
1 parent 78079ba commit 8e0c11b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog

## 0.2.0

Breaking: Use named export instead of default export for better esm/cjs interop. Closes #2

To migrate, replace your import by `import { svgPlugin } from "vite-plugin-fast-react-svg";`

## 0.1.4

Add vite@3 to peer dependency range
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -18,7 +18,7 @@ In your vite config:

```ts
import { defineConfig } from "vite";
import svgPlugin from "vite-plugin-fast-react-svg";
import { svgPlugin } from "vite-plugin-fast-react-svg";

export default defineConfig({
plugins: [svgPlugin()],
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "vite-plugin-fast-react-svg",
"description": "Turn SVG into React components, without Babel",
"version": "0.1.4",
"version": "0.2.0",
"license": "MIT",
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -2,7 +2,7 @@ import { readFileSync } from "fs";
import { transform } from "esbuild";
import { Plugin } from "vite";

export default function svgPlugin(): Plugin {
export function svgPlugin(): Plugin {
return {
name: "svg",
enforce: "pre",
Expand Down

0 comments on commit 8e0c11b

Please sign in to comment.