Skip to content

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

Open
jmfrancois wants to merge 1 commit into
mridgway:mainfrom
jmfrancois:jmfrancois/fix/react-is-external
Open

fix(rollup): build umd without react-is#103
jmfrancois wants to merge 1 commit into
mridgway:mainfrom
jmfrancois:jmfrancois/fix/react-is-external

Conversation

@jmfrancois

@jmfrancois jmfrancois commented Nov 17, 2020

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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.

3 participants