There are various ways to optimize our code like minification, concatenation, bundling our file etc . Tree shaking is one of the key concepts to optimize our code and remove unnecessary code. Tree shaking is the latest techniques that are performed by our build system after the Typescript
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
...
},
...
}
The first two lines of
The important factors to keep in our mind for tree shaking is:-
a) We need to use version 2.x of the package awesome-typescript-loader.
b) We need to keep the library and code in the same chunks of code.
c)We need to minify our files before build making.
Whereas web pack is basically performing the task of removing the unnecessary codes, but it will not remove unnecessary code from the bundle. It is the minifier of UglifyJsPlugin, that removes the code which is not required in the bundle.
More From Oodles
Ready to innovate? Let's get in touch
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Palak Sharma
Palak is enthusiastic and passionate about coding , Her areas of expertise in coding languages are JavaScript and angular , html and css .