title: Angular: Only building ES2015 on ng build --prod
body: <p>I want the production build output to only produce ES2015 builds and not ES5 builds.</p>
  
  <p>I am using Angular 8 with Ivy rendering engine on.</p>
  
  <p>I am also attaching my <strong>angular.json, browserslist, tsconfig.json</strong> files.</p>
  
  <h3>angular.json</h3>
  
  <pre><code>{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "newProjectRoot": "projects",
    "projects": {
      "front-end-inventory": {
        "projectType": "application",
        "schematics": {
          "@schematics/angular:component": {
            "style": "scss"
          }
        },
        "root": "",
        "sourceRoot": "src",
        "prefix": "app",
        "architect": {
          "build": {
            "builder": "@angular-devkit/build-angular:browser",
            "options": {
              "outputPath": "dist/front-end-inventory",
              "index": "src/index.html",
              "main": "src/main.ts",
              "polyfills": "src/polyfills.ts",
              "tsConfig": "tsconfig.app.json",
              "aot": true,
              "assets": [
                "src/favicon.ico",
                "src/assets",
                "src/manifest.webmanifest",
                "src/.htaccess"
              ],
              "styles": [
                "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
                "src/styles.scss"
              ],
              "scripts": [
                "./node_modules/jquery/dist/jquery.slim.min.js"
              ]
            },
            "configurations": {
              "production": {
                "fileReplacements": [
                  {
                    "replace": "src/environments/environment.ts",
                    "with": "src/environments/environment.prod.ts"
                  }
                ],
                "optimization": true,
                "outputHashing": "all",
                "sourceMap": false,
                "extractCss": true,
                "namedChunks": false,
                "aot": true,
                "extractLicenses": true,
                "vendorChunk": false,
                "buildOptimizer": true,
                "budgets": [
                  {
                    "type": "initial",
                    "maximumWarning": "2mb",
                    "maximumError": "5mb"
                  }
                ],
                "serviceWorker": true,
                "ngswConfigPath": "ngsw-config.json"
              },
              "staging": {
                "fileReplacements": [
                  {
                    "replace": "src/environments/environment.ts",
                    "with": "src/environments/environment.staging.ts"
                  }
                ],
                "optimization": true,
                "outputHashing": "all",
                "sourceMap": true,
                "extractCss": true,
                "namedChunks": false,
                "aot": true,
                "extractLicenses": true,
                "vendorChunk": false,
                "buildOptimizer": true,
                "budgets": [
                  {
                    "type": "initial",
                    "maximumWarning": "2mb",
                    "maximumError": "5mb"
                  }
                ],
                "serviceWorker": true,
                "ngswConfigPath": "ngsw-config.json"
              }
            }
          },
          "serve": {
            "builder": "@angular-devkit/build-angular:dev-server",
            "options": {
              "browserTarget": "front-end-inventory:build"
            },
            "configurations": {
              "production": {
                "browserTarget": "front-end-inventory:build:production"
              }
            }
          },
          "extract-i18n": {
            "builder": "@angular-devkit/build-angular:extract-i18n",
            "options": {
              "browserTarget": "front-end-inventory:build"
            }
          },
          "test": {
            "builder": "@angular-devkit/build-angular:karma",
            "options": {
              "main": "src/test.ts",
              "polyfills": "src/polyfills.ts",
              "tsConfig": "tsconfig.spec.json",
              "karmaConfig": "karma.conf.js",
              "assets": [
                "src/favicon.ico",
                "src/assets",
                "src/manifest.webmanifest",
                "src/.htaccess"
              ],
              "styles": [
                "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
                "src/styles.scss"
              ],
              "scripts": []
            }
          },
          "lint": {
            "builder": "@angular-devkit/build-angular:tslint",
            "options": {
              "tsConfig": [
                "tsconfig.app.json",
                "tsconfig.spec.json",
                "e2e/tsconfig.json"
              ],
              "exclude": [
                "**/node_modules/**"
              ]
            }
          },
          "e2e": {
            "builder": "@angular-devkit/build-angular:protractor",
            "options": {
              "protractorConfig": "e2e/protractor.conf.js",
              "devServerTarget": "front-end-inventory:serve"
            },
            "configurations": {
              "production": {
                "devServerTarget": "front-end-inventory:serve:production"
              }
            }
          }
        }
      }
    },
    "defaultProject": "front-end-inventory"
  }
  
  </code></pre>
  
  <h3>browserlist</h3>
  
  <pre><code># This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
  # For additional information regarding the format and rule options, please see:
  # https://github.com/browserslist/browserslist#queries
  
  # You can see what browsers were selected by your queries by running:
  #   npx browserslist
  
  Chrome &gt; 70
  
  </code></pre>
  
  <h3>tsconfig.json</h3>
  
  <pre><code>{
    "compileOnSave": false,
    "compilerOptions": {
      "baseUrl": "./",
      "outDir": "./dist/out-tsc",
      "sourceMap": true,
      "declaration": false,
      "downlevelIteration": true,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "module": "esnext",
      "moduleResolution": "node",
      "importHelpers": true,
      "target": "es2015",
      "noImplicitAny": true,
      "strictNullChecks": true,
      "typeRoots": [
        "node_modules/@types"
      ],
      "lib": [
        "es2018",
        "dom"
      ]
    }
  }
  
  </code></pre>
  
  <h2>Current build result</h2>
  
  <p>The current build creates files but the <strong>index.html</strong> does not use type module but I want the index.html to use only module script only</p>
  
  <h3>Current Index.html Result</h3>
  
  <pre><code>&lt;script src="runtime.dd2d878cd9ae88476a26.js"&gt;&lt;/script&gt;
  &lt;script src="polyfills.8ce2a1027d74b4930bab.js"&gt;&lt;/script&gt;
  &lt;script src="scripts.b7617d15d290ae695226.js"&gt;&lt;/script&gt;
  &lt;script src="main.c6dce3ad2ed82428de43.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <h3>Expected Index.html Result</h3>
  
  <pre><code>&lt;script src="runtime.dd2d878cd9ae88476a26.js" type="module"&gt;&lt;/script&gt;
  &lt;script src="polyfills.8ce2a1027d74b4930bab.js" type="module"&gt;&lt;/script&gt;
  &lt;script src="scripts.b7617d15d290ae695226.js" type="module"&gt;&lt;/script&gt;
  &lt;script src="main.c6dce3ad2ed82428de43.js" type="module"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>The resultant built scripts are also not ES2015 ready.</p>
  
  <h3>Side Note</h3>
  
  <p>If reverting back the browserlist to default configuration provided by angular produces both ES5 and ES2015 results.</p>