Introducing ReUI:Open-source UI components and apps built with React, Next.js and Tailwind CSS
Browse ReUI

Angular: ng build --prod = Error: Unknown argument: prod


The command ng build --prod its not working, it gave me the Error: Unknown argument: prod

I want to use it because I want to have the AOT to be optimized.

So right now I'm testing for first time the build option and I face this


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (7)


Angular's build process has changed in recent versions, and --prod is now deprecated. Instead, try using ng build --configuration=production, which enables AOT and optimizations automatically. You might also want to check your Angular CLI version with ng version to ensure compatibility. I ran into a similar issue while optimizing an app's performance. By the way, if you're looking for a lightweight security tool, you can smadav app download
for extra protection.



Angular's recent updates have deprecated the --prod flag in favor of --configuration=production. You can try running ng build --configuration=production instead. This enables AOT and other optimizations automatically. Hope this helps! Also, if you're into gaming apps, you might find the 3 patti blue app download
interesting.



Angular's build process has evolved, and the --prod flag is now deprecated. Instead, try using ng build --configuration=production for an optimized AOT build. Hope this helps! By the way, if you're into mobile apps, you might findBitlife app download
interesting.



Great question! The Angular CLI recently removed the --prod flag, as production optimizations are now enabled by default with ng build. Instead, try using ng build --configuration=production to achieve the same result. Hope this helps! By the way, if you're into mobile apps, you might find carx street app download
interesting.



"Great discussion! The --prod flag was deprecated in Angular 12, so using ng build --configuration=production should work instead. Optimizing AOT is crucial for performance, and it’s great that you’re testing build options. Also, if you’re looking for efficient storage solutions while working on projects, you might find Terabox app download
useful. Hope this helps!



Hi Arturo,

In the latest version of Angular, you no longer need to use the `--prod` flag with the `ng build` command. The production configurations, including Ahead-of-Time (AOT) compilation, are now included by default when you use the `ng build` command.

You can simply use the following command to build your Angular application for production:


ng build


This command will automatically apply the production optimizations, including AOT compilation, without the need for the `--prod` flag.

For more detailed information, you can refer to the Angular CLI documentation:
https://angular.io/cli/build

Feel free to give it a try, and if you encounter any further issues or questions, don't hesitate to ask.

Thanks


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(