relaycorp/dnssec-js

Add CommonJS Build

JaneX8 opened this issue · 1 comments

Feature Request: Add CommonJS Build

Describe the problem

The current build of the library only supports ECMAScript (ES) module format, which makes it difficult for developers who use CommonJS in their projects to use this library.

Describe the solution you'd like

I would like to request the addition of a CommonJS build to the library. This will allow developers who use CommonJS to easily use this library in their projects.

Describe alternatives you've considered

One alternative solution would be to manually transpile the library using Babel or a similar tool. However, this can be time-consuming and error-prone. Having a CommonJS build as part of the library will make it easier and more convenient for developers to use it.

Additional context

I'm trying to use this in a serverless function on a platform that only supports CommonJS for the moment. Making this library unfortunately not easily usable at the moment.

Related: https://stackoverflow.com/a/63121798/4820655

Hi again @JaneX8! Agreed, we should support CommonJS.

I tried to when I first started working on this library, but gave up as I couldn't get the two working and I couldn't think of any reason why we'd want to support CommonJS going forward, but yours is a good reason.

I'd welcome a PR for this if you want to tackle this. A few relevant pointers: