I build an angular 4 app, and build it trough angular-cli 1.0.4 with the command ng build --prod. So here I could not get a dist folder out of this to deploy in Microsoft azure. What should I do to get the dist folder after ng build --prod is done? Can someone help me with a better solution to publish my app to a server?
1 Answer
Use ng build --env=prod instead of ng build --prod and see if that helps. When I made a brand new project and ran ng build --prod, I got Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' error. But when I ran ng build --env=prod dist was generated fine.
5 Comments
Aakash N
I got the dist folder into the app. Thank you Ram.
Yakov Fain
I believe this error was fixed in Angular CLI 1.2.4.
RKG
Thanks for the info @yakov-fain. I was using 1.2.0.
RKG
@YakovFain, upgrading to 1.2.4 did not fix that error. Do you know of an angular-cli issue I can keep track of?
RKG
Nevermind, I found the issue on github. github.com/angular/angular-cli/issues/7125
ng build --prodcommand? Do you have write permissions on the project folder?"@angular/cli": "^1.2.3". Also note that every time you dong buildorng serve, the dist path is cleared. This can be turned off by providing--no-delete-output-path