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 support for commonjs module resolution #243

Closed

Conversation

seidelmartin
Copy link

@seidelmartin seidelmartin commented Nov 23, 2023

Currently, this module is not importable in NodeJS applications that are using commonjs module resolution. In order to support them I've added a separate tsconfig file that builds not only ecmascript module but also commonjs module. The steps taken to support both approaches are described in https://www.sensedeep.com/blog/posts/2021/how-to-create-single-source-npm-module.html.
On top of that, I've also changed tests so they don't require to be built. I've added ts-node that can be run together with mocha and tests can be run immediately.

I believe it will resolve issues like #198 and #193

Execute tests as TS
@seidelmartin seidelmartin changed the title Add support for commonjs Add support for commonjs module resolution Nov 23, 2023
@seidelmartin
Copy link
Author

Hi @JustinBeckwith, would you please check this PR or at least give some feedback?

@JustinBeckwith
Copy link
Owner

Greetings! While I appreciate the PR - I'm not really interested in adding dual CJS support. ES Modules have been out for quite some time, and many, many modules have moved towards ESM only. I'm not really looking for the additional testing and maintenance burden of dual support.

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

Successfully merging this pull request may close these issues.

2 participants