Skip to content

Export library as both UMD and ESM #176

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

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

Conversation

Jordan-Lane
Copy link
Contributor

This PR adds support to export the library in both UMD and ESM format.

Now the build system exports UMD format (index.cjs), ESM format (index.mjs), and types at the root level. Exporting types at the root build level allows IDEs such as VSCode to find the typings when three-loader is used as a git submodule.

@Jordan-Lane
Copy link
Contributor Author

I originally closed as I thought I encountered an issue with the UMD build, however it was due to another local change. Reopening this as I think it is still a good starting point.

I am using Vite for my build system, so I have been able to verify the ESM build, however have had some difficulty verifying that the existing UMD build works as expected. Would someone from pnext be able to verify the UMD build works with their existing system?

If not, I can dig into the UMD build more, however might be easier verifying with pnext's original systems.

@Jordan-Lane Jordan-Lane reopened this Dec 19, 2024
@Jordan-Lane
Copy link
Contributor Author

Related issues: #15 and #67

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