You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
browser.ts exports lodash/flowRight as compose, however it import this module using require()which makes it impossible for Webpack to treeshake it away. This causes quite a bit of lodash to be pulled in even though compose from react-apollo is not used at all. Replacing this require call with import should allow it to be treeshaked and its cost only paid if actually used.
I have not used require imports since Typescript 1.6 is released so there might very well be minor differences that I have forgotten.
Since you use ES imports everywhere else they question is rather, why isn't this one? Is there a reason?
Pajn
added a commit
to Pajn/react-apollo
that referenced
this issue
Aug 31, 2018
browser.ts
exportslodash/flowRight
as compose, however it import this module usingrequire()
which makes it impossible for Webpack to treeshake it away. This causes quite a bit of lodash to be pulled in even though compose from react-apollo is not used at all. Replacing this require call with import should allow it to be treeshaked and its cost only paid if actually used.react-apollo/src/browser.ts
Line 27 in 9d02df8
The text was updated successfully, but these errors were encountered: