Skip to main content

Posts

Showing posts from March, 2020

Stop Using Shared Material Module

Time To Prove Ourselves Wrong # In my last project where we had our custom components like Grid, Tables, Forms and I did ended up using a big Shared Material Module, as all the components were written on top of Angular Material Component. And now it’s time to prove myself wrong that it was not a good approach. Let’s create a new App, and we will cover what’s wrong with this approach and how it increases the bundle size. We will be using  webpack-bundle-analyzer  to check the bundle size. Run the below command to create a new App. Make sure you are using the latest Angular CLI ng new demoapp next install  webpack-bundle-analyzer  using the below command now add the given script in  package.json "analyze": "ng build --prod --stats-json && webpack-bundle-analyzer ./dist/demoapp/stats-es2015.json" now run the below command to view the stats. Bundle Analyzer 1.1 The above command opens a page, as shown in the image above. Now, let’s add Angula