Skip to content

Bundle not tree-shaked even in the most simple use case #17

@ericmorand

Description

@ericmorand

Here is a super simple package.js script:

var iconv = require('iconv-lite');

console.warn('We are not using iconv at all!');

As you can see, iconv is never used.

Using the CLI command of the documentation browserify -p [common-shakeify -v] package.js > bundle.js, the final bundle is not tree-shaked. There is only one common-shake comment in the generated bundle:

/* common-shake removed: exports.byteLength = */

I expect the whole iconv module to be removed since it is not used at all.

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