如何找出在 Angular 中部署失败的原因? [英] How to figure out why deployment failed in Angular?

查看:25
本文介绍了如何找出在 Angular 中部署失败的原因?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图打包 Angular 项目时,我将指令输入到 cmd:ng build --prod,几分钟后,我通过 IIS 部署了该项目.但是我无法在浏览器中访问该项目.控制台有问题.

When I was trying to pack up the Angular project I input the directive to cmd: ng build --prod, after few minutes, I deployed the project by IIS. But I can't visit the project in brower. There is something wrong in console.

什么是rn?我真的不知道.我再次打包,但使用指令:ng build.并且一切顺利.但是项目的大小比ng build --prod要大.我应该怎么做才能找出错误?

What are r and n? I really don't know. I pack up again, but use the directive: ng build. And everything successful. But the size of the project is bigger than ng build --prod. What should I do to figure out the error?

推荐答案

尝试获取源映射和包,然后找出错误的确切位置.您可以在本地执行此操作以与 AOTsourcemaps

Try getting the source map along with the bundles and then figure out where exactly the error is. You can do this on your local to run with AOT along with sourcemaps

ng serve --aot -sourcemaps

如果您的源地图未生成,您可以点击链接此处 得到它们.

If your source maps are not getting generated, you can follow the link here to get them.

这篇关于如何找出在 Angular 中部署失败的原因?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆