title: Angular 5 - Dev/QA build using ng build with uglify and minify (like ng build --prod)
body: <p>I am using angular5 and angular-cli and have requirement to uglify/minify code which can be viewed in inspector tool of browser.
  My angular-cli.json has:</p>
  
  <pre><code>"environmentSource": "environments/environment.ts",
  "environments": {
      "dev": "environments/environment.ts",
      "prod": "environments/environment.prod.ts"
  }
  </code></pre>
  
  <p>For production it is running fine by <strong>ng build --prod</strong>
  But this can be used only for production enviornment.
  I want to do same for dev enviornments but i am not able to acheive it.
  I have already tried most of the options of build with value of prod except of --enviornment:</p>
  
  <pre><code>Flag                 --dev    --prod
  --aot                false    true
  --environment        dev      prod
  --output-hashing     media    all
  --sourcemaps         true     false
  --extract-css        false    true
  --named-chunks       true     false
  --build-optimizer    false    true with AOT and Angular 5
  </code></pre>
  
  <p>For example </p>
  
  <pre><code>ng build --aot=true --output-hashing=all --sourcemaps=false --extract-css=true --named-chunks=false --build-optimizer true
  </code></pre>
  
  <p>But it is not working for me. Not creating uglified code for this enviornment(here dev).</p>
  
  <p>how can I use same build command for other environments? How can i use prod optimisations in other environments?</p>