Skip to content

vladshcherbin/react-rollup-webpack-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple React app for bundler tree-shaking comparison.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published