-
Notifications
You must be signed in to change notification settings - Fork 651
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
fix: Fix imports to play nicely with rollup #530
Conversation
Ah, glad you also got this @bencentra-toast, thanks! |
## [4.2.2](v4.2.1...v4.2.2) (2019-08-02) ### Bug Fixes * Fix imports to play nicely with rollup ([#530](#530)) ([3d9003e](3d9003e))
🎉 This PR is included in version 4.2.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
You still could use it successfully. It's ok to use named imports. Here's workaround for your issue in rollup config import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as PropTypes from 'prop-types';
export default {
...
commons({
...,
namedExports: {
react: Object.keys(React),
'react-dom': Object.keys(ReactDOM),
'prop-types': Object.keys(PropTypes)
}
})
...
} |
@TrySound, thanks for the workaround - good to note for other cases similar to this that can pop up in the wild, until expected and consistent usage can be applied like this. |
Well, named exports makes more sense in case of react. This workaround exist until react will provide esm support. Default export will probably be dropped eventually. |
## [4.2.2](reactjs/react-transition-group@v4.2.1...v4.2.2) (2019-08-02) ### Bug Fixes * Fix imports to play nicely with rollup ([#530](reactjs/react-transition-group#530)) ([3d9003e](reactjs/react-transition-group@3d9003e))
## [4.2.2](reactjs/react-transition-group@v4.2.1...v4.2.2) (2019-08-02) ### Bug Fixes * Fix imports to play nicely with rollup ([#530](reactjs/react-transition-group#530)) ([3d9003e](reactjs/react-transition-group@3d9003e))
## [4.2.2](reactjs/react-transition-group@v4.2.1...v4.2.2) (2019-08-02) ### Bug Fixes * Fix imports to play nicely with rollup ([#530](reactjs/react-transition-group#530)) ([3d9003e](reactjs/react-transition-group@3d9003e))
## [4.2.2](reactjs/react-transition-group@v4.2.1...v4.2.2) (2019-08-02) ### Bug Fixes * Fix imports to play nicely with rollup ([#530](reactjs/react-transition-group#530)) ([3d9003e](reactjs/react-transition-group@3d9003e))
Fixes #529, and a similar issues with
ReactDOM.findDOMNode()
Before this change, I was getting errors with rolllup such as:
and
After this change, I can run my project's rollup successfully (
$ NODE_ENV=production rollup -c
)Tested locally by
yarn link
-ingreact-transition-group
to my project and runningyarn build
before building my own project.I don't know exactly what (if anything) changed with this package that would've caused these issues, since the lines I'm changing are over a year old.
react-dom
got updated 2 days ago,prop-types
6 months ago, androllup
yesterday. Maybe it's a rollup problem?