Skip to content

An example of tree-shaking: we used rollup.js to create a library and then we include it into a webpack project called "webpackApp". After build see the bundled code (Dead code is cute off)

Notifications You must be signed in to change notification settings

ale-grosselle/tree-shaking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

The aim of this repository is to test tree shaking implementing a lib with RollUp and including it into a webpack application.

Rollup library code is into rollupLib folder and application in webpackApp.

To enhance the tree shaking in a webpack project we must to set:

  • resolve.mainFields: ['module', 'browser', 'main'].
  • To minify, now we are using 'babel-minify-webpack-plugin' instead of UglifyJsPlugin (UglifyJsPlugin works but 'babel-minify-webpack-plugin' is a few better)

This repository collects two sub repository.

Install

Install rollupLib and webpackApp projects:

npm run install:all

Build projects:

npm run build

About

An example of tree-shaking: we used rollup.js to create a library and then we include it into a webpack project called "webpackApp". After build see the bundled code (Dead code is cute off)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published