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
feat: add ESM support when bundling with NFT #759
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving since tests are green, and it looks fine. One thing I don't understand, maybe you can give some insight:
Once ESM files are transpiled, what happens to them? I understand that each ESM file gets a CJS equivalent at some tmp
destination. I'd assume that these tmp
files are used to replace the ESM ones at some point, but I can't find where that happens 🤔
You're absolutely correct. I think the part you're missing happens in a Example:
With this Each bundler is responsible for creating this Does that help? |
yes, that helped! thank you :) |
⏱ Benchmark resultslargeDepsEsbuild: 8.4s
Legend
largeDepsNft: 53.8s
Legend
largeDepsZisi: 1m 7.5s
Legend
|
- Summary
Adds support for ESM functions when bundling with NFT. We look for ESM files in the NFT cache and, for each one that is found, we use esbuild to transpile them down to CJS. We then replace the original files with the transpiled ones in the archive.
- Test plan
Included the NFT variation in 3 tests.
- A picture of a cute animal (not mandatory but encouraged)