简体   繁体   English

如何使源地图在使用webpack和angular5的jhipster应用程序的chrome中工作?

[英]How do I get the source maps to work in chrome for jhipster app that uses webpack and angular5?

I have generated an JHipster Gateway project which is a Java Spring app with a Angular5 frontend. 我已经生成了一个JHipster Gateway项目,它是一个带有Angular5前端的Java Spring应用程序。 JHipster configures the Angular app using WebPack. JHipster使用WebPack配置Angular应用程序。

I am having trouble getting debugging to work for the Angular application. 我在调试调试以使用Angular应用程序时遇到麻烦。 I haven't done this in a while so it may be a rookie mistake so I am looking for any help I can get. 我有一段时间没有这样做了,所以这可能是菜鸟的错误,因此我正在寻找可以得到的任何帮助。

The WebPack configuration file for the dev environmen has a line in it for configuring the source map that is contains the following: 开发环境的WebPack配置文件中有一行用于配置源映射,其中包含以下内容:

module.exports = webpackMerge(commonConfig({ env: ENV }), {
devtool: 'eval-source-map',

From what I understand, I should see webpack:// in the sources tab but I don't see it. 据我了解,我应该在“源”选项卡中看到webpack://,但没有看到。

Can anyone point me in the right direction, this is probably more of a WebPack question than jhipster. 任何人都可以向我指出正确的方向,这可能是WebPack问题,而不是jhipster问题。

Is there something I else I need todo to get to debug my typescript in chrome? 还有其他我需要做的事情来调试chrome中的打字稿吗?

Thanks so much for your help! 非常感谢你的帮助!

Oops ... my bad ... so embarrassed. 糟糕...我的糟糕...太尴尬了。

I didn't realize that the webpack build failed because I changed versions of node and I needed to re-install my node modules to get the sass processor to build properly. 我没有意识到Webpack构建失败,因为我更改了节点版本,并且需要重新安装节点模块才能使sass处理器正确构建。 It looks like the SASS processing was failing in the webpack build and I'm guessing that happens before it generates the source maps. 看起来SASS处理在Webpack构建中失败了,我猜这是在生成源映射之前发生的。

Once I fixed the problem I did see the source maps and the webpack:// in my source tab in chrome. 解决问题后,我确实在chrome的“源”选项卡中看到了源映射和webpack://。

Sorry about that 对于那个很抱歉

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM