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

draft: add tsup #104

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Pagebakers
Copy link
Contributor

Unfortunately it turns out my previous PR doesn't fix ESM support.
This is because the node ESM resolver requires imports to include file extensions.

Now there are 2 ways to do this.

  1. Use a bundler like tsup, this will automatically add missing file extensions to the build output. Downside is that tsup bundles everything into a single js file. This might be a breaking change because consumers can be importing from permitio/(main/module)/*

  2. Add .js extension to all imports manually in the source code. A bit more involved, but you can keep using tsc to build the package. The .mjs rename script does need to get updated to also rename all .js imports to .mjs. This will be quite a bit more work.

This PR adds tsup to build the package so you can explore this option.

Also noticed the package still depends on node 14 types, this version has been end of life for a long time. 23 is current.
See: https://nodejs.org/en/about/previous-releases

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.

1 participant