6

请教一下,前端项目上,大家怎么调试引入的第三方的包的?

 2 years ago
source link: https://www.v2ex.com/t/812306
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  JavaScript

请教一下,前端项目上,大家怎么调试引入的第三方的包的?

  yazoox · 1 天前 · 1239 次点击

楼主不太会,google/baidu 了一下,貌似也没有搜索到相关的文章。

比如,用 create-react-app 创建了一个前端的应用,然后 npm/yarn install 了一个第三方的包,使用之。现在发现了一些问题,想看看是不是引用的这个包里面,哪里出了问题。怎么 debug 进去啊?在 chrome -> Developer Tools -> Sources 里面,只有我自己项目的源代码文件,没有找到引用的包的源代码文件。

这个引入的第三方的包(例如,https://github.com/justinchmura/js-treeview, etc.),在 github 上面有源代码的。把源代码 clone 下来,怎么操作,比如编译或者连接,能够在 build 我的项目时,把源代码也编进去,然后可以在 chrome 打开网站的时候,sources 里面能够找到源文件,打上断点,调试进去?

我们自己的项目是 webpack4 ,development 环境下,已经设置了 sourcemap ,但是,好像没有啥用。

万分感谢!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK