Of course, excluding unused exports from bundles, also known as tree shaking, minifying scripts by cleaning up dead code and then, compressing script files, is always a good thing when it comes to JavaScript performance, especially when dealing with network latency. Amongst the very good tools that will help you do this is Webpack (https://webpack.js.org/), combined with the UglifyJS plugin (https://github.com/webpack-contrib/uglifyjs-webpack-plugin) and its compression plugin (https://github.com/webpack-contrib/compression-webpack-plugin), which will tree-shake your code, minify your script by removing any unused or dead code, and compress the resulting files.
The advantages of tree-shaking ...