By default when you run the
ng build command on your Angular project using the Angular CLI it will output the build files to the
This can be inconvenient if you have automated pipelines and want to be able to write out different environment builds to different directories.
However there is an option that you can pass into the
ng build command to specify the output directory.
If you wanted to write your code to a directory called
/dist-stage for example, you can use the
--output-path option to specify where to write the build files out to:
ng build --output-path dist-stage
dist-stage that you passed in as an option.