liuweiGL / vite-plugin-mkcert

Provide certificates for vite's https dev service.
https://www.npmjs.com/package/vite-plugin-mkcert
MIT License
541 stars 37 forks source link

Add "types" to "exports" in package.json #65

Closed tolu closed 1 year ago

tolu commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch vite-plugin-mkcert@1.13.3 for the project I'm working on.

When upgrading to typescript 5.0.2 and using the new moduleResolution: bundler I got type errors for imports of this package due to not being able to resolve typings.

Here is the diff that solved my problem:

diff --git a/node_modules/vite-plugin-mkcert/package.json b/node_modules/vite-plugin-mkcert/package.json
index 106bea0..0bcb49d 100644
--- a/node_modules/vite-plugin-mkcert/package.json
+++ b/node_modules/vite-plugin-mkcert/package.json
@@ -32,7 +32,8 @@
   "exports": {
     ".": {
       "import": "./dist/mkcert.mjs",
-      "require": "./dist/mkcert.js"
+      "require": "./dist/mkcert.js",
+      "types": "./dist/index.d.ts"
     }
   },
   "scripts": {

This issue body was partially generated by patch-package.

liuweiGL commented 1 year ago

:tada: This issue has been resolved in version 1.13.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: