Replies: 2 comments 3 replies
-
This may potentially be impacting of a significantly larger project than either my library or TinyHTTP as well. I based my library's codebase structure off of @jgoux have you had the chance to test against that library to see if it has the same issues as CLI Testing Library? |
Beta Was this translation helpful? Give feedback.
-
I'm a bit confused because I'm also using I'm still trying to figure out why it is working for them but not for you @crutchcorn |
Beta Was this translation helpful? Give feedback.
-
Hello all 👋
I'm working on a monorepo using TypeScript and ESM. I'm having trouble with many external packages that export both ESM/CJS formats, but often the types generated for the ESM part aren't correctly generated. In the majority of the cases, they lack the full path filename in the import/export statement, for example:
import { foo } from './foo'
doesn't work, it should beimport { foo } from './foo.js'
, without the full path, TypeScript doesn't see the import in the exposed.d.ts
declaration files.Right now I'm opening issues and PR and suggest adding the extensions explicitly. I was wondering if there is an easier way through a rollup plugin maybe (the majority of the packages are using rollup for building the project)? Is the typescript plugin able to add the extensions (it should also handle adding the
index.js
) when compiling a project? Maybe it's just an option they don't know and the fix would be painless! 😄Example of projects exporting broken type definitions in ESM and using rollup:
Thanks for your help!
Edit:
I was wrong, no need for anything else, please see: #1198 (reply in thread)
Beta Was this translation helpful? Give feedback.
All reactions