title: Set base href from an environment variable with ng build
body: <p>Does anyone know how to accomplish this with the angular-cli?  I would like to be able to store the <code>baseHref</code> path in an environment variable within <code>/src/environments/environment.x.ts</code> and based on the selected evironment during build, be able to set the baseHref path.</p>
  
  <p>Something like this:</p>
  
  <blockquote>
    <p>environment.ts</p>
  </blockquote>
  
  <pre><code>export const environment = {
    production: false,
    baseHref: '/'
  };
  </code></pre>
  
  <blockquote>
    <p>environment.prod.ts</p>
  </blockquote>
  
  <pre><code>export const environment = {
    production: true,
    baseHref: '/my-app/'
  };
  </code></pre>
  
  <p>And then call...</p>
  
  <pre><code>ng build --prod
  </code></pre>
  
  <p>...and have my <code>/dist/index.html</code> file show <code>&lt;base href="/my-app/"&gt;</code>.</p>
  
  <p>I thought maybe if I named my environment variable the same as the <code>--base-href</code> build option used in the <a href="https://github.com/angular/angular-cli/blob/master/packages/angular-cli/commands/build.ts" rel="noreferrer">build command</a> that the cli might pick it up, but no dice there either.</p>
  
  <p>Is there someway to reference an environment variable from the command line?  Something like <code>ng build --base-href environment.baseHref</code>?</p>