Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issues when using rollup commonjs plugin #105

Open
atomicpages opened this issue Apr 29, 2020 · 1 comment · May be fixed by #106
Open

Build issues when using rollup commonjs plugin #105

atomicpages opened this issue Apr 29, 2020 · 1 comment · May be fixed by #106

Comments

@atomicpages
Copy link

The CommonJS plugin for Rollup doesn't seem to like destructured imports like:

import { isFragment } from 'react-is';

Using a named import or default import fixes this issue:

import * as ReactIs from 'react-is'; // or
import ReactIs from 'react-is';

When using tools like pika, we don't have direct control over the commonjs plugin so we can't configure named exports on react-is.

See relevant issues:

@gehaktmolen
Copy link

Same goes for https://github.com/mui-org/material-ui/blob/master/packages/mui-utils/src/getDisplayName.ts in version 4. Not sure about 5, but suspect so.

Named import works in Rollup:

import Memo from 'react-is';
import ForwardRef from 'react-is';

The current de-structured one does not:

import { ForwardRef, Memo } from 'react-is';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants