Support for NodeJS 12.7+ package exports · Issue #33079 · microsoft/TypeScript (original) (raw)

NodeJS 12.7 added support for a (currently experimental) feature for custom package imports and exports in package.json: https://github.com/jkrems/proposal-pkg-exports/

In short, this feature allows a package author to redirect exports in their package to alternate locations:

{ "name": "pkg", /* [...] */ "exports": { "./foo": "./target.js", "./bar/": "./dist/nested/dir/" } }

This is currently only available when --experiemental-exports is passed to NodeJS, however we should continue to track the development of this feature as it progresses.