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

Fix Typescript Types when using NodeNext module resolution #44

Closed
cevr opened this issue Nov 27, 2023 · 1 comment
Closed

Fix Typescript Types when using NodeNext module resolution #44

cevr opened this issue Nov 27, 2023 · 1 comment

Comments

@cevr
Copy link

cevr commented Nov 27, 2023

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch obscenity@0.1.4 for the project I'm working on.

Using NodeNext as the typescript moduleResolution causes the types to be unresolved.

Here is the diff that solved my problem:

diff --git a/node_modules/obscenity/package.json b/node_modules/obscenity/package.json
index 899188c..580449a 100644
--- a/node_modules/obscenity/package.json
+++ b/node_modules/obscenity/package.json
@@ -6,8 +6,14 @@
   "module": "./dist/index.mjs",
   "types": "./dist/index.d.ts",
   "exports": {
-    "import": "./dist/index.mjs",
-    "require": "./dist/index.js"
+    "import": {
+      "types": "./dist/index.d.ts",
+      "default":"./dist/index.mjs"
+    },
+    "require": {
+      "types": "./dist/index.d.ts",
+      "default": "./dist/index.js"
+    }
   },
   "repository": {
     "type": "git",

This issue body was partially generated by patch-package.

jo3-l added a commit that referenced this issue Jan 5, 2024
Fixes #44. Thanks to cevr for the patch.
@jo3-l jo3-l closed this as completed in 718da8a Jan 5, 2024
@jo3-l
Copy link
Owner

jo3-l commented Jan 5, 2024

Thanks for the report; I applied your patch verbatim and it should be available in the newest version of Obscenity. Apologies for the long turnaround.

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