is ng serve --prod an alternative to expressjs configuration to deploy angular 2 apps ?
ng serve uses webpack-dev-server which is a development server and not suited for production.
do I need to define my own expressjs configuration file ? and why the flag is called prod if it's not suited for production
@amineparis you will need to setup your own web server. It can be anything, node, apache etc.
@amineparis both @grizzm0 & @deebloo are correct, you do not want to use ng serve
in production even if you use the --prod
flag.
The reason that flag exists is to mimic the compilation steps of a production build in a dev environment locally to ease your development process if you so desire.
Summary: use ng serve
for development with or without --prod
and use a production ready web server for deployments.
Just wanted to add that you can find some deployment information at https://angular.io/docs/ts/latest/guide/deployment.html
URL changed to https://angular.io/guide/deployment
The link above is broken @filipesilva
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
@amineparis both @grizzm0 & @deebloo are correct, you do not want to use
ng serve
in production even if you use the--prod
flag.The reason that flag exists is to mimic the compilation steps of a production build in a dev environment locally to ease your development process if you so desire.
Summary: use
ng serve
for development with or without--prod
and use a production ready web server for deployments.