lukeed / tsm

TypeScript Module Loader
MIT License
1.18k stars 19 forks source link

fix: support new ESM loader API #16

Closed lukeed closed 2 years ago

lukeed commented 2 years ago

This is done in a way that supports both ESM loader hook designs. It's duplicative, but luckily A) it's not much code in the first place; and B) it works 😆

IMO it's really important to support both designs right now, because while fresh 16.x installations (and presumably everything else going forward) will only use/need the new load hook, alllllll previous 14 and 16 versions that people may be using use the old design.

At some future point – once the API design & probably when there's a 16 LTS version – I can remove the old loader hooks and cut a new major version that raises/restricts the engines requirement.

Closes #13