I have following script in my angular2 project, usually when I want to run project the command I use will be ng serve... (start-prod, start-uat, start-dev)
However, after I read about AOT https://angular.io/guide/aot-compiler#workflow-and-convenience-script I try to follow the step and don't know how to start application because, ng serve is only thing I used at the beginning.
what script should I use to start ?
"scripts": {
"ng": "ng",
"start-prod": "ng serve --environment=prod --deploy / --proxy-config proxy.conf.json",
"start-uat": "ng serve --environment=uat --deploy / --proxy-config proxy.conf.json",
"start-dev": "ng serve --environment=dev --deploy / --proxy-config proxy.conf.json",
"build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup-config.js",
"build-prod": "ng build --environment=prod --aot false output-hashing none --deploy /",
"build-uat": "ng build --environment=uat --aot false output-hashing none --deploy /",
"build-dev": "ng build --environment=dev --aot false output-hashing none --deploy /",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
Also, I want to run AOT with ngc not AOT from web pack, I have issues on using custom decorator https://github.com/rangle/angular-2-aot-sandbox and I want to try this build on production
You can run:
This will create files in your dist folder that will be aot build.
aot
is by default in prod. so specifying--aot
doesn't make any effect. see this answer.