Angular CLI build target vs environment : <p>In the <a href="https://github.com/angular/angular-cli" rel="noreferrer">Angular CLI</a>, what is the difference between the <code>--target</code> and <code>--environment</code> options when running the <a href="https://github.com/angular/angular-cli/wiki/build" rel="noreferrer">build</a> command?</p>

<p>From the documentation:</p>

<blockquote>
  <p>ng build can specify both a build target (--target=production or --target=development) and an environment file to be used with that build (--environment=dev or --environment=prod). By default, the development build target and environment are used.</p>
</blockquote>

<p>However, they never really clarify the distinction between the two.</p>

<p>From what I can gather, the <code>--environment</code> flag controls which environment file (<code>environment.ts</code> vs <code>environment.prod.ts</code>) gets used when doing the build. But then what does <code>--target</code> control?</p>
