title: Angular2 load script conditionally using Angular CLI?
body: <p>Can I load scripts conditionally using Angular CLI???</p>
  
  <p>In this file, I want to load one script depending on the enviroment or a variable. So In production I want to load a script while in develop not.
  Is there a way to do that? How?</p>
  
  <p><strong>angular-cli.json</strong></p>
  
  <pre><code>...
  "styles": [
      "../node_modules/bootstrap/dist/css/bootstrap.css",
      "../node_modules/font-awesome/css/font-awesome.min.css",
    ],
    "scripts": [
      "../node_modules/jquery/dist/jquery.js",
      "../node_modules/ion-rangeslider/js/ion.rangeSlider.js",
      "../node_modules/web-animations-js/web-animations.min.js",
      &lt;---- LOAD HERE ONE SCRIPT DEPENDING ON ENVIRONMENT OR VARIABLE 
    ],
    "environments": {
      "source": "environments/environment.ts",
      "dev": "environments/environment.ts",
      "prod": "environments/environment.prod.ts"
    }
   ...
  </code></pre>