Skip to content

Fails to shake Apollo Client #37

@tornqvist

Description

@tornqvist

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions