Angular 在**build--prod时延迟加载不起作用**
当运行ng serve时它工作,但当构建ng构建--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
请帮帮我!谢谢我到处都找过了,但没有找到比禁用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
}
}
}
}
}
}
}
}