-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Incomplete tree shaking (cjs?) #898
Copy link
Copy link
Closed
Description
Version
"rollup version 0.34.13"
Details
I have an ES6 module ("dom") that looks like this:
// ... code ...
var isDescendant = function(parent, child) {
// ... code ...
};
// ... code ...
export {
addEventListener,
getElementContentWidth,
getElementContentHeight,
removeAllChildren,
isDescendant,
loadCss
};
The tree shaking is detecting that isDescendant is not called, and hence:
var isDescendant = function(parent, child) {
// ... code ...
};
is completely removed from my target CJS bundle.
However, the "transpiled" export referring to isDescendent is left in place:
var dom = Object.freeze({
addEventListener: addEventListener,
getElementContentWidth: getElementContentWidth,
getElementContentHeight: getElementContentHeight,
removeAllChildren: removeAllChildren,
isDescendant: isDescendant,
loadCss: loadCss
});
Which results in "ReferenceError: isDescendant is not defined".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels