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

[javascript] Add es module build #1163

Closed
wants to merge 2 commits into from
Closed

Conversation

arjunyel
Copy link
Contributor

Motivation

Creating an ES Module build allows ESM environments to treeshake the svix library

Solution

Created both a CJS and ESM build using tsup. Also updated all dependencies, upgraded to the Eslint v9 config, and switched from Jest to Vitest.

Based on top of #1162

@tasn
Copy link
Member

tasn commented Jan 19, 2024

Thanks for the contribution, this is a great addition!

Were the changes to eslint and prettier (moving to a different format) necessary? Also, I'm less familiar with tsup, is this what people use nowadays?

@tasn tasn added the lib/javascript JavaScript client library label Jan 19, 2024
@arjunyel
Copy link
Contributor Author

Happy to help, thanks for making Svix :D

The eslint changes were necessary as the old configuration format is being removed.

To make npm packages I personally use dnt which lets you create both a Deno native and npm native packages. An example is I used it to make Lago's SDK. The downside it requires Deno while this repo already uses node.

For node projects tsup is the best tool I've found, here's a video of TypeScript expert Matt Pocock talking about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib/javascript JavaScript client library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants