Väldigt utförlig och givande om Tree shaking av Daniel Brain
The principle behind tree shaking is as follows: 1. You declare all of your imports and exports for each of your modules 2. Your bundler (Webpack, Rollup, and so on) analyze your dependency tree during the compilation step 3. Any provably unused code is dropped from the final bundle, or ‘tree-shaken’.