Skip to content

does not remove imports that belongs to dead code which is removed by common-shake #19

@nikhildpawar

Description

@nikhildpawar

Thanks for the efforts. This plugin works great. I will try to explain the case i came across.

"index.es6" imports {Storage} from "abc" which intern import {Cookie} from "xyz".
"abc" is using {Cookie} from "xyz". But Index.es6 is not using {Storage} from "abc". Now common-shake is removing {Storage} from the code but {Cookie} remains in the output file. If I remove reference to {Cookie} from abc then common-shake is removing {Cookie} as well.

Here is the file structure

index.es6

import {Storage} from "./abc";
console.log("this is an example");

abc.es6

import {Cookie} from "./xyz";

export var Storage = function(){
}
Storage.prototype = {
  getCookie: function(){
    let cookie = new Cookie(); // if i remove this line then common-shake removes Cookie from the output
  }
}

xyz.es6

export var Cookie= function(){
}

Cookie.prototype = {
  readCookie: function(){
     console.log("reading cookie");
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions