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

Add index.d.cts file to improve CommonJS support #242

Closed
ptesavol opened this issue Apr 19, 2024 · 4 comments
Closed

Add index.d.cts file to improve CommonJS support #242

ptesavol opened this issue Apr 19, 2024 · 4 comments

Comments

@ptesavol
Copy link
Contributor

Currently using node-datachannel in a CommonJS typescript projects requires using very specific tsconfig settings in the importing project, namely:

 "compilerOptions": {
         "module": "CommonJS",
        "moduleResolution": "Node10"
    },

To make the import work with other "module" and "moduleResolution" settings, a index.d.cts file would be required in "lib/" This file can be a copy of the current index.d.ts file, and maybe it could be created in the "prepublishOnly" script.

The reason why a separate index.d.cts file is required seems to be related to this open issue in typescript: microsoft/TypeScript#52363

@murat-dogan
Copy link
Owner

Could you please confirm this PR solves the issue?
#244

@ptesavol
Copy link
Contributor Author

Thank you for the swift reply, the PR solves the issue.

@ptesavol
Copy link
Contributor Author

Hi, could you publish v 0.8.0 to NPM so we can take it into use?

@murat-dogan
Copy link
Owner

Version released

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