sanctuary-js / sanctuary-def

Run-time type system for JavaScript
MIT License
294 stars 23 forks source link

use relative import specifier #328

Closed davidchambers closed 6 months ago

davidchambers commented 6 months ago

https://nodejs.org/api/packages.html#self-referencing-a-package-using-its-name:

Within a package, the values defined in the package's package.json "exports" field can be referenced via the package's name.

Using this feature seemed like a good idea at the time, but I have since discovered that it is not foolproof: if a package indirectly depends on (an older version of) itself, the import declaration will relate to the package in __node_modules__.

Using a relative import specifier always works, and has the added benefit of not being a Node-specific feature.