Extracted from @bclinkinbeard’s comment on #970. Here’s a minimal test case.
main.js:
import foo from "./foo";
console.log(foo()); // foo
foo.js:
import dead from "./dead";
export default function() { return "foo"; }
export function foodead() { return dead(); }
dead.js:
export default function() { return "dead"; }
The expected output is:
'use strict';
var foo = function() { return "foo"; }
console.log(foo()); // foo
The actual output is:
'use strict';
var dead = function() { return "dead"; }
var foo = function() { return "foo"; }
console.log(foo()); // foo
So, the invocation of dead() in foodead.js, even though the default export of dead.js is unused, is causing the definition of dead.js’s default export to be included in the output.
Extracted from @bclinkinbeard’s comment on #970. Here’s a minimal test case.
main.js:
foo.js:
dead.js:
The expected output is:
The actual output is:
So, the invocation of
dead()in foodead.js, even though the default export of dead.js is unused, is causing the definition of dead.js’s default export to be included in the output.