This node application prepares an Angular application to be able to be used on the Heroku environment.
It is assumed your package already has
npm install @angular/cli@latest @angular/compiler-cli --save-dev
-
Copies
@angular/cli
and@angular/compiler-cli
fromdevDependencies
todependencies
-
Adds
"postinstall": "ng build --aot -prod"
toscripts
-
Adds Node and NPM engines
"engines":{ "node":"11.9.0", "npm":"6.11.3" };
-
Copies
"typescript"
fromdevDependencies
todependencies
-
Install
install [email protected]
-
Install Express server with
npm install express path --save
-
Creates the
server.js
file with the correct dist directory -
Change the
"start"
command tonode server.js