Tree shaking: are unused functions included to a bundle?

Viewed 814

Do modern bundlers like Webpack or Rollup shake out only unused modules or are they capable of removing unused functions (or variables, classes) inside a module as well?

// src.js
export function unused() {}
export function used() {} 

// bundle.js
// function unused() {}  // <-- will this be included?
function used() {} 

Searched on the subject but found nothing.

P.S. I've no experience with bundlers (other than zero-config Parcel) but I make the library that requires the answer to this question.

1 Answers
Related