RenderedModule.removedExports
is wrong when using export declarations
#2834
Labels
RenderedModule.removedExports
is wrong when using export declarations
#2834
I’m not really sure if this is actually a bug or intended behavior.
The
removedExports
metadata refers to theexport declaration
that was removed.However, if you have explicit
export { foo }
declarations, instead ofexport function foo() {}
, it reports them as removed, since theexport declaration
itself will be rewritten by rollup, but thefunction declaration
itself is still included and rendered.In other words,
export function foo() {}
correctly reflects inremovedExports / renderedExports
whether the function is included in the output or not, howeverfunction foo() {} export { foo }
will always listfoo
insideremovedExports
.If this is indeed intended instead of a bug, it would be nice to provide a different implementation that really refers to the
function/class/const/whatever
that is being removed.How Do We Reproduce?
REPL Link
Expected Behavior
For the testcase above,
removedExports
fora.js
should list only["b"]
, corresponding to thefunction declaration
which was actually removed.Actual Behavior
For the testcase above,
removedExports
fora.js
lists["a", "b", "c"]
, which is kind of wrong, depending on your expectation on howremovedExports
should work.It correctly lists all the
export declarations
, since they will be re-written by rollup someplace else, but thefunction declarations
are still there.The text was updated successfully, but these errors were encountered: