Reputation: 3097
I just used the Angular+ASP.NET Core template for a new application, run it in debug mode, stopped it, made no change, re-run it in debug mode and so on.
Startup time is excruciatingly long even with no change whatsoever in between subsequent runs.
I read some time ago that you could keep ng running or something like that to reduce startup time, but I can't find what that is. Is it correct? If so, how to do it?
Upvotes: 1
Views: 1506
Reputation: 8305
It takes long because each time you run the application, it starts an instance of Angular dev server in the background and rebuilds your client app.
In the Configure
method of Startup
class replace
spa.UseAngularCliServer(npmScript: "start");
with
spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");
This will prevent running the Angular dev server automatically.
Now run the dev server manually with npm start
and then run your application.
Further detail - Run "ng serve" independently
Upvotes: 4