I updated to Angular 12 yesterday which uses Webpack 5.
The release notes blog says:
In the v11 update we added experimental support for Webpack 5. Today, we’re happy to announce that we’re releasing a production ready version of Webpack 5 support in Angular.
I'd like to know what specifically in Webpack 5 can improve my Angular project.
Unfortunately running on Windows I'm seeing much longer build times for ng serve
from around 70 seconds to 106 seconds. The build time is much longer (and yes I'm using incremental builds but that first build is very important) and I'm also not seeing any reduction in bundle sizes.
I believe that the sass compiler could be partly responsible for the increased times I'm seeing. In fact using the speed-measure-webpack-plugin I was able to see a lot of time dedicated to sass-loader. Are there any plugins I can change in webpack config to help cache the sass, use a different sass loaded, compiler or something like that? I am using the @angular-builders/custom-webpack package which lets me add plugins.
The Webpack release notes get me excited, and it seems there's a lot of potential for improving build performance but unfortunately I have yet to see it with Angular and I'm getting worse results.