Skip to content

v2.0.0

Compare
Choose a tag to compare
@lukeed lukeed released this 16 Jan 22:21
· 10 commits to master since this release

Breaking

  • Changed the resolve return signature from string | undefined to string[] | undefined:

    Previously resolve.exports could only return 1 string output. This ignored "imports" and "exports" entries that could return multiple resolved locations (aka "alternatives").

    Now resolve.exports supports arrayable entries and normalizes all outputs into arrays. This makes it easier for consumers to uniformly traverse the output (or simply take the first item).

Features

  • NEW Add imports function to resolve "imports" identifiers: #14

  • NEW Add exports function to resolve "exports" maps exclusively
    Note: This is identical to the resolve function from [email protected] release.

  • Converted the resolve function to be a convenience helper.
    Note: Its API signature is unchanged. However, it also now accepts import specifiers. If an import identifier (eg, #foo or <package>/#foo) is received, then the imports() function is invoked. Otherwise the exports() function is called.

  • Support array values (#17)

Chores

  • Converted source code to strict TypeScript
  • Add Node 16.x and 18.x to CI matrix

Full Changelog: v1.1.1...v2.0.0