-
Notifications
You must be signed in to change notification settings - Fork 787
Support Tree Shaking though module field #686
Comments
@jbaxleyiii I believe it was @kamilkisiela who did this for Apollo Client. |
awesome! Looks like apollographql/apollo-client#1069, apollographql/apollo-client#1130, and apollographql/apollo-client#1177 will be a good place to start! @jwickens I'll work on this as soon as I can! |
@jwickens I've deployed a version as |
If anyone is able / willing, I'm working to support tree shaking for react-apollo. If you have an app (one that would use tree shaking OR one that that doesnt), I'd love for some volunteers to try it out! |
@jbaxleyiii I've checked However because we are using Webpack 2 and ES6 Tree Shaking is known to not work with Webpack 2: |
@Vlasenko thats great news! I'll take any savings I can get! Along with the linked PR, I'm going to move Thanks for testing it! |
@jbaxleyiii I can confirm that the savings are neglible in my repo too, we will have to wait until webpack 2.5 is released to see the profit. Another benefits could be source maps. However one issue i'm seeing is with source map support I'm getting the following error:
This is because the source map in lib refers to the src dir which is not published to npm. For those using webpack you should be in theory able to use source maps of imported modules with
@jdwuarin this should eventually help you with your debugging issues |
Apollo Client supports tree shaking through the module field in package.json. React-apollo however serves a transpiled and minified file only. The combination of react-apollo, apollo-client and graphql add 300kb to my build.
The text was updated successfully, but these errors were encountered: