Skip to content

Various demos of tree-shaking scenarios for across different bundlers

Notifications You must be signed in to change notification settings

jasonkuhrt-archive/tree-shaking-demos

Repository files navigation

Tree Shaking Demos

This repository demos various scenarios of tree-shaking across the following bundlers:

  • Webpack
  • Parcel
  • Rollup

Findings

  • Rollup and Webpack can both tree-shake selective or namespaced imports
  • Parcel tree-shaking did not appear to work (?)

TODO

  • More advanced demos may reveal caveats/limits of import style. For example some discussions suggest that Rollup will apparently be unable to tree shake namespaced imports if the namespace object is reflected upon (ref).
  • Its unlikely that Parcel tree-shaking, even if experiment, does not work on such simple demos. Is it configured incorrectly?

Quick Start

Demo results are committed to this repository in ./build or you can run demos for yourself:

yarn build

Development

  • Config files driving each bundler are at the root of the project.
  • Each demo case is a folder under ./source with a correspondingly named folder in build

Links

About

Various demos of tree-shaking scenarios for across different bundlers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published