zspecza / common-tags

🔖 Useful template literal tags for dealing with strings in ES2015+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ESM support (type=module + exports={})

damianobarbati opened this issue · comments

Would you consider adding support for ESM?
https://nodejs.org/api/esm.html#esm_main_entry_point_export
Node v13 already has ESM enabled by default, and node v14 will be here in a couple of weeks.

An opt-in solution could be given in the following way (I guess, not tested):

  • another available entrypoint like common-tags/esm
  • built and exposed holding a package.json with type=module and exports field in place

Ok, I'll try to implement that; or would you be willing to provide a PR?