My team has recently switched to Angular 4 from Angular 2. Also we switched Webpack from version 1.x to 3.8.1. The compilation time became ridiculously slow (around 50 minutes). Recompilation on small changes takes seconds though.
Overall size of the frontend is 300MB. Initial assumption was that problem happens because of too many libraries in node_modules. But after removing over 90% of our project files (node_modules are not touched) the compilation time became 2 minutes and overall directory size is 280MB. Where 5 MB is what left of our project files and the rest 275MB is the node_modules folder. So the problem should be somewhere in configs or in the way how we write the code. Did anyone have this problem before? What could possibly cause such problems?
Unfortunately, I am not allowed to share any code. But will very appreciate if anyone has any advice.