dual package

A package that ships both an ECMAScript module build and a CommonJS build, choosing between them through export conditions.

In more detail

It lets one library work in modern bundlers and older Node.js tooling. The risk is loading both copies in one app, which can duplicate state such as React context, so the builds must be kept equivalent.

Related terms

Taught in

References