Skip to content
tree shaking and dead code elimination playground
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Stock Shaker

Mini app to explore the javascript size optimizations applied by webpack and uglify.

The app is built using rxjs as the main library.

The app source code is transpiled by babel and minified by uglify within webpack.

See deployed app:

  • step 0: the baseline
  • step 1: replace the kitchen sink import with naked imports
  • step 2: use lettable operators introduced in RxJS v5.5
  • step 3: switch rxjs over to ESM via resolve alias
  • step 4: switch the app code over to ESM
  • step 5: turn on module concatenation
  • step 6: add a seam into index.js to defer loading of the data layer w/ a massive regression
  • step 7: found the culprit - an unused import
  • step 8: add http2 push
You can’t perform that action at this time.