node.js - 使用 VSC 从我的应用程序中的 node_modules 调试库
问题描述
我工作的企业使用 react.js 开发了一个内部应用程序,typescript 也开发了一些节点模块,现在轮到我使用它了,我发现了一个让我想到这个问题的问题。
如何使用 VSC 从我的应用程序中调试节点模块?我可以访问这两个源代码。我的目录结构。
Documents
|-- my-app
|--src
|--App.tsx #File that import @enterprise/my-node-module and use someFunction that I want to debug
|-- my-node-module
|--src
|--Action.ts #File with someFunction that I want to debug
|-- another-node-module #Another node module
我还配置了 VSC 来调试我的应用程序并且运行良好。
{
"version": "0.2.0",
"configurations": [{
"type": "chrome",
"request": "attach",
"port": 9222,
"name": "Attach Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"name": "Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/src",
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
},
"runtimeArgs": ["--preserve-symlinks"]
}
]
}
我的应用程序中的 Package.json 脚本
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build"
},
如您所见,我尝试使用它进行调试,但没有。造成这种情况的主要原因是我不知道如何直接调试模块,并且已经构建为带有 redux-thunk 的中间件。
希望有人可以帮助我。
解决方案
推荐阅读
- arrays - Flutter 2D 游戏图形
- c - 交换序列中的最小和最大数字(C语言)
- python - 如何使用joblib并行写入文件?JoinableQueue 问题
- php - 如何在laravel的同一视图文件中获取url中参数的值
- php - 预期响应代码为 250,但得到代码“550”,使用 Laravel 7 和 SendGrid 显示消息“550 未经身份验证的发件人不允许”
- reflection - 使用 F# 反射将两个对象与默认 IComparable 实现进行比较
- javascript - 将对象内的相同 ID 连接到一个对象数组
- android - Android Studio 找不到 Kotlin 依赖项
- jmeter - 如何在 JMeter 中调用“最简单”的随机浮动变量
- django - 没有从 ASSIGNED 视图流的过渡