All Projects → vladshcherbin → react-rollup-webpack-test

vladshcherbin / react-rollup-webpack-test

Licence: other
A simple React app for bundler tree-shaking comparison.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

React Rollup & Webpack Tree-Shaking Test

A simple app test case for tree-shaking comparison.

Current status

Bundle size (bare app and with unused Link from react-router-dom package):

Bundler Version Contents Size
rollup 0.43.0 react 15.6.1 131 kb
rollup 0.43.0 react 15.6.1 + react-router 4.1.1 170 kb
webpack 3.0.0 react 15.6.1 146 kb
webpack 3.0.0 react 15.6.1 + react-router 4.1.1 186 kb

Results

  • Neither Rollup nor Webpack can't remove unused react-router-dom package.
  • Rollup bundle file is 15kb / 16kb less.
  • Webpack 3.0.0 Scope Hoisting feature reduced the file by 1kb. Yaaay

Usage

Console commands:

  • Rollup build (saved as build/rollup.js):
npm run build:rollup
  • Webpack build (saved as build/webpack.js):
npm run build:webpack
  • both builds
npm run build
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].