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

Support --moduleResolution node16 in typescript #38

Closed
zkulbeda opened this issue Apr 14, 2023 · 3 comments
Closed

Support --moduleResolution node16 in typescript #38

zkulbeda opened this issue Apr 14, 2023 · 3 comments

Comments

@zkulbeda
Copy link

Hi! I'm really liking this library! Thank you for your work.
I use moduleResolution of node16 in my project, and can't import it without errors.
image

Then I edit package.json in node_modules

...

  "umd:main": "./dist/prod/index.umd.js",
  "exports": {
    "require": "./dist/prod/index.cjs",
    "default": "./dist/prod/index.modern.js",
+   "types": "./src/index.ts"
  },
  "types": "./dist/types/index.d.ts",
...

But the source files is containing imports without .js extension, so there's other error

image

And last thing I tried is providing url to .d.ts file in exports:

...

  "umd:main": "./dist/prod/index.umd.js",
  "exports": {
    "require": "./dist/prod/index.cjs",
    "default": "./dist/prod/index.modern.js",
-   "types": "./src/index.ts"
+   "types": "./dist/types/index.d.ts"
  },
  "types": "./dist/types/index.d.ts",
...

But it also didn't work.
image

Without extensions it just doesn't reexport types in index.d.ts

image

I think the best solution for this problem is providing extensions for import paths and providing type's path to index.d.ts file in exports. What do you think?

@ivandotv
Copy link
Owner

can you create an example repository?

@zkulbeda
Copy link
Author

Yes, see https://github.com/zkulbeda/pumpit_ts

@ivandotv
Copy link
Owner

@zkulbeda this is now fixed
closed via: #64

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