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

Using rollup.js for web builds instead of webpack has unexpected results. #1238

Closed
MichaelRando opened this issue Jan 27, 2017 · 3 comments
Closed

Comments

@MichaelRando
Copy link

I observed that rollup tree shaking did not work using rollup.js and the following import:
import Menu from 'semantic-ui-react'
import Header from 'semantic-ui-react'

It also seems that rollup is breaking a subset of the mass imports where the 'react.createElement(ElementType' first parameter string was being substituted to '_default'; (for example Radio.js) which must be a consequence of pattern
index.js:
import _default from './Radio';
export { _default as default };

I've worked around the issue by using:
import Menu from '../../node_modules/semantic-ui-react/dist/es/collections/Menu/Menu'
import Header from '../../node_modules/semantic-ui-react/dist/es/elements/Header/Header'

instead.

It's certainly possible that this is a issue with rollup, rather than es target. But I'm leaving the bug here to encourage investigation on why the es target does not work; since my workaround is sufficient to unblock developers, but it's still an issue that others will likely run into.

@layershifter
Copy link
Member

import Menu from 'semantic-ui-react'
import Header from 'semantic-ui-react'

It' a typo? It must be:

import { Menu, Header } from 'semantic-ui-react'

@MichaelRando
Copy link
Author

import { Header, Menu } from 'semantic-ui-react'
confirmed same broken results. The typo version was a failed workaround in my edit history, this must've been the original docs cut-and-paste.

@layershifter
Copy link
Member

Linking with #1237.

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

Successfully merging a pull request may close this issue.

2 participants