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

Fails to shake Apollo Client #37

Open
tornqvist opened this issue Oct 30, 2020 · 0 comments
Open

Fails to shake Apollo Client #37

tornqvist opened this issue Oct 30, 2020 · 0 comments

Comments

@tornqvist
Copy link
Contributor

This plugin fails to shake Apollo Client leading to an immensely bloated bundle.

Apollo Client provides a CommonJS bundle, which allegedly is targeted for Node, but I can't see anything about that bundle which would throw off common-shakeify.

This simple example, which should include only the base ApolloClient class and its dependencies actually includes the entire Apollo Client bundle, resulting in a minified bundle size of ~490 kb.

// test.js
var { ApolloClient } = require('@apollo/client/core')
module.exports = new ApolloClient({})
$ npx browserify -p common-shakeify -g uglifyify test.js | wc -c
486954

This is the Apollo Client CommonJS bundle: https://unpkg.com/@apollo/[email protected]/core/core.cjs.js

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

No branches or pull requests

1 participant