title: Blank page when building Angular 8 project but works perfectly using "ng serve"
body: <p>My project is working with "ng serve" command but shows just a blank screen when building. And this message is shown in the console:</p>
  
  <blockquote>
    <p>Angular is running in the development mode. Call enableProdMode() to enable the production mode.</p>
  </blockquote>
  
  <p>No route is loaded and there is just an empty  tag in the middle of the template.</p>
  
  <p>I tried both AOT and JIT. production and development modes. All blank</p>
  
  <p>I just published the project here: <a href="https://razesheydaei.ir" rel="nofollow noreferrer">https://razesheydaei.ir</a></p>
  
  <p>This is my angular.json file:</p>
  
  <pre><code>{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "newProjectRoot": "projects",
    "projects": {
      "ui": {
        "projectType": "application",
        "schematics": {},
        "root": "",
        "sourceRoot": "src",
        "prefix": "app",
        "architect": {
          "build": {
            "builder": "@angular-devkit/build-angular:browser",
            "options": {
              "outputPath": "dist/ui",
              "index": "src/index.html",
              "main": "src/main.ts",
              "polyfills": "src/polyfills.ts",
              "tsConfig": "tsconfig.app.json",
              "aot": false,
              "assets": ["src/favicon.ico", "src/assets"],
              "styles": [
                "src/assets/bower_components/bootstrap/css/bootstrap.min.css",
                "src/assets/icon/themify-icons/themify-icons.css",
                "src/assets/css/jquery.mCustomScrollbar.css",
                "src/assets/pages/chart/radial/css/radial.css",
                "node_modules/@fortawesome/fontawesome-free/css/all.min.css",
                "node_modules/ngx-toastr/toastr.css",
                "src/assets/css/style.css"
              ],
              "scripts": []
            },
            "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"
                  }
                ]
              }
            }
          },
          "serve": {
            "builder": "@angular-devkit/build-angular:dev-server",
            "options": {
              "browserTarget": "ui:build"
            },
            "configurations": {
              "production": {
                "browserTarget": "ui:build:production"
              }
            }
          },
          "extract-i18n": {
            "builder": "@angular-devkit/build-angular:extract-i18n",
            "options": {
              "browserTarget": "ui: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"],
              "styles": ["src/styles.css"],
              "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": "ui:serve"
            },
            "configurations": {
              "production": {
                "devServerTarget": "ui:serve:production"
              }
            }
          }
        }
      }
    },
    "defaultProject": "ui"
  }
  </code></pre>
  
  <p>And the tsconfig.json:</p>
  
  <pre><code>{
    "compileOnSave": false,
    "compilerOptions": {
      "baseUrl": "./",
      "outDir": "./dist/out-tsc",
      "sourceMap": true,
      "declaration": false,
      "downlevelIteration": true,
      "experimentalDecorators": true,
      "module": "esnext",
      "moduleResolution": "node",
      "importHelpers": true,
      "target": "es2015",
      "typeRoots": [
        "node_modules/@types"
      ],
      "lib": [
        "es2018",
        "dom"
      ]
    },
    "angularCompilerOptions": {
      "fullTemplateTypeCheck": true,
      "strictInjectionParameters": true
    }
  }
  </code></pre>
  
  <p>And the routes:</p>
  
  <pre><code>const routes: Routes = [
    {
      path: '',
      component: MainComponent,
      canActivate: [AuthGuard],
  
      children: [
        {
          path: 'user',
          loadChildren: () =&gt; import('./systems/user/user.module').then(mod =&gt; mod.UserModule)
        },
        {
          path: 'usergroup',
          loadChildren: () =&gt; import('./systems/user-group/user-group.module').then(mod =&gt; mod.UserGroupModule)
        },
        {
          path: 'flight',
          loadChildren: () =&gt; import('./systems/flight/flight.module').then(mod =&gt; mod.FlightModule)
        }
      ]
    },
    {
      path: '',
      component: SimpleComponent,
      children: [
        {
          path: '',
          component: LoginComponent
        },
        {
          path: 'login',
          component: LoginComponent
        }
      ]
    },
    {
      path: '**',
      component: LoginComponent
    }
  ];
  </code></pre>