0

What do I need to build my Angular 2 project?

 2 years ago
source link: https://www.codesd.com/item/what-do-i-need-to-build-my-angular-2-project.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

What do I need to build my Angular 2 project?

advertisements

I've built an Angular 2 web app, and it works great on my computer. But I went to build for production, and angular-cli built a "Hello World" App instead of using my files to build my project. I was using npm start to build it. Now I've kind of messed things up because I used ng serve, and now it's always using files in the src folder, instead of my app folder.

Anyways, my point is, once I fix this I would like to go down the proper path. What am I supposed to use to build my project? npm build? ng build? Should I be using Angular-Cli?

The Angular2 arena is changing so much I'm really not sure which path I'm supposed to be on anymore, is angular-cli the most up-to-date way of building Angular 2 projects? Should I be using ng build --prod?


The suggestion for building your application for production is to use the production environment -prod and ahead of time compilation --aot so your production build command will look like this:

ng build -prod --aot


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK