You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
invariant only provides a CommonJS interface (exports = function()). Unfortunately, this will fail if it is used in an ES Module environment (for instance, in jsxstyle).
I don't know enough about how you mirror/bundle this package to provide a PR. A hacky (but probably functional) solution could be to create a default property on invariant and set it to the function:
function invariant() {}
module.exports = invariant;
invariant.default = invariant;
That would allow invariant to be used as an ES Module:
import invariant from 'invariant';
However, a proper ES Module would allow tools like webpack to better optimize bundle size.
The text was updated successfully, but these errors were encountered:
invariant
only provides a CommonJS interface (exports = function()
). Unfortunately, this will fail if it is used in an ES Module environment (for instance, injsxstyle
).I don't know enough about how you mirror/bundle this package to provide a PR. A hacky (but probably functional) solution could be to create a
default
property oninvariant
and set it to the function:That would allow invariant to be used as an ES Module:
However, a proper ES Module would allow tools like webpack to better optimize bundle size.
The text was updated successfully, but these errors were encountered: