My project is working with "ng serve" command but shows just a blank screen when building. And this message is shown in the console:
Angular is running in the development mode. Call enableProdMode() to enable the production mode.
No route is loaded and there is just an empty tag in the middle of the template.
I tried both AOT and JIT. production and development modes. All blank
I just published the project here: https://razesheydaei.ir
This is my angular.json file:
{
"$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"
}
And the tsconfig.json:
{
"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
}
}
And the routes:
const routes: Routes = [
{
path: '',
component: MainComponent,
canActivate: [AuthGuard],
children: [
{
path: 'user',
loadChildren: () => import('./systems/user/user.module').then(mod => mod.UserModule)
},
{
path: 'usergroup',
loadChildren: () => import('./systems/user-group/user-group.module').then(mod => mod.UserGroupModule)
},
{
path: 'flight',
loadChildren: () => import('./systems/flight/flight.module').then(mod => mod.FlightModule)
}
]
},
{
path: '',
component: SimpleComponent,
children: [
{
path: '',
component: LoginComponent
},
{
path: 'login',
component: LoginComponent
}
]
},
{
path: '**',
component: LoginComponent
}
];