isaacs / tshy

Other
886 stars 18 forks source link

consider adding support for module-sync export condition #94

Open ericallam opened 1 month ago

ericallam commented 1 month ago

https://github.com/nodejs/node/pull/54648

isaacs commented 1 month ago

So, it looks like, it should point to the ESM version, but that's only safe to do if it doesn't use top level await? Are there other conditions, or a link to the node docs that describe when it's ok to use?

ericallam commented 1 month ago

No Node.js docs out yet, and yes I think you have that correct. It's possible the solution for tshy would just be an option in the tshy config to enable outputting the module-sync export condition, leaving it up to the user to decide.

isaacs commented 1 month ago

I wonder if we could detect it somehow by parsing the built code? It'd be nice to not have this need to be opt-in.