Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 在**build--prod时延迟加载不起作用**_Angular_Lazy Loading - Fatal编程技术网

Angular 在**build--prod时延迟加载不起作用**

Angular 在**build--prod时延迟加载不起作用**,angular,lazy-loading,Angular,Lazy Loading,当运行ng serve时它工作,但当构建ng构建--prod时它不工作。 请帮帮我!谢谢我到处都找过了,但没有找到比禁用aot(提前)编译更好的解决方案。 运行ng build--prod--aot=false--build optimizer=false就可以了。 您还可以在angular.json ERROR GET http://localhost/styles.09e2c710755c8867a460.css net::ERR_ABORTED 404 (Not Found) 2local

当运行ng serve时它工作,但当构建ng构建--prod时它不工作。
请帮帮我!谢谢

我到处都找过了,但没有找到比禁用aot(提前)编译更好的解决方案。 运行
ng build--prod--aot=false--build optimizer=false
就可以了。 您还可以在
angular.json

ERROR
GET http://localhost/styles.09e2c710755c8867a460.css net::ERR_ABORTED 404 (Not Found)
2localhost/:12 GET http://localhost/runtime-es2015.eb2b81c6532ef7a6ad37.js net::ERR_ABORTED 404 (Not Found)
{
“项目”:{
"":{
“建筑师”:{
“构建”:{
“配置”:{
“配置”:{
“生产”:{
“aot”:错误
}
}
}
}
}
}
}
}
aot和jit(即时)之间的区别在于,模块是在jit中动态编译的,就像在使用
ngserve
的开发模式中一样。 这会加快编译速度,但可能会影响生产性能


当时aot似乎不支持aot或loadchildren。

我到处都找过,但没有找到比禁用aot(提前)编译更好的解决方案。 运行
ng build--prod--aot=false--build optimizer=false
就可以了。 您还可以在
angular.json

ERROR
GET http://localhost/styles.09e2c710755c8867a460.css net::ERR_ABORTED 404 (Not Found)
2localhost/:12 GET http://localhost/runtime-es2015.eb2b81c6532ef7a6ad37.js net::ERR_ABORTED 404 (Not Found)
{
“项目”:{
"":{
“建筑师”:{
“构建”:{
“配置”:{
“配置”:{
“生产”:{
“aot”:错误
}
}
}
}
}
}
}
}
aot和jit(即时)之间的区别在于,模块是在jit中动态编译的,就像在使用
ngserve
的开发模式中一样。 这会加快编译速度,但可能会影响生产性能


当时aot似乎不支持aot或loadchildren。

您是否解决了问题?您是否解决了问题?
{
   "projects":{
      "<your-project-name>":{
         "architect":{
            "build":{
               "configurations":{
                  "configurations":{
                     "production":{
                        "aot":false
                     }
                  }
               }
            }
         }
      }
   }
}