Let say I have a typescript class with 10 methods and that the file export a new instance of the class as its default export. Then I have another file, like a React functional component, that import this class and call one method on the class.
How will this be optimized? Can Webpack/Babel extract the code for just the method used, or will it include the whole class and I will have a bunch of unused code?
Is it better to avoid classes and export each function instead?
My goal is to make the exported bundles smaller and also have Lighthouse complain less about unused JavaScript.