Closed seidelmartin closed 11 months ago
Hi @JustinBeckwith, would you please check this PR or at least give some feedback?
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.
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 withmocha
and tests can be run immediately.I believe it will resolve issues like https://github.com/JustinBeckwith/retry-axios/issues/198 and https://github.com/JustinBeckwith/retry-axios/issues/193