export condition

A key inside an exports entry, such as types, import, require or default, that says which environment should get which file.

In more detail

Resolvers take the first condition in the object that matches, so order matters: types must come first so TypeScript finds declarations, and default must come last. import is used by ECMAScript modules and require by CommonJS.

Related terms

Taught in

References