browserify / browserify/common-shakeify

Fails to shake Apollo Client

Open
#37 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
103
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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.

```javascript
// 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/client@3.2.5/core/core.cjs.js

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.