Skip to content

Why post function declaration would not be treeshake? #2962

Description

@LongTengDao
  • Rollup Version: 1.14.4
  • Operating System (or Browser):
  • Node Version:

How Do We Reproduce?

var successShaked = function () {
    function inner () {
        /* ... */
    }
    return function outer (){
        return /*#__PURE__*/ inner();
    };
}();
successShaked();
var failedShaked = function () {
    return function outer (){
        return /*#__PURE__*/ inner();
    };
    function inner () {
        /* ... */
    }
}();
failedShaked();

Expected Behavior

Both be shaked.

Actual Behavior

Leave this:

var failedShaked = function () {
    return function outer (){
        return /*#__PURE__*/ inner();
    };
    function inner () {
        /* ... */
    }
}();
failedShaked();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions