0

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?

2
  • What is the output of the ng build --prod command? Do you have write permissions on the project folder? Commented Jul 26, 2017 at 20:33
  • Additionally, have you already tried updating your cli? The current version is "@angular/cli": "^1.2.3". Also note that every time you do ng buildor ng serve, the dist path is cleared. This can be turned off by providing --no-delete-output-path Commented Jul 26, 2017 at 21:22

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

5 Comments

I got the dist folder into the app. Thank you Ram.
I believe this error was fixed in Angular CLI 1.2.4.
Thanks for the info @yakov-fain. I was using 1.2.0.
@YakovFain, upgrading to 1.2.4 did not fix that error. Do you know of an angular-cli issue I can keep track of?
Nevermind, I found the issue on github. github.com/angular/angular-cli/issues/7125

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.