Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid package exports for vite-plugin-svg-sprite/typings/vanilla etc #30

Open
aleclarson opened this issue Jan 4, 2025 · 1 comment

Comments

@aleclarson
Copy link

The exports field is not correctly setup to allow what's described in the readme:

https://github.com/meowtec/vite-plugin-svg-sprite?tab=readme-ov-file#typescript-users

To get proper type hints in TypeScript, include the appropriate type definitions in your tsconfig.json:

"types": [
  // or "vite-plugin-svg-sprite/typings/react" | "vite-plugin-svg-sprite/typings/vue"
  "vite-plugin-svg-sprite/typings/vanilla"
],

This is the patch I'm using:

diff --git a/package.json b/package.json
index c4906a395d073814d1180100672a98d7454b7b90..b4a5d85f36f12dac6efd8c7ffa0f6df00536aff6 100644
--- a/package.json
+++ b/package.json
@@ -15,8 +15,8 @@
       }
     },
     "./runtime/*.js": "./esm/runtime/*.js",
-    "./react": {
-      "types": "./react.d.ts"
+    "./typings/*": {
+      "types": "./typings/*.d.ts"
     }
   },
   "main": "cjs/index.js",
@meowtec
Copy link
Owner

meowtec commented Jan 5, 2025

You are right. Could you submit a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants