tslib
tslib copied to clipboard
fix: default interop compat for "module" condition
This adds default import interop compat when resolving using the "module" condition.
Many users are still expecting import tslib from 'tslib' to work, since this is supported for the CommonJS interface in both Node.js and browsers, but if building with the "module" condition outside of Webpack (eg as import map generators like JSPM do), this results in breaking the tslib interop.
It is always recommended for all exports conditions to provide the same interface. This decoration effectively provides the identical interfaces between the ESM and CJS forms of tslib, maximizing interop.
//cc @weswigham