If I create a TypeScript class with 10 methods and export a new instance of the class as default in one file, then import this class into another file (e.g. a React functional component) and use only one method from the class, how will it affect optimization? Can Webpack/Babel extract just the necessary code or will it include the entire class, resulting in unused code?
Would it be more efficient to avoid using classes and instead export each function individually?
My objective is to reduce exported bundle size and minimize Lighthouse warnings about unused JavaScript.