3

I am using visual studio code to run angular projects. While running the server through npm start, my laptop takes a lot of time compared to others. Is it related to my pc specifications or I can do something to improve it? I think my Pc Specs are suitable for npm to run smoothly 64 bit 2TB HD i5 processor

1 Answers1

1

If you are trying to just run the project to develop it you should be using ng serve (you must have the angular cli installed). ng serve builds the project into ram and watches your files for changes, so it is very fast.

If you are trying to run your project for other people to use, you should be using ng build and/or ng build --prod to build your project and then a web server to serve it from there on.

You can even add addtional parameters to ng build such as --build-optimizer=true or --sourcemaps=false to optimize the output.

You can find a more detailed guide and all the parameters here.

Regarding the build time, afaik there is no way of speeding it up, but builds are usually only done every once in a while, so you should have no problems with a couple of minutes of build time.

David
  • 1,636
  • 19
  • 27