Skip to content

filipesilva/webpack-angular

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Webpack side-effects flag comparison on Angular

This repo compares how using "sideEffects": false reduces bundle size for Angular.

It includes a vendor chunk to add indirection to module loading. This prevents Webpack 3 with UglifyJS from dropping the unused Angular imports but Webpack 4 side effect detection can still remove used code.

cd webpack-3
npm i
npm start 
# source-map-explorer will open on your browser, with all of Angular
cd ../webpack-4
npm i
npm start
# source-map-explorer will open on your browser, with all of Angular still

Webpack 3 bundle sizes:

-rw-r--r-- 1 kamik 197609  790 Jan  5 17:16 main.js
-rw-r--r-- 1 kamik 197609 666K Jan  5 17:16 vendor.js

Webpack 4 bundle sizes:

-rw-r--r-- 1 kamik 197609  825 Jan  5 17:40 main.js
-rw-r--r-- 1 kamik 197609 652K Jan  5 17:40 vendor.js

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published