Till innehållet
CTO Michel Zetterberg

Dead-code elimination - en guide

Väldigt utförlig och givande om Tree shaking av Daniel Brain
3 februari 2020
Laptop som lyser färgglatt
Laptop

Tree shaking in JavaScript is becoming an essential practice, to avoid large bundle sizes and improve performance.

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’.

Läs hela artikeln på medium eller läs mer av Daniel Brain.

Hur kan vi hjälpa dig? Fyll i formuläret, mejla eller ring.

We ahead ABÅsögatan 119 Stockholm