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

fix(rollup): build umd without react-is #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jmfrancois
Copy link

@jmfrancois jmfrancois commented Nov 17, 2020

Issue:
can t use hoist-non-react-statics as UMD in a browser: process.env is undefined
https://unpkg.com/browse/hoist-non-react-statics@3.3.2/dist/hoist-non-react-statics.js line 58 we see it
Screenshot 2020-11-17 at 14 32 27

why:
Current UMD build contains react-is but not ready to be embeded, with process.env in it.

Proposed Solution

update rollup config to rely on react-is globally

UMD build is available for it:
https://unpkg.com/browse/react-is@16.8.6/umd/

This decreases the size of the final build and works well everywhere.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.05% when pulling 53d4682 on jmfrancois:jmfrancois/fix/react-is-external into f3de655 on mridgway:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.05% when pulling 53d4682 on jmfrancois:jmfrancois/fix/react-is-external into f3de655 on mridgway:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.05% when pulling 53d4682 on jmfrancois:jmfrancois/fix/react-is-external into f3de655 on mridgway:master.

@TrySound
Copy link
Contributor

You can add replace plugin instead. UMD bundles usually contain all stateless dependencies.

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 this pull request may close these issues.

None yet

3 participants