-
Notifications
You must be signed in to change notification settings - Fork 35
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
|
…-it#759) * feat: add ESM support when bundling with NFT * chore: disable test for NFT * chore: update test fixture * refactor: remove types file Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- 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)