hoist-non-react-statics icon indicating copy to clipboard operation
hoist-non-react-statics copied to clipboard

fix(rollup): build umd without react-is

Open jmfrancois opened this issue 4 years ago • 4 comments

Issue: can t use hoist-non-react-statics as UMD in a browser: process.env is undefined https://unpkg.com/browse/[email protected]/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/[email protected]/umd/

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

jmfrancois avatar Nov 17 '20 13:11 jmfrancois

Coverage Status

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

coveralls avatar Nov 17 '20 14:11 coveralls

Coverage Status

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

coveralls avatar Nov 17 '20 14:11 coveralls

Coverage Status

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

coveralls avatar Nov 17 '20 14:11 coveralls

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

TrySound avatar Nov 17 '20 15:11 TrySound