All Projects → vuesomedev → typescript-webpack-tree-shaking

vuesomedev / typescript-webpack-tree-shaking

Licence: other
Tree-shaking example with Typescript and Webpack

Programming Languages

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

Projects that are alternatives of or similar to typescript-webpack-tree-shaking

babel-webpack-tree-shaking
Tree-shaking example with Babel and Webpack
Stars: ✭ 253 (+75.69%)
Mutual labels:  babili, tree-shaking
Learn Rollup
This is an example project to accompany a tutorial on using Rollup.
Stars: ✭ 178 (+23.61%)
Mutual labels:  tree-shaking
Tinyify
a browserify plugin that runs various optimizations, so you don't have to install them all manually. makes your bundles tiny!
Stars: ✭ 392 (+172.22%)
Mutual labels:  tree-shaking
Common Shakeify
browserify tree shaking plugin using `common-shake`
Stars: ✭ 101 (-29.86%)
Mutual labels:  tree-shaking
Webpack Common Shake
CommonJS Tree Shaker plugin for WebPack
Stars: ✭ 875 (+507.64%)
Mutual labels:  tree-shaking
Typescript Webpack Tree Shaking
Tree-shaking example with Typescript and Webpack
Stars: ✭ 144 (+0%)
Mutual labels:  tree-shaking
Angular Library Starter
Build an Angular library compatible with AoT compilation and Tree shaking like an official package
Stars: ✭ 272 (+88.89%)
Mutual labels:  tree-shaking
Serverless Plugin Webpack
Serverless Plugin Webpack
Stars: ✭ 72 (-50%)
Mutual labels:  tree-shaking
Webpack Core Usage
webpack2完整系列课程,欢迎阅读。同时欢迎移步我的react全家桶文章全集: https://github.com/liangklfangl/react-article-bucket
Stars: ✭ 94 (-34.72%)
Mutual labels:  tree-shaking
Is Esm
🌳 CLI tool which checks if a package is distributed in ECMAScript module format. Helps you reason if the package is tree-shakable.
Stars: ✭ 147 (+2.08%)
Mutual labels:  tree-shaking
That React App You Want
That react app you always wanted: [email protected], [email protected], postCSS, purifycss, dll's and code splitting examples, bregh. Highly opinionated but you better like it.
Stars: ✭ 27 (-81.25%)
Mutual labels:  tree-shaking
Budgeting
Budgeting - React + Redux + Webpack (tree shaking) Sample App
Stars: ✭ 971 (+574.31%)
Mutual labels:  tree-shaking
Common Shake
CommonJS Tree Shaker API
Stars: ✭ 145 (+0.69%)
Mutual labels:  tree-shaking
Webpack Closure Compiler
[DEPRECATED] Google Closure Compiler plugin for Webpack
Stars: ✭ 467 (+224.31%)
Mutual labels:  tree-shaking
Babel Webpack Tree Shaking
Tree-shaking example with Babel and Webpack
Stars: ✭ 254 (+76.39%)
Mutual labels:  tree-shaking
React Dynamic Route Loading Es6
Auto chunking and dynamic loading of routes with React Router and Webpack 2
Stars: ✭ 297 (+106.25%)
Mutual labels:  tree-shaking
Awesome Bundle Size
📝 An awesome list of tools and techniques to make your web bundle size smaller and your web apps load faster.
Stars: ✭ 118 (-18.06%)
Mutual labels:  tree-shaking
tscc
A collection of tools to seamlessly bundle, minify Typescript with Closure Compiler
Stars: ✭ 148 (+2.78%)
Mutual labels:  tree-shaking
super-minimal-aurelia
A barebones Aurelia + webpack2 build
Stars: ✭ 19 (-86.81%)
Mutual labels:  babili
You Dont Need Momentjs
List of functions which you can use to replace moment.js + ESLint Plugin
Stars: ✭ 12,480 (+8566.67%)
Mutual labels:  tree-shaking

Tree-shaking example with Typescript and Webpack

devDependency Status

This repository shows how to configure Typescript and Webpack to enable tree-shaking. It will eliminate dead code if they have ES2015 module format.

The source code can be found in the app/ folder, where the main file car.js doesn't use all the dependencies from engine.js. The built and transpiled files can be found in the /dist folder.

Webpack only marks unused code at bundling and leaves the removing part to minifiers. This is why all the code is included in development builds in contrary to Rollup.

If you want a more detailed explanation, read this article.

Webpack + Typescript + UglifyJS

Can only remove unused functions and variables.

For development build run npm run webpack (Typescript -> ES5 bundle).

For production build run npm run webpack-prod (Typescript -> ES5 bundle -> UglifyJS).

When transpiling classes with Typescript, it generates an IIFE with an assignment to the prototype. It is considered as a side effect by UglifyJS and it skips removing of it.

See the issues below:

Webpack + Typescript + Babili

Can remove unused classes, functions and variables.

For development build run npm run webpack-es2015 (Typescript -> ES2015 bundle).

For production build run npm run webpack-es2015-prod (Typescript -> ES2015 bundle -> Babili).

It uses the Babili ES6+ aware minifier and solves the issues what UglifyJS has.

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].