This article does not cover the basics of what tree-shaking is or how to enable it in Webpack because there is a lot of well-written content out there already. So my intention in this article would be to enable tree-shaking in Webpacker for Rails, revealing its side-effect, and a hack (ugly but works in Production) to circumvent the side-effect. Tree Shaking The tree shaking technique is commonly used to eliminate dead/unused code from the…