Giter VIP home page Giter VIP logo

tree-shake-me's Introduction

testing tree-shaking with rollup and webpack2

Each folder contains a build.sh file whcih should be ran to compare output of rollup vs webpack2. I have included the dist files so that there is no need to download and run the commands to see the differences.

dependency-local-with-es2015

Demonstrates the the use of local dependencies on es2015 modules.

import {cube} from './poor-math-skills';

Results

  • Rollup pulls in only the functions required
  • Webpack pulls in only the functions required

dependency-of-lodash

Demonstrates the the use of lodashes es2015 packaged modules and effiencies in how they expose methods.

import {map} from 'lodash-es';
// vs
import map from 'lodash-es/map';

dependency-with-es2015-and-commonjs

Demonstrates the the use of NPM dependencies on packages containing both CommonJS and es2015 modules. package.json -> "main" points to commonjs package.json -> "jsnext:main" points to es2015 modules

import {cube} from 'poor-math-skills';
// vs
import {cube} from 'poor-math-skills/ecm';

Results

  • Rollup pulls in only the functions required
  • Webpack pulls in only the functions required

dependency-with-only-es2015

Demonstrates the the use of NPM dependencies on packages containing only es2015 modules. package.json -> "main" points to es2015 modules

import {cube} from 'poor-math-skills';

Results

  • Rollup pulls in only the functions required
  • Webpack pulls in only the functions required

tree-shake-me's People

Contributors

jthoms1 avatar

Stargazers

 avatar

Watchers

 avatar

tree-shake-me's Issues

jsnext:main in webpack

packageMains are trled in order. So if you want jsnext to take priority over main you need to put in before main in the array.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.