The advanced compilation mode does some pretty powerful dead code removal and minification [1]. I guess that is available from plugins in Babel as well but Google has been using it for Gmail, Google.com etc, so it's quite battle tested.
Dead code removal relies heavily on writing JS in a style that allows for static analysis. Dynamic requires, heavy usage of closures, knowledge of external/global variables are all things that prevent a lot of commonjs code from being removed. https://developers.google.com/closure/compiler/docs/limitati... has more information if you're interested in the assumptions that the compiler makes.
Interestingly, we're finally starting to see these ideas get more mainstream as people adopt es6 modules and publish bundled code with explicit externs in tools like Webpack 2 and Rollup.
Works very nicely as an LLVM of sort for alt.js languages though, as they can generate JS in such a way that it matches clojure's constraints and requirements.
Interestingly, we're finally starting to see these ideas get more mainstream as people adopt es6 modules and publish bundled code with explicit externs in tools like Webpack 2 and Rollup.