M
M
mletov2019-05-16 18:02:09
Angular
mletov, 2019-05-16 18:02:09

How to increase Angular compilation speed?

I'm trying to start actively using Angular in production (server part on ASP.NET Core).
On the one hand, I was impressed by the thoughtfulness and convenience of the architecture. On the other hand, it depresses the speed of compilation, most of the time I wait for the changes I made to be applied, there is no amount of work done per day.
Several related questions at once:
1) I know about change detection. But changes without refreshing the page in the browser are well and cheerfully picked up in the demo template from Visual Studio. And in my projects (I did it based on Metanit lessons) when I started using, for example, Angular 5 + Material - they are picked up after 20 seconds. And they are often picked up crookedly, for example, on the page there is one grid from material, suddenly there are 2 or 3 of them, change detection does not always process components correctly. After a complete recompilation by F5 in the browser, everything becomes normal.
I made a project on Angular 7, so they are not picked up at all.
In real work with Angular, do you use change detection more often or do you still use full compilation via F5?
2) Complete recompilation via F5 in the browser is also not an option. After pressing F5, the project is updated in about 30-40 seconds, and I tried to connect Devextreme to the project - so the compilation time immediately jumped to 2-2.5 minutes.
Is this a normal time for a project or can it still be accelerated?
3) Googled on the topic of speeding up the compilation of Angular, googled that the main way to speed up is to set other angular cli options when compiling, like ng serve --source-map=false
But I can’t figure out where to insert these options. I don’t manually generate a project through the command line, I did it according to this lesson https://metanit.com/sharp/aspnetcore/1.1.php, everything is automatically configured and compiled there, I suspect that you need to specify webpack.config somewhere here. js, but I don't quite understand where exactly.
In general, I will be grateful for tips and tricks on speeding up Angular and with Angular.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question