What is tree shaking and how does it relate to code splitting?
Tree shaking and code splitting are complementary but different build optimization techniques. Tree shaking (or dead code elimination) removes unused code from your bundle during build time, making the overall application smaller. Code splitting, on the other hand, divides your code into multiple smaller chunks that can be loaded on demand. When used together, tree shaking ensures each chunk contains only necessary code, while code splitting ensures you only load the chunks you need at any given time, creating a powerful optimization strategy.